From a69f2c55f6c6ee3578e84311fecd5a3ed2599d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20C=C4=83uti=C8=99anu?= Date: Wed, 6 Nov 2024 14:24:48 +0200 Subject: [PATCH] actions workflows --- ...{test_installer.yml => end2end_suites.yml} | 39 ++++++++++++++----- .github/workflows/sanity.yml | 12 +++--- .github/workflows/sdk-e2e-tests.yaml | 6 +-- 3 files changed, 39 insertions(+), 18 deletions(-) rename .github/workflows/{test_installer.yml => end2end_suites.yml} (52%) diff --git a/.github/workflows/test_installer.yml b/.github/workflows/end2end_suites.yml similarity index 52% rename from .github/workflows/test_installer.yml rename to .github/workflows/end2end_suites.yml index c07fd33429..43bb9a431f 100644 --- a/.github/workflows/test_installer.yml +++ b/.github/workflows/end2end_suites.yml @@ -1,10 +1,21 @@ -name: Install Local Version of Opik +name: Run Selected Suite on: + push: + branches: + - andrei/projects-crud-tests workflow_dispatch: + inputs: + suite: + type: choice + description: 'Choose which test suite to run' + required: true + default: 'projects-CRUD' + options: + - projects-CRUD jobs: - test_installation: + e2e_sanity: runs-on: ubuntu-20.04 steps: @@ -31,23 +42,33 @@ jobs: OPIK_USAGE_REPORT_ENABLED: false run: | cd ${{ github.workspace }}/deployment/docker-compose - docker compose up --detach - + docker compose up -d --build + - name: Check Docker pods are up run: | - chmod +x ./tests_end_to_end/installer/check_docker_compose_pods.sh - ./tests_end_to_end/installer/check_docker_compose_pods.sh + 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 run: | - chmod +x ./tests_end_to_end/installer/check_backend.sh - ./tests_end_to_end/installer/check_backend.sh + 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 run: | - pytest -v -s ${{ github.workspace }}/tests_end_to_end/installer/test_app_status.py + pytest -v -s ${{ github.workspace }}/tests_end_to_end/installer_utils/test_app_status.py + + - name: Run suite + run: | + SUITE="${{ github.event.inputs.suite || 'projects-CRUD' }}" + cd ${{ github.workspace }}/tests_end_to_end + export PYTHONPATH='.' + + if [ "$SUITE" == "projects-CRUD" ]; then + pytest -s tests/Projecs/test_projects_crud_operations.py --browser chromium --base-url http://localhost:5173 --setup-show + fi - name: Stop Opik server if: always() diff --git a/.github/workflows/sanity.yml b/.github/workflows/sanity.yml index b2d6f2d55e..c44a21796b 100644 --- a/.github/workflows/sanity.yml +++ b/.github/workflows/sanity.yml @@ -35,25 +35,25 @@ jobs: - name: Check Docker pods are up run: | - chmod +x ./tests_end_to_end/installer/check_docker_compose_pods.sh - ./tests_end_to_end/installer/check_docker_compose_pods.sh + 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 run: | - chmod +x ./tests_end_to_end/installer/check_backend.sh - ./tests_end_to_end/installer/check_backend.sh + 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 run: | - pytest -v -s ${{ github.workspace }}/tests_end_to_end/installer/test_app_status.py + pytest -v -s ${{ github.workspace }}/tests_end_to_end/installer_utils/test_app_status.py - name: Run sanity suite run: | cd ${{ github.workspace }}/tests_end_to_end export PYTHONPATH='.' - pytest -s application_sanity/test_sanity.py --browser chromium --base-url http://localhost:5173 --setup-show + pytest -s tests/application_sanity/test_sanity.py --browser chromium --base-url http://localhost:5173 --setup-show - name: Stop Opik server if: always() diff --git a/.github/workflows/sdk-e2e-tests.yaml b/.github/workflows/sdk-e2e-tests.yaml index 16805df4b8..af261009b0 100644 --- a/.github/workflows/sdk-e2e-tests.yaml +++ b/.github/workflows/sdk-e2e-tests.yaml @@ -41,12 +41,12 @@ jobs: - name: Check Opik server availability shell: bash run: | - chmod +x ${{ github.workspace }}/tests_end_to_end/installer/*.sh + chmod +x ${{ github.workspace }}/tests_end_to_end/installer_utils/*.sh cd ${{ github.workspace }}/deployment/docker-compose echo "Check Docker pods are up" - ${{ github.workspace }}/tests_end_to_end/installer/check_docker_compose_pods.sh + ${{ github.workspace }}/tests_end_to_end/installer_utils/check_docker_compose_pods.sh echo "Check backend health" - ${{ github.workspace }}/tests_end_to_end/installer/check_backend.sh + ${{ github.workspace }}/tests_end_to_end/installer_utils/check_backend.sh - name: Install opik SDK run: |