-
Notifications
You must be signed in to change notification settings - Fork 116
Backport #913: Run the PyAthena suite only when its files change #915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,11 +58,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: | ||
|
|
@@ -74,6 +75,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 }} | ||
|
|
@@ -118,6 +120,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 }} | ||
|
|
@@ -149,6 +158,7 @@ jobs: | |
| # parallel; each is still a separate job for "Re-run failed jobs". | ||
| test: | ||
| needs: changes | ||
| if: needs.changes.outputs.pyathena == 'true' | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Independent review (relayed): CLEAN
|
||
| uses: ./.github/workflows/test-suite.yaml | ||
| with: | ||
| test-type: pyathena | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,18 +74,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`. | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Self-review round two (claims and operational effects): CLEAN
|
||
| 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 | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review round one (implementation behavior): CLEAN
git diff 0397685561081561b4da6b2dcc2c4f8fac3ad175..93247b6fda14ab34bbd3c340e8ad1e1fae402836, two files:.github/workflows/test.yamlanddocs/testing.md.7e8616fa^1..7e8616fa). The cherry-pick applied without conflicts.test.yamlhere matches master's except for the missing license header andPYTHON_VERSIONSwith 3.10, so the output, the filter, and theif:behave as on master. Non-pull_requestevents producepyathena=true.release.yamlcallstest.yamlfrom av*tag push andreleasehasneeds: test, so a release still runs every suite.test-suite.yamlkeeps the sameskip-sqla/skip-sparkinputs, so a running PyAthena suite still ignores those directories as before.testblocks nothing.pyproject.tomlrunsuv sync --group devandjust test pyathena(just lint= ruff and mypy, then pytest ontests/pyathena/). 3.x has no uv workspace.benchmarks/is excluded from ruff, mypy, and pytest collection. No test or recipe readsscripts/cloudformation/. Nothing outside the allowlist feeds the suite.