Skip to content

Commit df1bbdd

Browse files
authored
test: add required testing on Python 3.8.12 (#29116)
This shouldn't be merged until we're ready to attempt the initial full deploy, which could break beyond what we can ensure in tests. Since this introduces a lot of additional CI I'm trying to keep the window of enforcing 3.8 tests passing in addition to 3.6 to just 3.8 tests at a minimum. The ideal situation is we merge this, deploy 3.8 to great success, then remove all of 3.6. But if the 3.8 deploy doesn't go well, we should keep enforcing 3.6 + 3.8 tests passing. Note, visual snapshotting is disabled on 3.8, and when we make the switch to it I'll enable it in the PR and don't think there'll be any differences. Gonna need to change repo settings again for these new check titles. And again when 3.6 is removed.
1 parent c133c81 commit df1bbdd

16 files changed

+53
-35
lines changed

.github/actions/setup-sentry/action.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ outputs:
5454
matrix-instance-number:
5555
description: "The matrix instance number (starting at 1)"
5656
value: ${{ steps.config.outputs.matrix-instance-number }}
57+
matrix-instance-total:
58+
description: "Reexport of MATRIX_INSTANCE_TOTAL."
59+
value: ${{ steps.config.outputs.matrix-instance-total }}
5760

5861
runs:
5962
using: "composite"
@@ -63,7 +66,10 @@ runs:
6366
env:
6467
NEED_KAFKA: ${{ inputs.kafka }}
6568
MATRIX_INSTANCE: ${{ matrix.instance }}
66-
MATRIX_INSTANCE_TOTAL: ${{ strategy.job-total }}
69+
# XXX: We should be using something like len(strategy.matrix.instance) (not possible atm)
70+
# If you have other things like python-version: [foo, bar, baz] then the sharding logic
71+
# isn't right because job-total will be 3x larger and you'd never run 2/3 of the tests.
72+
# MATRIX_INSTANCE_TOTAL: ${{ strategy.job-total }}
6773
run: |
6874
# Only set `MIGRATIONS_TEST_MIGRATE` if it is not already set (or if it's an empty string)
6975
if [ -z $MIGRATIONS_TEST_MIGRATE ]; then
@@ -81,11 +87,17 @@ runs:
8187
### pytest-sentry configuration ###
8288
echo "PYTEST_SENTRY_DSN=https://6fd5cfea2d4d46b182ad214ac7810508@sentry.io/2423079" >> $GITHUB_ENV
8389
echo "PYTEST_ADDOPTS=--reruns 5" >> $GITHUB_ENV
90+
8491
# this handles pytest test sharding
8592
if [ "$MATRIX_INSTANCE" ]; then
93+
if ! [ "$MATRIX_INSTANCE_TOTAL" ]; then
94+
echo "MATRIX_INSTANCE_TOTAL is required."
95+
exit 1
96+
fi
8697
echo "TEST_GROUP=$MATRIX_INSTANCE" >> $GITHUB_ENV
8798
echo "TOTAL_TEST_GROUPS=$MATRIX_INSTANCE_TOTAL" >> $GITHUB_ENV
8899
fi
100+
89101
# This records failures on master to sentry in order to detect flakey tests, as it's
90102
# expected that people have failing tests on their PRs
91103
[ "$GITHUB_REF" = "refs/heads/master" ] && echo "PYTEST_SENTRY_ALWAYS_REPORT=1" >> $GITHUB_ENV || true
@@ -124,6 +136,7 @@ runs:
124136
run: |
125137
echo "::set-output name=yarn-cache-dir::$(yarn cache dir)"
126138
echo "::set-output name=matrix-instance-number::$(($MATRIX_INSTANCE+1))"
139+
echo "::set-output name=matrix-instance-total::$(($MATRIX_INSTANCE_TOTAL))"
127140
echo "::set-output name=acceptance-dir::.artifacts/visual-snapshots/acceptance"
128141
129142
- name: Install python dependencies

.github/workflows/acceptance.yml

+16-7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
timeout-minutes: 20
2121
strategy:
2222
matrix:
23+
# XXX: When updating this, make sure you also update CI_NODE_TOTAL.
2324
instance: [0, 1]
2425

2526
env:
@@ -55,7 +56,10 @@ jobs:
5556
env:
5657
GITHUB_PR_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
5758
GITHUB_PR_REF: ${{ github.event.pull_request.head.ref || github.ref }}
58-
CI_NODE_TOTAL: ${{ strategy.job-total }}
59+
# XXX: CI_NODE_TOTAL must be hardcoded to the length of strategy.matrix.instance.
60+
# Otherwise, if there are other things in the matrix, using strategy.job-total
61+
# wouldn't be correct.
62+
CI_NODE_TOTAL: 2
5963
CI_NODE_INDEX: ${{ matrix.instance }}
6064
run: |
6165
JEST_TESTS=$(yarn -s jest --listTests --json) yarn test-ci --forceExit
@@ -146,10 +150,12 @@ jobs:
146150
timeout-minutes: 20
147151
strategy:
148152
matrix:
153+
python-version: [3.6.13, 3.8.12]
154+
# XXX: When updating this, make sure you also update MATRIX_INSTANCE_TOTAL.
149155
instance: [0, 1, 2, 3]
150-
# TODO(joshuarli): Add 3.8.12.
151-
python-version: [3.6.13]
152156
env:
157+
# XXX: MATRIX_INSTANCE_TOTAL must be hardcoded to the length of strategy.matrix.instance.
158+
MATRIX_INSTANCE_TOTAL: 4
153159
VISUAL_SNAPSHOT_ENABLE: 1
154160
TEST_GROUP_STRATEGY: roundrobin
155161

@@ -182,7 +188,7 @@ jobs:
182188
run: |
183189
tar xf dist.tar.gz
184190
185-
- name: Run acceptance tests (#${{ steps.setup.outputs.matrix-instance-number }} of ${{ strategy.job-total }})
191+
- name: Run acceptance tests (#${{ steps.setup.outputs.matrix-instance-number }} of ${{ steps.setup.outputs.matrix-instance-total }})
186192
if: always()
187193
run: |
188194
mkdir -p ${{ steps.setup.outputs.acceptance-dir }}
@@ -209,10 +215,13 @@ jobs:
209215
timeout-minutes: 30
210216
strategy:
211217
matrix:
212-
# TODO(joshuarli): Add 3.8.12.
213-
python-version: [3.6.13]
218+
python-version: [3.6.13, 3.8.12]
219+
# XXX: When updating this, make sure you also update MATRIX_INSTANCE_TOTAL.
214220
instance: [0]
215221
env:
222+
# XXX: MATRIX_INSTANCE_TOTAL must be hardcoded to the length of strategy.matrix.instance.
223+
MATRIX_INSTANCE_TOTAL: 1
224+
TEST_GROUP_STRATEGY: roundrobin
216225
VISUAL_SNAPSHOT_ENABLE: 1
217226

218227
steps:
@@ -244,7 +253,7 @@ jobs:
244253
run: |
245254
make build-chartcuterie-config
246255
247-
- name: Run chartcuterie tests (${{ steps.setup.outputs.matrix-instance-number }} of ${{ strategy.job-total }})
256+
- name: Run chartcuterie tests (${{ steps.setup.outputs.matrix-instance-number }} of ${{ steps.setup.outputs.matrix-instance-total }})
248257
run: |
249258
mkdir -p ${{ steps.setup.outputs.acceptance-dir }}
250259
make test-chartcuterie

.github/workflows/api-docs-test.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ jobs:
1414
runs-on: ubuntu-20.04
1515
strategy:
1616
matrix:
17-
# TODO(joshuarli): Add 3.8.12.
18-
python-version: [3.6.13]
17+
python-version: [3.6.13, 3.8.12]
1918
steps:
2019
- uses: actions/checkout@v2
2120

.github/workflows/backend-lint.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ jobs:
1212
timeout-minutes: 10
1313
strategy:
1414
matrix:
15-
# TODO(joshuarli): Add 3.8.12.
16-
python-version: [3.6.13]
15+
python-version: [3.6.13, 3.8.12]
1716
steps:
1817
- uses: actions/checkout@v2
1918

.github/workflows/backend-test.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ jobs:
1313
timeout-minutes: 20
1414
strategy:
1515
matrix:
16-
# TODO(joshuarli): Add 3.8.12.
17-
python-version: [3.6.13]
16+
python-version: [3.6.13, 3.8.12]
17+
# XXX: When updating this, make sure you also update MATRIX_INSTANCE_TOTAL.
1818
instance: [0, 1, 2]
1919

2020
env:
21+
# XXX: MATRIX_INSTANCE_TOTAL must be hardcoded to the length of strategy.matrix.instance.
22+
MATRIX_INSTANCE_TOTAL: 3
2123
MIGRATIONS_TEST_MIGRATE: 1
2224

2325
steps:
@@ -52,7 +54,7 @@ jobs:
5254
pip-cache-version: ${{ secrets.PIP_CACHE_VERSION }}
5355
snuba: true
5456

55-
- name: Run backend test (${{ steps.setup.outputs.matrix-instance-number }} of ${{ strategy.job-total }})
57+
- name: Run backend test (${{ steps.setup.outputs.matrix-instance-number }} of ${{ steps.setup.outputs.matrix-instance-total }})
5658
if: steps.changes.outputs.backend == 'true'
5759
run: |
5860
# Note: `USE_SNUBA` is not used for backend tests because there are a few failing tests with Snuba enabled.

.github/workflows/backend-typing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
timeout-minutes: 12
1313
strategy:
1414
matrix:
15-
# TODO(joshuarli): Add 3.8.12.
15+
# TODO(joshuarli): Switch to 3.8.12 when we switch over to Python 3.8.
1616
python-version: [3.6.13]
1717
steps:
1818
- uses: actions/checkout@v2

.github/workflows/check-if-migration-is-required.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ jobs:
2525
runs-on: ubuntu-20.04
2626
strategy:
2727
matrix:
28-
# TODO(joshuarli): Add 3.8.12.
29-
python-version: [3.6.13]
28+
python-version: [3.6.13, 3.8.12]
3029
needs: [should-check]
3130

3231
steps:

.github/workflows/command-line-test.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ jobs:
1212
timeout-minutes: 10
1313
strategy:
1414
matrix:
15-
# TODO(joshuarli): Add 3.8.12.
16-
python-version: [3.6.13]
15+
python-version: [3.6.13, 3.8.12]
1716
steps:
1817
- uses: actions/checkout@v2
1918

.github/workflows/development-environment.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ jobs:
2222
# Using Ubuntu 18 until I figure out this error:
2323
# -> ImportError: libffi.so.6: cannot open shared object file: No such file or directory
2424
os: [macos-11.0, ubuntu-18.04]
25-
# TODO(joshuarli): Add 3.8.12.
26-
python-version: [3.6.13]
25+
python-version: [3.6.13, 3.8.12]
2726
fail-fast: false
2827
env:
2928
PIP_DISABLE_PIP_VERSION_CHECK: on

.github/workflows/migrations.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ jobs:
4141
timeout-minutes: 8
4242
strategy:
4343
matrix:
44-
# TODO(joshuarli): Add 3.8.12.
45-
python-version: [3.6.13]
44+
python-version: [3.6.13, 3.8.12]
4645
needs: did-migration-change
4746
if: ${{ needs.did-migration-change.outputs.added == 'true' }}
4847

.github/workflows/plugins-test.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ jobs:
1313
timeout-minutes: 10
1414
strategy:
1515
matrix:
16-
# TODO(joshuarli): Add 3.8.12.
17-
python-version: [3.6.13]
16+
python-version: [3.6.13, 3.8.12]
1817
steps:
1918
- uses: actions/checkout@v2
2019

.github/workflows/relay-integration-test.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ jobs:
1313
timeout-minutes: 10
1414
strategy:
1515
matrix:
16-
# TODO(joshuarli): Add 3.8.12.
17-
python-version: [3.6.13]
16+
python-version: [3.6.13, 3.8.12]
1817
steps:
1918
- uses: actions/checkout@v2
2019
with:

.github/workflows/snuba-integration-test.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ jobs:
1313
timeout-minutes: 30
1414
strategy:
1515
matrix:
16+
python-version: [3.6.13, 3.8.12]
17+
# XXX: When updating this, make sure you also update MATRIX_INSTANCE_TOTAL.
1618
instance: [0, 1]
17-
# TODO(joshuarli): Add 3.8.12.
18-
python-version: [3.6.13]
1919
env:
20+
# XXX: MATRIX_INSTANCE_TOTAL must be hardcoded to the length of strategy.matrix.instance.
21+
MATRIX_INSTANCE_TOTAL: 2
2022
USE_SNUBA: 1
2123
MIGRATIONS_TEST_MIGRATE: 1
2224
USE_INDEXER: 1
@@ -54,7 +56,7 @@ jobs:
5456
snuba: true
5557
kafka: true
5658

57-
- name: Run snuba test (${{ steps.setup.outputs.matrix-instance-number }} of ${{ strategy.job-total }})
59+
- name: Run snuba test (${{ steps.setup.outputs.matrix-instance-number }} of ${{ steps.setup.outputs.matrix-instance-total }})
5860
if: steps.changes.outputs.backend == 'true'
5961
run: |
6062
make test-snuba

.github/workflows/symbolicator-integration-test.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ jobs:
1313
timeout-minutes: 10
1414
strategy:
1515
matrix:
16-
# TODO(joshuarli): Add 3.8.12.
17-
python-version: [3.6.13]
16+
python-version: [3.6.13, 3.8.12]
1817
steps:
1918
- uses: actions/checkout@v2
2019
with:

mypy.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ disallow_incomplete_defs=True
8383
check_untyped_defs=True
8484
disallow_untyped_decorators=True
8585
no_implicit_optional=True
86-
warn_redundant_casts=True
8786
warn_unused_ignores=True
87+
warn_redundant_casts=True
8888
warn_return_any=True
8989
no_implicit_reexport=True
9090

src/sentry/utils/pytest/selenium.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,8 @@ def snapshot(self, name, mobile_only=False):
304304
"""
305305
# TODO(dcramer): ideally this would take the executing test package
306306
# into account for duplicate names
307-
if os.environ.get("VISUAL_SNAPSHOT_ENABLE") != "1":
307+
# TODO(josh): Change to 3.8 when it's deployed. Much easier to disable here than in GHA yml.
308+
if os.environ.get("VISUAL_SNAPSHOT_ENABLE") != "1" or sys.version_info[:2] != (3, 6):
308309
return self
309310

310311
self.wait_for_images_loaded()

0 commit comments

Comments
 (0)