From 2d518527bdca6cc6ea9d3896bc437d93f3e4aa8b Mon Sep 17 00:00:00 2001 From: Tomasz Urbaszek Date: Wed, 11 Sep 2024 13:32:25 +0200 Subject: [PATCH] Separate SPCS int tests (#1559) --- .github/workflows/test_integration_spcs.yaml | 67 ++++++++++++++++++++ pyproject.toml | 3 +- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test_integration_spcs.yaml diff --git a/.github/workflows/test_integration_spcs.yaml b/.github/workflows/test_integration_spcs.yaml new file mode 100644 index 000000000..024d78579 --- /dev/null +++ b/.github/workflows/test_integration_spcs.yaml @@ -0,0 +1,67 @@ +name: SPCS Integration testing + +on: + pull_request: + branches: + - "*" + push: + tags: + - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 + branches: + - main + repository_dispatch: + types: [ok-to-test-command] + schedule: + - cron: "0 8 * * *" + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + + +jobs: + define-matrix: + uses: ./.github/workflows/matrix.yaml + + # Branch-based pull request + spcs-integration-trusted: + needs: define-matrix + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest"] + python-version: ["3.10"] + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository + uses: ./.github/workflows/test_trusted.yaml + with: + runs-on: ${{ matrix.os }} + python-version: ${{ matrix.python-version }} + python-env: integration + hatch-run: integration:test-spcs + secrets: inherit + + # Repo owner has commented /ok-to-test on a (fork-based) pull request + spcs-integration-fork: + needs: define-matrix + strategy: + fail-fast: true + matrix: + os: ["ubuntu-latest"] + python-version: ["3.10"] + permissions: + pull-requests: write + checks: write + if: | + github.event_name == 'repository_dispatch' && + github.event.client_payload.slash_command.args.named.sha != '' && + contains( + github.event.client_payload.pull_request.head.sha, + github.event.client_payload.slash_command.args.named.sha + ) + uses: ./.github/workflows/test_fork.yaml + with: + runs-on: ${{ matrix.os }} + python-version: ${{ matrix.python-version }} + python-env: integration + hatch-run: integration:test-spcs + secrets: inherit diff --git a/pyproject.toml b/pyproject.toml index dcb4eb825..b3cb6bc11 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -119,7 +119,8 @@ pre-install-commands = [ features = ["development"] [tool.hatch.envs.integration.scripts] -test = ["pytest -m integration -n6 --dist=worksteal --deflake-test-type=integration"] +test = ["pytest -m integration -n6 --dist=worksteal --deflake-test-type=integration --ignore=tests_integration/spcs"] +test-spcs = ["pytest -m integration -n6 --dist=worksteal --deflake-test-type=integration tests_integration/spcs"] test_qa = ["pytest -m 'integration and not no_qa' -n6 --dist=worksteal --deflake-test-type=integration"] [[tool.hatch.envs.local.matrix]]