Appplication E2E tests - all_features #124
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: Application E2E tests | |
env: | |
OPIK_SENTRY_ENABLE: False | |
on: | |
workflow_dispatch: | |
inputs: | |
suite: | |
type: choice | |
description: 'Choose which test suite to run' | |
required: true | |
default: 'all_features' | |
options: | |
- all_features | |
- sanity | |
- projects | |
- traces | |
- datasets | |
- experiments | |
- prompts | |
- feedback_definitions | |
pull_request: | |
paths: | |
- 'sdks/code_generation/fern/openapi/openapi.yaml' | |
- 'tests_end_to_end/**' | |
run-name: Appplication E2E tests - ${{ github.event.inputs.suite || 'all_features' }} | |
jobs: | |
run_suite: | |
name: "Run suite: ${{ github.event.inputs.suite || 'all_features' }}" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install Opik | |
run: pip install ${{ github.workspace }}/sdks/python | |
- name: Install Test Dependencies | |
run: | | |
pip install -r ${{ github.workspace }}/tests_end_to_end/test_requirements.txt | |
pip install allure-pytest | |
playwright install | |
- name: Install Opik (Local) | |
env: | |
OPIK_USAGE_REPORT_ENABLED: false | |
run: | | |
cd ${{ github.workspace }}/deployment/docker-compose | |
docker compose up -d --build | |
- name: Check Docker pods are up (Local) | |
run: | | |
chmod +x ./tests_end_to_end/installer_utils/check_docker_compose_pods.sh | |
./tests_end_to_end/installer_utils/check_docker_compose_pods.sh | |
shell: bash | |
- name: Check backend health (Local) | |
run: | | |
chmod +x ./tests_end_to_end/installer_utils/check_backend.sh | |
./tests_end_to_end/installer_utils/check_backend.sh | |
shell: bash | |
- name: Check app is up via the UI (Local) | |
run: | | |
pytest -v -s ${{ github.workspace }}/tests_end_to_end/installer_utils/test_app_status.py | |
- name: Run suite | |
env: | |
OPIK_BASE_URL: http://localhost:5173 | |
OPIK_TEST_WORKSPACE: default | |
OPIK_TEST_PROJECT_NAME: automated_tests_project | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
run: | | |
if [ "${{ github.event_name }}" == "pull_request" ]; then | |
SUITE="all_features" | |
else | |
SUITE="${{ github.event.inputs.suite }}" | |
fi | |
cd ${{ github.workspace }}/tests_end_to_end | |
export PYTHONPATH='.' | |
# Run the appropriate test suite | |
if [ "$SUITE" == "projects" ]; then | |
pytest -s tests/Projects/test_projects_crud_operations.py --browser chromium | |
elif [ "$SUITE" == "traces" ]; then | |
pytest -s tests/Traces/test_traces_crud_operations.py --browser chromium | |
elif [ "$SUITE" == "datasets" ]; then | |
pytest -s tests/Datasets/ --browser chromium | |
elif [ "$SUITE" == "experiments" ]; then | |
pytest -s tests/Experiments/test_experiments_crud_operations.py --browser chromium | |
elif [ "$SUITE" == "prompts" ]; then | |
pytest -s tests/Prompts/test_prompts_crud_operations.py --browser chromium | |
elif [ "$SUITE" == "feedback_definitions" ]; then | |
pytest -s tests/FeedbackDefinitions/test_feedback_definitions_crud.py --browser chromium | |
elif [ "$SUITE" == "sanity" ]; then | |
pytest -s -m sanity --browser chromium | |
elif [ "$SUITE" == "all_features" ]; then | |
pytest -s tests --browser chromium | |
fi | |
- name: Stop Opik server (Local) | |
if: always() | |
run: | | |
cd ${{ github.workspace }}/deployment/docker-compose | |
docker compose down | |
cd - | |
continue-on-error: ${{ github.event_name == 'pull_request' }} |