Skip to content

Commit 8c3be28

Browse files
Split CI test jobs for independent retries
Split the single test job into 3 sequential jobs (test, test-sqla, test-sqla-async) to enable "Re-run failed jobs" in GitHub Actions UI. Each job sets a TEST_TYPE env var that tox-gh-actions uses to select the appropriate tox factor. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 32059be commit 8c3be28

File tree

2 files changed

+97
-4
lines changed

2 files changed

+97
-4
lines changed

.github/workflows/test.yaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
env:
17+
TEST_TYPE: pyathena
1718
AWS_DEFAULT_REGION: us-west-2
1819
AWS_ATHENA_S3_STAGING_DIR: s3://laughingman7743-pyathena/github/
1920
AWS_ATHENA_WORKGROUP: pyathena
@@ -53,3 +54,89 @@ jobs:
5354
- name: Test
5455
run: |
5556
make tox
57+
58+
test-sqla:
59+
needs: [test]
60+
runs-on: ubuntu-latest
61+
62+
env:
63+
TEST_TYPE: sqla
64+
AWS_DEFAULT_REGION: us-west-2
65+
AWS_ATHENA_S3_STAGING_DIR: s3://laughingman7743-pyathena/github/
66+
AWS_ATHENA_WORKGROUP: pyathena
67+
AWS_ATHENA_SPARK_WORKGROUP: pyathena-spark
68+
AWS_ATHENA_MANAGED_WORKGROUP: pyathena-managed
69+
70+
strategy:
71+
fail-fast: false
72+
matrix:
73+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
74+
75+
steps:
76+
- name: Checkout
77+
uses: actions/checkout@v4
78+
79+
- uses: astral-sh/setup-uv@v5
80+
with:
81+
python-version: ${{ matrix.python-version }}
82+
enable-cache: true
83+
- uses: actions/setup-python@v5
84+
with:
85+
python-version: ${{ matrix.python-version }}
86+
if: matrix.python-version == '3.13' || matrix.python-version == '3.14'
87+
- run: |
88+
make tool
89+
90+
- name: Configure AWS credentials
91+
uses: aws-actions/configure-aws-credentials@v4
92+
with:
93+
role-to-assume: arn:aws:iam::676287850544:role/github-actions-oidc-pyathena
94+
role-session-name: PyAthenaTestSession
95+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
96+
97+
- name: Test
98+
run: |
99+
make tox
100+
101+
test-sqla-async:
102+
needs: [test-sqla]
103+
runs-on: ubuntu-latest
104+
105+
env:
106+
TEST_TYPE: sqla_async
107+
AWS_DEFAULT_REGION: us-west-2
108+
AWS_ATHENA_S3_STAGING_DIR: s3://laughingman7743-pyathena/github/
109+
AWS_ATHENA_WORKGROUP: pyathena
110+
AWS_ATHENA_SPARK_WORKGROUP: pyathena-spark
111+
AWS_ATHENA_MANAGED_WORKGROUP: pyathena-managed
112+
113+
strategy:
114+
fail-fast: false
115+
matrix:
116+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
117+
118+
steps:
119+
- name: Checkout
120+
uses: actions/checkout@v4
121+
122+
- uses: astral-sh/setup-uv@v5
123+
with:
124+
python-version: ${{ matrix.python-version }}
125+
enable-cache: true
126+
- uses: actions/setup-python@v5
127+
with:
128+
python-version: ${{ matrix.python-version }}
129+
if: matrix.python-version == '3.13' || matrix.python-version == '3.14'
130+
- run: |
131+
make tool
132+
133+
- name: Configure AWS credentials
134+
uses: aws-actions/configure-aws-credentials@v4
135+
with:
136+
role-to-assume: arn:aws:iam::676287850544:role/github-actions-oidc-pyathena
137+
role-session-name: PyAthenaTestSession
138+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
139+
140+
- name: Test
141+
run: |
142+
make tox

pyproject.toml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ exclude = [
178178
legacy_tox_ini = """
179179
[tox]
180180
isolated_build = true
181-
envlist = py{310,311,312,313,314}
181+
envlist = py{310,311,312,313,314}-{pyathena,sqla,sqla_async}
182182
183183
[gh-actions]
184184
python =
@@ -188,16 +188,22 @@ python =
188188
3.13: py313
189189
3.14: py314
190190
191+
[gh-actions:env]
192+
TEST_TYPE =
193+
pyathena: pyathena
194+
sqla: sqla
195+
sqla_async: sqla_async
196+
191197
[testenv]
192198
allowlist_externals =
193199
uv
194200
uvx
195201
make
196202
commands =
197203
uv sync --group dev
198-
make test
199-
make test-sqla
200-
make test-sqla-async
204+
pyathena: make test
205+
sqla: make test-sqla
206+
sqla_async: make test-sqla-async
201207
passenv =
202208
TOXENV
203209
AWS_*

0 commit comments

Comments
 (0)