Skip to content
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

test: add required testing on Python 3.8.12 #29116

Merged
merged 47 commits into from
Oct 20, 2021
Merged

test: add required testing on Python 3.8.12 #29116

merged 47 commits into from
Oct 20, 2021

Conversation

joshuarli
Copy link
Member

@joshuarli joshuarli commented Oct 6, 2021

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.

@joshuarli
Copy link
Member Author

joshuarli commented Oct 6, 2021

Oh whoops, the 3.8 tests need #29012.

@armenzg
Copy link
Member

armenzg commented Oct 19, 2021

Gonna need to change repo settings again for these new check titles. And again when 3.6 is removed.

Ideally, one day we won't need to do this. We could use this API to determine the current set of required checks.
https://docs.github.com/en/rest/reference/repos#get-status-checks-protection

Copy link
Member

@armenzg armenzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

Thanks for your diligent comments throughout about the matrix total.

Ideally, we could find a trick to calculate it. Maybe we can do something in bash and then set it as a variable. I have not thought through if it would work.

Makefile Outdated
@@ -108,7 +108,7 @@ test-snuba:

backend-typing:
@echo "--> Running Python typing checks"
mypy --strict --warn-unreachable --config-file mypy.ini
mypy --warn-unreachable --config-file mypy.ini
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It overrides everything relevant that's defined in the config file. Like, I set warn_unused_ignores to False, but passing --strict turns it on again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing --strict removes much more static type safety than simple disabling warn_unused_ignores=True. It would be safer to not test mypy on 3.8 at all than to do this, or simply let the extra check fail.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since 3.8 is now gone again I suppose we can revert this anyway

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I just trusted ; Enable all options used with --strict. Why have those options in the config file then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gonna revert all my mypy changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question but if I run mypy locally I did not get as many errors without --strict in the past. so that comment must be wrong or mean something else...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can also be that mypy added more options over time that are enabled by --strict.

Comment on lines +69 to +72
# XXX: We should be using something like len(strategy.matrix.instance) (not possible atm)
# If you have other things like python-version: [foo, bar, baz] then the sharding logic
# isn't right because job-total will be 3x larger and you'd never run 2/3 of the tests.
# MATRIX_INSTANCE_TOTAL: ${{ strategy.job-total }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah -- when we were doing 2.7, 3.6 - I opted to make a new workflow file with this being a reason. The other reason being that restarting the acceptance workflow would re-run acceptance tests for both python versions + frontend acceptance tests (when a flake probably wouldn't affect all jobs in the workflow).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I could have done that too... given that it's already working + I expect being able to remove 3.6 pretty quickly, I'll just leave it like this if that's ok? The way it is now, it's less prone to introducing something to the matrix and not realizing some sharded tests aren't being run. Plus the comments about the strategy matrix are helpful for the future.

@untitaker
Copy link
Member

re typing: I believe it would be kind of annoying to run mypy twice if it gives conflicting errors. Wouldn't it be easier to run it for 3.8 only?

@joshuarli
Copy link
Member Author

re typing: I believe it would be kind of annoying to run mypy twice if it gives conflicting errors. Wouldn't it be easier to run it for 3.8 only?

Hmm agreed, we'll need to keep the fix I have but I can disable it running on 3.8 and then when we switch over, run it on 3.8 just as I'm doing with visual snapshots.

@billyvg
Copy link
Member

billyvg commented Oct 20, 2021

Force merging this as we are changing the job names of acceptance/snuba tests for python 3.6 - they are all passing.

@billyvg billyvg merged commit df1bbdd into master Oct 20, 2021
@billyvg billyvg deleted the test/add-py38 branch October 20, 2021 20:06
@github-actions github-actions bot locked and limited conversation to collaborators Nov 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants