-
Notifications
You must be signed in to change notification settings - Fork 114
Backport #906: Run SQLAlchemy and Spark tests when shared core modules change #910
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
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 |
|---|---|---|
|
|
@@ -61,9 +61,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' || | ||
|
|
@@ -73,16 +74,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 (backport behavior): 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 (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. | ||
|
|
@@ -106,28 +144,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 (backport claims and operations): FINDINGS, repaired in the PR body
ac8b11ee2dd80576f9359efacbe80a3ee344c5d2..056da1af8a856d97746f5119c15b51916e97cc14.tests/pyathena/tables.py"came with master's fixture work".git log --diff-filter=Ashows it was added by 12cfd65, merged in Define the shared test tables in Python and generate their data #874; the body now names Define the shared test tables in Python and generate their data #874. The pattern stays to keep the commit identical to master and matches nothing on 3.x.git diff origin/master HEAD -- .github/workflows/test.yamlshows only the header and 3.10.pyathena/(aio/)?(sqlalchemy|spark)/. 3.x does not importpyathena.cursor,converter, oraio.cursorthere, and the body does not claim it..github/workflows/test.yamlchanges.test.yamlchanges. The AWS cost effect on later 3.x pull requests follows ci: run SQLAlchemy and Spark tests when shared core modules change #906, and 3.x pull requests are few.