SDK E2E Tests 249/merge by @liyaka #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ${{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: 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: | | |
# TIMEOUT=180 | |
# port=5173 | |
# while ! echo >/dev/tcp/localhost/$port; do | |
# local current_time=$(date +%s) | |
# if (( current_time - start_time >= TIMEOUT )); then | |
# echo "Timeout reached. Connection to localhost on port $port unsuccessful" | |
# return 1 | |
# fi | |
# sleep 5 # Wait for 5 seconds before rechecking | |
# done | |
# echo "Connection to localhost on port $port successful" | |
export OPIK_URL_OVERRIDE=http://localhost:$port/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 - | |