tests: avoid fixed proxy e2e ports#22770
Closed
dominic-r wants to merge 4 commits into
Closed
Conversation
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
cb29dec to
962ee2e
Compare
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
962ee2e to
3305011
Compare
Bind proxy e2e containers to per-test host ports and clean up stopped labelled containers so CI runner port collisions do not cascade across tests. Endpoint e2e blank OS version failures are fixed in goauthentik/platform#960. Agent-thread: https://sdko.org/internal/threads/019e808d-fc02-7182-bf00-c3912c0ece92 A7k-product: product A7k-product-repo: 1 Co-authored-by: Agent <agent@svc.sdko.net>
3305011 to
39be121
Compare
Trigger CI for PR #22770 after updating the related e2e fixes. Agent-thread: https://sdko.org/internal/threads/019e808d-fc02-7182-bf00-c3912c0ece92 A7k-product: product A7k-product-repo: 1 Co-authored-by: Agent <agent@svc.sdko.net>
| def get_free_port(self) -> int: | ||
| """Find an unused local TCP port for a later container bind.""" | ||
| with socket() as sock: | ||
| sock.bind(("0.0.0.0", 0)) # nosec: test-only local port discovery. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22770 +/- ##
==========================================
- Coverage 93.30% 93.25% -0.05%
==========================================
Files 1033 1033
Lines 60150 60150
Branches 400 400
==========================================
- Hits 56120 56090 -30
- Misses 4030 4060 +30
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Member
|
fixed by #22785 |
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.
Summary
Fix proxy e2e failures caused by tests binding containers to fixed host ports. The tests now allocate per-test host ports and still route container-to-container traffic over Docker DNS where possible.
The shared Docker cleanup also removes stopped labelled containers, so a failed container start does not leave names behind and cascade into later test failures.
Related
The separate endpoint e2e failure from blank agent OS versions is handled in goauthentik/platform#960.
Validation
uv run ruff check tests/docker.py tests/e2e/test_provider_proxy.py tests/e2e/test_provider_proxy_forward.pyuv run ruff format --check tests/docker.py tests/e2e/test_provider_proxy.py tests/e2e/test_provider_proxy_forward.pygit diff --check