Skip to content

Commit

Permalink
Updated separation of SaaS tests
Browse files Browse the repository at this point in the history
Following the strategy as demonstrated in GitHub repository saas-api-python.
  • Loading branch information
ckunki committed Jun 10, 2024
1 parent 9d1ba2e commit 8138485
Showing 1 changed file with 45 additions and 18 deletions.
63 changes: 45 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
name: Checks
uses: ./.github/workflows/checks.yml

tests-job:
fast-tests:
name: Tests (Python-${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
Expand All @@ -29,42 +29,69 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v5

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- uses: abatilo/[email protected]
with:
poetry-version: 1.2.2

- name: Install Project
run: poetry install

- name: Checkout ITDE
run: git clone https://github.com/exasol/integration-test-docker-environment.git
working-directory: ..

- name: Start EXASOL Test-Environment
- name: Start EXASOL Test-Docker-Environment (ITDE)
run: ./start-test-env spawn-test-environment --environment-name test --database-port-forward 8888 --bucketfs-port-forward 6666 --db-mem-size 4GB
working-directory: ../integration-test-docker-environment

- name: Run Tests
run: poetry run pytest tests

- name: Fail, if SaaS tests are not activated
if: "!contains(github.event.head_commit.message, '[run-saas-tests]') && (matrix.python-version == '3.10')"
run: |
echo "Failed because the SaaS tests are not activated"
exit 1
metrics:
needs: [ fast-tests ]
uses: ./.github/workflows/report.yml

gate-1:
name: Gate 1 - Regular CI
needs: [ fast-tests ]
runs-on: ubuntu-latest
steps:
- name: Branch Protection
run: true

slow-test-detection:
runs-on: ubuntu-latest
steps:
- name: Detect Slow Tests
run: true
environment:
slow-tests

run-slow-tests:
runs-on: ubuntu-latest
needs: [ slow-test-detection ]
secrets: inherit

steps:
- uses: actions/checkout@v2

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: 3.10
poetry-version: 1.2.2

- name: Run SaaS Tests
if: "contains(github.event.head_commit.message, '[run-saas-tests]') && (matrix.python-version == '3.10')"
env:
SAAS_HOST: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_HOST }}
SAAS_ACCOUNT_ID: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_ACCOUNT_ID }}
SAAS_PAT: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_PAT }}
run: poetry run pytest test_saas


metrics:
needs: [ ci-job ]
uses: ./.github/workflows/report.yml
gate-2:
name: Gate 2 - Allow Merge
runs-on: ubuntu-latest
needs: [ run-slow-tests ]
steps:
- name: Branch Protection
run: true

0 comments on commit 8138485

Please sign in to comment.