Skip to content

e2e: run tests in parallel - #271

Open
cardil wants to merge 6 commits into
kubernetes-sigs:mainfrom
cardil:feature/268-e2e-parallel
Open

e2e: run tests in parallel#271
cardil wants to merge 6 commits into
kubernetes-sigs:mainfrom
cardil:feature/268-e2e-parallel

Conversation

@cardil

@cardil cardil commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Add t.Parallel() to all 39 Test* functions across 7 e2e test files
  • Pre-warm test images via DaemonSet in testenv.Setup() before tests start, preventing thundering-herd registry pulls on cold nodes
  • Extract DefaultMCPServerImage, DefaultMCPServerImageDigest, BusyboxImage constants to framework package
  • Use temp overlay dir in deploy/deploy-debug Makefile targets to avoid mutating tracked config/manager/kustomization.yaml

Why

Each e2e test creates its own isolated namespace with no shared state. Running them in parallel reduces suite time from ~10min to ~2min.

Verification

  • All 39 tests pass with default parallelism (GOMAXPROCS) on a fresh Kind cluster in ~97s
  • config/manager/kustomization.yaml remains unmodified after make deploy

Fixes: #268
Assisted-by: 🤖 claude-opus-4-6@default

Summary by CodeRabbit

  • Deployment

    • Streamlined deployment image updates for more consistent manifest application across standard and debug deployments.
  • Testing

    • End-to-end tests now run in parallel, reducing overall test execution time.
    • Test images are preloaded to improve reliability and avoid repeated downloads.
    • Standardized test image references, including pinned image defaults for reproducible results.

@kubernetes-prow kubernetes-prow Bot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Jul 24, 2026
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: cardil
Once this PR has been reviewed and has the lgtm label, please assign matzew for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Jul 24, 2026

Copy link
Copy Markdown

Deploy Preview for mcp-lifecycle-operator ready!

Name Link
🔨 Latest commit a0a988b
🔍 Latest deploy log https://app.netlify.com/projects/mcp-lifecycle-operator/deploys/6a64a8b81fd48c00087724f6
😎 Deploy Preview https://deploy-preview-271--mcp-lifecycle-operator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubernetes-prow
kubernetes-prow Bot requested review from mrunalp and soltysh July 24, 2026 20:51
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 24, 2026
@kubernetes-prow

Copy link
Copy Markdown

Hi @cardil. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cardil, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3a428294-5e8f-4867-9e83-6ffc9c0bd77d

📥 Commits

Reviewing files that changed from the base of the PR and between 80506b5 and a0a988b.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (12)
  • Makefile
  • go.mod
  • test/e2e/configuration_test.go
  • test/e2e/failure_scenarios_test.go
  • test/e2e/framework/builders.go
  • test/e2e/framework/k8s.go
  • test/e2e/lifecycle_test.go
  • test/e2e/main_test.go
  • test/e2e/manager_test.go
  • test/e2e/mcp_handshake_test.go
  • test/e2e/networkpolicy_test.go
  • test/e2e/reconciliation_test.go
📝 Walkthrough

Walkthrough

The Makefile now centralizes image substitution through a reusable kustomize macro. The e2e framework adds shared image defaults and prewarming, while the e2e suite enables parallel execution and replaces hardcoded image references.

Changes

Deployment and e2e execution

Layer / File(s) Summary
Reusable kustomize deployment macro
Makefile
Deployment targets use a temporary kustomize root to set the image, apply manifests, and clean up.
Shared e2e image defaults
test/e2e/framework/builders.go
Default MCP server and Busybox image references are centralized and used by the MCP server builder.
Image prewarming in the test harness
test/e2e/framework/k8s.go, test/e2e/main_test.go
Test setup prewarms shared images with temporary DaemonSets before running the suite.
Parallel e2e scenarios and shared image references
test/e2e/*_test.go
E2e tests are marked parallel, and failure/reconciliation scenarios use framework image constants.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TestMain
  participant PrewarmImages
  participant KubernetesAPI
  TestMain->>PrewarmImages: request shared test images
  PrewarmImages->>KubernetesAPI: create image DaemonSets
  KubernetesAPI-->>PrewarmImages: report ready pods
  PrewarmImages->>KubernetesAPI: delete prewarm namespace
Loading

Possibly related PRs

Suggested reviewers: aliok, matzew

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The Makefile deploy/deploy-debug overlay changes are unrelated to parallelizing e2e tests. Move the Makefile deployment refactor to a separate PR or linked issue if it is intended.
Docstring Coverage ⚠️ Warning Docstring coverage is 26.32% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly states the main change: running e2e tests in parallel.
Linked Issues check ✅ Passed The PR adds t.Parallel() across the e2e suite and supporting image prewarming, matching the linked parallelization goal.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

- Add t.Parallel() to all 39 Test* functions
- Pre-warm test images via DaemonSet before tests start
- Extract image constants to framework package
- Use temp overlay dir in deploy targets to avoid mutating tracked kustomization.yaml

Fixes: kubernetes-sigs#268
Assisted-by: 🤖 claude-opus-4-6@default
@cardil
cardil force-pushed the feature/268-e2e-parallel branch from 80506b5 to d983e4d Compare July 24, 2026 20:53
@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Jul 24, 2026
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@eb4f33c). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #271   +/-   ##
=======================================
  Coverage        ?   85.36%           
=======================================
  Files           ?       14           
  Lines           ?     1578           
  Branches        ?        0           
=======================================
  Hits            ?     1347           
  Misses          ?      188           
  Partials        ?       43           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Around line 259-264: Update the deployment macro around _DEPLOY_DIR so setup,
kustomize edit/build, kubectl apply, and cleanup execute within one shell,
registering an EXIT trap to remove the temporary directory on every failure
path. Enable pipefail or render the build output to a temporary manifest, and
explicitly chain commands so kustomize or kubectl failures propagate instead of
being masked.

In `@test/e2e/framework/k8s.go`:
- Around line 201-231: Make cleanup for the prewarm namespace unconditional by
registering it immediately after namespace creation, before any DaemonSet
creation or readiness operations can return. Update the cleanup to delete the
namespace and wait for its ResourceDeleted condition, including the existing
context and timeout behavior, so callers do not proceed while prewarm resources
remain.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ba7c423e-a76d-42f7-b3d7-e5ac9a7da8f2

📥 Commits

Reviewing files that changed from the base of the PR and between eb4f33c and 80506b5.

📒 Files selected for processing (11)
  • Makefile
  • test/e2e/configuration_test.go
  • test/e2e/failure_scenarios_test.go
  • test/e2e/framework/builders.go
  • test/e2e/framework/k8s.go
  • test/e2e/lifecycle_test.go
  • test/e2e/main_test.go
  • test/e2e/manager_test.go
  • test/e2e/mcp_handshake_test.go
  • test/e2e/networkpolicy_test.go
  • test/e2e/reconciliation_test.go

Comment thread Makefile Outdated
Comment thread test/e2e/framework/k8s.go Outdated
cardil added 2 commits July 24, 2026 23:06
- Makefile: single shell with pipefail, trap, and && chaining
- PrewarmImages: defer namespace cleanup, wait for ResourceDeleted

Assisted-by: 🤖 claude-opus-4-6@default
- bump golang.org/x/text v0.38.0 -> v0.39.0
- bump golang.org/x/tools v0.46.0 -> v0.47.0
- refactor deploy/deploy-debug with kustomize-set-image macro

Extracted from kubernetes-sigs#270 and kubernetes-sigs#271.

Assisted-by: 🤖 claude-opus-4-6@default
@cardil
cardil force-pushed the feature/268-e2e-parallel branch from 254434a to a0a988b Compare July 25, 2026 12:14
cardil added a commit to cardil/k8s-mcp-lifecycle-operator that referenced this pull request Jul 27, 2026
Add category/speed/scenario labels to all e2e tests for selective
filtering. Introduce profile system with priority-based registration
for downstream overrides.

Labels: category (lifecycle, configuration, resilience, networking,
observability), speed (fast, moderate, slow), scenario (crud,
spec-update, drift, ownership, storage, port, security, metadata,
failure, recovery).

Profiles: smoke (lifecycle+configuration/fast), extended
(+resilience/+moderate).

Speed labels validated against CI execution times from PR kubernetes-sigs#271.

Fixes kubernetes-sigs#269

Assisted-by: 🤖 claude-opus-4-6@default
cardil added a commit to cardil/k8s-mcp-lifecycle-operator that referenced this pull request Jul 27, 2026
Add category/speed/scenario labels to all e2e tests for selective
filtering. Introduce profile system with priority-based registration
for downstream overrides.

Labels: category (lifecycle, configuration, resilience, networking,
observability), speed (fast, moderate, slow), scenario (crud,
spec-update, drift, ownership, storage, port, security, metadata,
failure, recovery).

Profiles: smoke (lifecycle+configuration/fast), extended
(+resilience/+moderate).

Speed labels validated against CI execution times from PR kubernetes-sigs#271.

Assisted-by: 🤖 claude-opus-4-6@default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

e2e: run tests in parallel

1 participant