fix(tests): stop the auth0 fixture reaching the network - #6783
Open
chiruu12 wants to merge 1 commit into
Open
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #6816
unit-testshas been erroring on every PR with four setup timeouts intests/test_auth.py:Two things behind it. Both live in
tests/fixtures/client.py.The
MULTI_TENANTbranch setsAUTH0_DOMAINtohttps://auth0domain.com. Every other reader of that variable takes a bare host:auth0_utilsformats it into"https://{}/api/v2/", the verifier buildsself.issuerthe same way, andtests/test_auth_new.pyusestest-domain.auth0.com. With a scheme already on it the verifier asks the resolver for a host literally namedhttps, which is the gaierror above.The fixture also stubs OIDC discovery only for the dict form of the parameter, and
MULTI_TENANTloads the same Auth0 verifier with no stub at all, so the call went out for real. On a runner without DNS that burns the whole 20 seconds before the test has started.So: bare host, and the stub now covers both forms.
Verified by counting outbound DNS lookups during
test_api_key_with_header[MULTI_TENANT]:tests/test_auth.py --non-integration: 22 passed, 1 skipped, on both. The count is the evidence; the pass is not, since a resolver that answers quickly hides this.