Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/matrix-slow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build Matrix (Slow Tests)

on:
workflow_call:
outputs:
matrix:
description: "Generates the slow test build matrix"
value: ${{ jobs.set-matrix-slow.outputs.matrix }}

jobs:
set-matrix-slow:
runs-on: "ubuntu-24.04"
permissions:
contents: read
steps:
- name: Check out Repository
id: check-out-repository
uses: actions/checkout@v6

- name: Set up Python & Poetry Environment
id: set-up-python-and-poetry-environment
uses: exasol/python-toolbox/.github/actions/python-environment@v7
with:
python-version: "3.10"
poetry-version: "2.3.0"

- name: Generate Matrix
id: generate-matrix
run: poetry run -- nox -s matrix:slow

- name: Set Matrix
id: set-matrix
run: |
echo "matrix=$(poetry run -- nox -s matrix:slow)" >> $GITHUB_OUTPUT

outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
19 changes: 16 additions & 3 deletions .github/workflows/slow-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@ on:
workflow_call:

jobs:
build-slow-matrix:
name: Build Slow Matrix
uses: ./.github/workflows/matrix-slow.yml
permissions:
contents: read

run-integration-tests:
name: Run Integration Tests
name: Run Integration Tests (${{ matrix.test-name }})
needs:
- build-slow-matrix
runs-on: "ubuntu-24.04"
permissions:
contents: read
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.build-slow-matrix.outputs.matrix) }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand All @@ -26,7 +36,10 @@ jobs:

- name: Run Integration Tests
id: run-integration-tests
run: poetry run -- nox -s test:integration -- --coverage
run: |
poetry run coverage run \
--rcfile=pyproject.toml \
-m pytest -v "${{ matrix.test-path }}"
env:
SAAS_HOST: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_HOST }}
SAAS_ACCOUNT_ID: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_ACCOUNT_ID }}
Expand All @@ -38,6 +51,6 @@ jobs:
id: upload-artifacts
uses: actions/upload-artifact@v7
with:
name: coverage-python3.10-slow
name: coverage-python3.10-slow-${{ matrix.test-name }}
path: .coverage
include-hidden-files: true
19 changes: 19 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@
DEST_DIR = "exasol/saas/client/openapi"


def _slow_test_matrix() -> dict[str, list[dict[str, str]]]:
files = sorted(Path("test/integration").glob("test_*.py"))
return {
"include": [
{
"test-name": path.stem.removeprefix("test_").replace("_", "-"),
"test-path": str(path),
}
for path in files
]
}


def _download_openapi_json() -> Path:
url = f"{SAAS_HOST}/openapi.json"
response = requests.get(url)
Expand Down Expand Up @@ -127,3 +140,9 @@ def check_api_outdated(session: Session):
"""
generate_api(session)
session.run("git", "diff", "--exit-code", DEST_DIR)


@nox.session(name="matrix:slow", python=False)
def slow_matrix(session: Session):
"""Output the build matrix for slow integration tests as JSON."""
print(json.dumps(_slow_test_matrix()))
Loading