fix: Use unique namespaces per e2e test to prevent resource conflicts#58
Merged
fix: Use unique namespaces per e2e test to prevent resource conflicts#58
Conversation
Parallel e2e tests were deploying the same guestbook resources to a shared namespace (e2e-test-apps), causing ArgoCD resource tracking conflicts. When multiple Applications manage the same resources, ownership ping-pongs between apps, leaving some with healthStatus=Missing and causing flaky timeouts. Each test application now deploys to its own namespace (derived from the app name) with CreateNamespace=true, ensuring complete isolation between parallel tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #58 +/- ##
=======================================
Coverage ? 32.98%
=======================================
Files ? 55
Lines ? 7143
Branches ? 0
=======================================
Hits ? 2356
Misses ? 4679
Partials ? 108 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Updates the e2e suite to avoid Argo CD resource ownership conflicts in parallel runs by moving test Applications off the shared e2e-test-apps namespace and into per-test namespaces, and enabling namespace auto-creation during sync.
Changes:
- Switch e2e tests to call
createTestApplication*with an empty namespace so helpers derive a unique namespace from the app name. - Update e2e helper constructors to default
Destination.Namespacetonameand setSyncPolicy.SyncOptions=CreateNamespace=true. - Apply the same namespace strategy to the ApplicationSet helper/template.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| e2e/helpers_test.go | Changes helper defaults to per-app namespaces and adds CreateNamespace sync option; updates ApplicationSet destination namespace. |
| e2e/sync_workflow_test.go | Updates app creation calls to use per-test namespaces via helpers. |
| e2e/unlock_workflow_test.go | Updates app creation callsites to use per-test namespaces via helpers. |
| e2e/rollback_workflow_test.go | Updates app creation callsites to use per-test namespaces via helpers. |
| e2e/plan_workflow_test.go | Updates app creation callsites to use per-test namespaces via helpers. |
| e2e/argocd_client_test.go | Updates the “real app” helper call to use a per-test namespace. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…amespaces
Address review feedback:
- ApplicationSet template now uses per-generated-app namespace (name-{{ .env }})
to prevent resource conflicts between generated apps
- All mocked YAML config strings in tests updated to use per-test namespace
instead of hardcoded e2e-test-apps, preventing spec overrides during sync
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
e2e-test-appsnamespace for deploying guestbook resources, causing ArgoCD resource tracking conflictshealthStatus=Missingand causing flaky timeouts (e.g.TestE2ESyncAutoMergeDisabledLocksRetained)CreateNamespace=true, ensuring complete isolation between parallel testsTest plan
🤖 Generated with Claude Code