-
Notifications
You must be signed in to change notification settings - Fork 116
ci: run SQLAlchemy and Spark tests when shared core modules change #906
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
fcb75ee
ci: run SQLAlchemy and Spark tests when shared core modules change
laughingman7743 3deba1d
ci: describe the shared core paths by how the suites load them
laughingman7743 020dc45
ci: include the test package initializers in the shared core paths
laughingman7743 7439d76
ci: select the SQLAlchemy and Spark tests with dorny/paths-filter
laughingman7743 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 |
|---|---|---|
|
|
@@ -68,9 +68,10 @@ jobs: | |
| # 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, or this workflow 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. | ||
| # 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: | ||
| if: >- | ||
| github.event_name != 'pull_request' || | ||
|
|
@@ -80,16 +81,53 @@ jobs: | |
| permissions: | ||
| pull-requests: read | ||
| outputs: | ||
| sqla: ${{ steps.filter.outputs.sqla }} | ||
| spark: ${{ steps.filter.outputs.spark }} | ||
| python-versions: ${{ steps.filter.outputs.python-versions }} | ||
| 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 }} | ||
| steps: | ||
| - id: filter | ||
| - id: paths | ||
| if: github.event_name == 'pull_request' | ||
| uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 | ||
|
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 one, expanded scope (paths-filter migration): CLEAN
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, expanded scope (relayed): CLEAN
|
||
| with: | ||
| filters: | | ||
| shared: &shared | ||
| - .github/workflows/test.yaml | ||
| - .github/workflows/test-suite.yaml | ||
| - justfile | ||
| - pyproject.toml | ||
| - uv.lock | ||
| # The SQLAlchemy and Spark packages load the top-level modules, | ||
| # directly or transitively, and their tests use the shared fixtures. | ||
| core: &core | ||
| - pyathena/*.py | ||
| - pyathena/aio/*.py | ||
| - tests/__init__.py | ||
| - tests/pyathena/__init__.py | ||
| - tests/pyathena/conftest.py | ||
| - tests/pyathena/tables.py | ||
| - tests/pyathena/util.py | ||
| - tests/pyathena/aio/__init__.py | ||
| - tests/pyathena/aio/conftest.py | ||
| - tests/resources/** | ||
| sqla: | ||
| - *shared | ||
| - *core | ||
| - setup.cfg | ||
| - pyathena/sqlalchemy/** | ||
| - pyathena/aio/sqlalchemy/** | ||
| - tests/sqlalchemy/** | ||
| - tests/pyathena/sqlalchemy/** | ||
| - tests/pyathena/aio/sqlalchemy/** | ||
| spark: | ||
| - *shared | ||
| - *core | ||
| - pyathena/spark/** | ||
| - pyathena/aio/spark/** | ||
| - tests/pyathena/spark/** | ||
| - tests/pyathena/aio/spark/** | ||
| - id: versions | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| EVENT_NAME: ${{ github.event_name }} | ||
| REPO: ${{ github.repository }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| REQUESTED_VERSIONS: ${{ inputs.python-versions }} | ||
| # Every supported version, oldest first; keep in sync with the | ||
| # pyproject.toml classifiers. | ||
|
|
@@ -113,28 +151,6 @@ jobs: | |
| ;; | ||
| esac | ||
| echo "python-versions=$versions" >> "$GITHUB_OUTPUT" | ||
| if [[ "$EVENT_NAME" != "pull_request" ]]; then | ||
| { | ||
| echo "sqla=true" | ||
| echo "spark=true" | ||
| } >> "$GITHUB_OUTPUT" | ||
| exit 0 | ||
| fi | ||
| files=$(gh api "repos/$REPO/pulls/$PR_NUMBER/files" --paginate --jq '.[].filename') | ||
| printf 'Changed files:\n%s\n' "$files" | ||
| shared='^(\.github/workflows/test(-suite)?\.yaml|justfile|pyproject\.toml|uv\.lock)$' | ||
| sqla="$shared|^pyathena/(aio/)?sqlalchemy/|^tests/sqlalchemy/|^tests/pyathena/(aio/)?sqlalchemy/|^setup\.cfg$" | ||
| spark="$shared|^pyathena/(aio/)?spark/|^tests/pyathena/(aio/)?spark/" | ||
| if grep -qE "$sqla" <<< "$files"; then | ||
| echo "sqla=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "sqla=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| if grep -qE "$spark" <<< "$files"; then | ||
| echo "spark=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "spark=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| # The three suites create their own schemas and tables, so they run in | ||
| # parallel; each is still a separate job for "Re-run failed jobs". | ||
|
|
||
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 two, expanded scope (claims and operational effects): CLEAN (PR body rewritten)
8679f04a36f6ffd7190b892c32b1938672ab502f..7439d76ea0e9b78797eca35bb82cff109f39e678.getChangedFilesFromApicallspulls.listFiles(src/main.ts:204-217at v4.0.3).git ls-files(278 files) is identical.src/main.ts:228-238.pull-requests: readtoken": job-level permissions replace the workflow-level ones.grep -Eversion, because the selection is identical.grep -Eversion. The action itself runs only on a ready pull request, so its first real run is this PR's Ready run; its log and outputs must be checked before merge. A push at 7439d76 while Ready started a run; returning the PR to Draft cancelled it before thechangesjob finished, so no AWS job ran.changes:: still accurate, because the behavior it describes did not change.