Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sdk e2e tests workflow #249

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 65 additions & 3 deletions .github/workflows/sdk-e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,73 @@ name: SDK E2E Tests
run-name: "SDK E2E Tests ${{ github.ref_name }} by @${{ github.actor }}"
on:
workflow_dispatch:
pull_request:
paths:
- 'sdks/python/**'
- 'apps/opik-backend/**'
push:
branches:
- 'main'
paths:
- 'sdks/python/**'
- 'apps/opik-backend/**'

jobs:
run-e2e:
name: SDK E2E Tests
name: SDK E2E Tests ${{matrix.python_version}}
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdks/python

strategy:
fail-fast: false
matrix:
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- name: echo
run: echo
- name: Checkout
uses: actions/[email protected]

- name: Setup Python ${{matrix.python_version}}
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python_version}}

- name: Install opik SDK
run: |
pip install -r tests/test_requirements.txt
pip install .

- name: Run latest opik server
run: |
cd ../../deployment/docker-compose
docker compose up -d
cd -

- name: Run tests
run: |
echo "Waiting for server to come up..."
sleep 30
export OPIK_URL_OVERRIDE=http://localhost:5173/api
pytest tests/e2e -vv

- name: Keep BE log in case of failure
if: failure()
run: |
docker logs opik-backend-1 > opik-backend_p${{matrix.python_version}}.log

- name: Attach BE log
if: failure()
uses: actions/upload-artifact@v4
with:
name: opik-backend-log-p${{matrix.python_version}}
path: sdks/python/opik-backend_p${{matrix.python_version}}.log

- name: Stop opik server
if: always()
run: |
cd ../../deployment/docker-compose
docker compose down
cd -

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ pip-log.txt

# charts
deployment/helm_chart/opik/charts
deployment/helm_chart/opik/values-cloud-test.yaml
deployment/helm_chart/opik/values-test.yaml
temp
3 changes: 1 addition & 2 deletions sdks/python/tests/e2e/test_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
def test_experiment_creation_via_evaluate_function__happyflow(
opik_client: opik.Opik, dataset_name: str, experiment_name: str
):
# TODO: this test is not finished, it only checks that the script is not failing

# TODO: this test is not finished, it does not check experiment items content
dataset = opik_client.create_dataset(dataset_name)

dataset.insert(
Expand Down
Loading