Skip to content

Commit

Permalink
add sdk e2e tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
liyaka committed Sep 18, 2024
1 parent ed0aa79 commit 6319c60
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 5 deletions.
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

0 comments on commit 6319c60

Please sign in to comment.