Skip to content

Commit

Permalink
refactor: move unit and integration tests into single parent directory (
Browse files Browse the repository at this point in the history
  • Loading branch information
axiomofjoy authored Oct 3, 2024
1 parent 7e3f9de commit 314267a
Show file tree
Hide file tree
Showing 98 changed files with 464 additions and 3,441 deletions.
105 changes: 57 additions & 48 deletions .github/workflows/python-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ on:
paths:
- "src/**"
- "tests/**"
- "integration_tests/**"
- "tutorials/**"
- "pyproject.toml"
- "packages/**"
- "tox.ini"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand All @@ -28,8 +28,8 @@ jobs:
runs-on: ubuntu-latest
outputs:
phoenix: ${{ steps.filter.outputs.phoenix }}
packages: ${{ steps.filter.outputs.packages }}
phoenix_evals: ${{ steps.filter.outputs.phoenix_evals }}
phoenix_otel: ${{ steps.filter.outputs.phoenix_otel }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
Expand All @@ -39,33 +39,54 @@ jobs:
phoenix:
- "src/**"
- "tests/**"
- "integration_tests/**"
- "tutorials/**"
- "pyproject.toml"
packages:
- "packages/**"
- "tox.ini"
phoenix_evals:
- "packages/phoenix-evals/**"
- "tox.ini"
phoenix_otel:
- "packages/phoenix-otel/**"
- "tox.ini"
tox:
name: Tox
phoenix-evals:
name: Phoenix Evals
runs-on: ${{ matrix.os }}
needs: changes
if: ${{ needs.changes.outputs.phoenix_evals == 'true' }}
strategy:
matrix:
py: [ 3.9, 3.12 ]
os: [macos-12, windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- uses: astral-sh/setup-uv@v3
with:
version: 0.4.18
- run: uv tool install tox --with tox-uv
- run: tox run -e phoenix_evals

phoenix-otel:
name: Phoenix OTel
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.packages == 'true' }}
if: ${{ needs.changes.outputs.phoenix_otel == 'true' }}
strategy:
matrix:
py: [ 3.9, 3.12 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: |
3.9
3.12
- uses: yezz123/setup-uv@v4
python-version: ${{ matrix.py }}
- uses: astral-sh/setup-uv@v3
with:
uv-version: 0.4.8
uv-venv: ${{ github.job }}-${{ github.run_number }}
- run: uv pip install tox==4.18.1 tox-uv==1.11.3
- run: tox run-parallel --parallel-no-spinner -e py39-ci-pkg-phoenix_evals,py312-ci-pkg-phoenix_evals
if: ${{ needs.changes.outputs.phoenix_evals == 'true' }}
version: 0.4.18
- run: uv tool install tox --with tox-uv
- run: tox run -e phoenix_otel

lint:
name: Lint Phoenix
Expand Down Expand Up @@ -106,22 +127,22 @@ jobs:
hatch run notebooks:clean
git diff --exit-code
test:
name: Test Phoenix
unit-test:
name: Unit Tests
runs-on: ${{ matrix.os }}
needs: changes
if: ${{ needs.changes.outputs.phoenix == 'true' }}
strategy:
matrix:
py: ["3.9"]
os: [macos-12, windows-latest, ubuntu-latest]
python-version: ["3.9"]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up python ${{ matrix.python-version }}
- name: Set up python ${{ matrix.py }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.py }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip==${{ env.pip-version }}
Expand All @@ -130,28 +151,22 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get -yqq install postgresql
- name: Run tests (Ubuntu)
- name: Run tests with PostgreSQL
if: runner.os == 'Linux'
run: |
hatch run test:tests --run-postgres
continue-on-error: false
- name: Run tests (macOS)
if: runner.os == 'macOS'
run: |
hatch run test:tests
continue-on-error: false
- name: Run tests (Windows)
if: runner.os == 'Windows'
run: |
hatch run test:tests
continue-on-error: false
run: hatch run test:tests --run-postgres
- name: Run tests without PostgreSQL
if: runner.os != 'Linux'
run: hatch run test:tests

integration-test:
name: Integration Tests
runs-on: ${{ matrix.os }}
needs: changes
if: ${{ needs.changes.outputs.phoenix == 'true' }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, windows-2019, macos-12]
py: [ 3.9, 3.12 ]
os: [ubuntu-latest, windows-latest, macos-12]
services:
postgres:
# Applying this workaround: https://github.com/actions/runner/issues/822
Expand All @@ -169,15 +184,9 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: yezz123/setup-uv@v4
python-version: ${{ matrix.py }}
- uses: astral-sh/setup-uv@v3
with:
uv-version: 0.4.8
uv-venv: ${{ github.job }}-${{ github.run_number }}
- run: uv pip install tox==4.18.1 tox-uv==1.11.3
- run: tox run-parallel --parallel-no-spinner -e py39-ci-integration_tests
if: ${{ matrix.os != 'ubuntu-latest' }}
timeout-minutes: 15
- run: tox run-parallel --parallel-no-spinner -e py39-ci-integration_tests,py312-ci-integration_tests
if: ${{ matrix.os == 'ubuntu-latest' }}
timeout-minutes: 15
version: 0.4.18
- run: uv tool install tox --with tox-uv
- run: tox run -e integration_tests
7 changes: 5 additions & 2 deletions .github/workflows/python-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: 3.9
- run: pip install tox-uv==1.11.3
- run: tox run-parallel --parallel-no-spinner -e test-integration_tests
- uses: astral-sh/setup-uv@v3
with:
version: 0.4.18
- run: uv tool install tox --with tox-uv
- run: tox run -e integration_tests
- uses: slackapi/slack-github-action@v1
if: failure()
env:
Expand Down
34 changes: 0 additions & 34 deletions integration_tests/evals/test_multiple_classify_calls_anthropic.py

This file was deleted.

34 changes: 0 additions & 34 deletions integration_tests/evals/test_multiple_classify_calls_openai.py

This file was deleted.

34 changes: 0 additions & 34 deletions integration_tests/evals/test_multiple_classify_calls_vertex.py

This file was deleted.

Loading

0 comments on commit 314267a

Please sign in to comment.