diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3bf426e8..070f7e81 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -65,11 +65,12 @@ jobs: - run: just lint # Selects the AWS suites and Python versions. Draft and external-fork pull - # requests run none. A ready pull request always runs the PyAthena suite; it - # runs the SQLAlchemy tests (the compliance suites and the PyAthena suite's - # SQLAlchemy tests) and the Spark tests only when their code, tests, - # dependencies, this workflow, the top-level modules of pyathena and - # pyathena.aio, or the shared test fixtures change. Pull requests and the + # requests run none. A ready pull request runs the PyAthena suite only when + # the package, the tests, setup.cfg, the dependencies, or this workflow + # change; it runs the SQLAlchemy tests (the compliance suites and the + # PyAthena suite's SQLAlchemy tests) and the Spark tests only when their + # code, tests, dependencies, this workflow, the top-level modules of pyathena + # and pyathena.aio, or the shared test fixtures change. Pull requests and the # schedule test the newest Python version; a dispatch tests the requested # versions or every version, and the Release workflow every version. changes: @@ -81,6 +82,7 @@ jobs: permissions: pull-requests: read outputs: + pyathena: ${{ github.event_name != 'pull_request' || steps.paths.outputs.pyathena == 'true' }} sqla: ${{ github.event_name != 'pull_request' || steps.paths.outputs.sqla == 'true' }} spark: ${{ github.event_name != 'pull_request' || steps.paths.outputs.spark == 'true' }} python-versions: ${{ steps.versions.outputs.python-versions }} @@ -125,6 +127,13 @@ jobs: - pyathena/aio/spark/** - tests/pyathena/spark/** - tests/pyathena/aio/spark/** + # A superset of sqla and spark, so their tests never run without + # the PyAthena suite. + pyathena: + - *shared + - setup.cfg + - pyathena/** + - tests/** - id: versions env: EVENT_NAME: ${{ github.event_name }} @@ -156,6 +165,7 @@ jobs: # parallel; each is still a separate job for "Re-run failed jobs". test: needs: changes + if: needs.changes.outputs.pyathena == 'true' uses: ./.github/workflows/test-suite.yaml with: test-type: pyathena diff --git a/docs/testing.md b/docs/testing.md index 803ef28e..575d1676 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -155,18 +155,19 @@ It runs the offline checks (`just lint`) on each of them, including Drafts and e | Trigger | PyAthena suite | SQLAlchemy tests | Spark tests | Python versions | | --- | --- | --- | --- | --- | | Draft pull request | No | No | No | None | -| Ready pull request from a branch of this repository | Yes | When related files change | When related files change | Newest supported | +| Ready pull request from a branch of this repository | When related files change | When related files change | When related files change | Newest supported | | Weekly schedule | Yes | Yes | Yes | Newest supported | | Manual dispatch | Yes | Yes | Yes | Requested, or all supported | | Release tag (Release workflow) | Yes | Yes | Yes | All supported | The SQLAlchemy tests are the compliance suites and the PyAthena suite's `tests/pyathena/sqlalchemy/` and `tests/pyathena/aio/sqlalchemy/`. The Spark tests are the PyAthena suite's `tests/pyathena/spark/` and `tests/pyathena/aio/spark/`. -When the SQLAlchemy or Spark tests do not run, the PyAthena suite runs without them. -For the SQLAlchemy tests, the related files are `pyathena/sqlalchemy/`, `pyathena/aio/sqlalchemy/`, `tests/sqlalchemy/`, their PyAthena suite test directories, and `setup.cfg`. +When the PyAthena suite runs but the SQLAlchemy or Spark tests do not, it runs without them. +For the PyAthena suite, the related files are `pyathena/`, `tests/`, and `setup.cfg`. +For the SQLAlchemy tests, they are `pyathena/sqlalchemy/`, `pyathena/aio/sqlalchemy/`, `tests/sqlalchemy/`, their PyAthena suite test directories, and `setup.cfg`. For the Spark tests, they are `pyathena/spark/`, `pyathena/aio/spark/`, and their PyAthena suite test directories. -Changes to `pyproject.toml`, `uv.lock`, `justfile`, or the Test workflows run both. -For a pull request from a branch of this repository that still changes files other than `docs/` and Markdown, marking the Draft ready for review starts the AWS jobs, and converting it back to Draft cancels AWS jobs still running. +Changes to the modules directly under `pyathena/` and `pyathena/aio/`, the shared test fixtures such as `tests/pyathena/conftest.py` and `tests/resources/`, `pyproject.toml`, `uv.lock`, `justfile`, or the Test workflows run all three. +For a pull request from a branch of this repository that still changes files other than `docs/` and Markdown, marking the Draft ready for review starts any AWS jobs its changed files select, and converting it back to Draft cancels AWS jobs still running. To run every suite on a branch, dispatch the workflow; it tests every supported Python version unless `python-versions` lists some of them: ```bash