Skip to content

e2e: add test labels and profiles for selective execution - #273

Open
cardil wants to merge 2 commits into
kubernetes-sigs:mainfrom
cardil:feature/269-e2e-labels-n-profiles
Open

e2e: add test labels and profiles for selective execution#273
cardil wants to merge 2 commits into
kubernetes-sigs:mainfrom
cardil:feature/269-e2e-labels-n-profiles

Conversation

@cardil

@cardil cardil commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Add category/speed/scenario labels to all e2e tests for selective
filtering. Introduce profile system with priority-based registration
for downstream overrides.

Labels (3 dimensions):

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

Profiles (named presets):

  • smoke: lifecycle+configuration / fast
  • extended: +resilience / +moderate

Usage:

# Run smoke profile
go test -tags e2e ./test/e2e/ -profile=smoke

# Run extended profile
go test -tags e2e ./test/e2e/ -profile=extended

# Raw label filtering
go test -tags e2e ./test/e2e/ -labels=category=lifecycle,speed=fast

# All tests (no flags, current behavior)
go test -tags e2e ./test/e2e/

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

Profile registry supports priority-based registration. Downstream
distributions can add their own profiles (or override upstream ones)
by adding a Go file with init() calling RegisterProfile() with
Priority > 0.

Fixes #269

Assisted-by: 🤖 claude-opus-4-6@default

Summary by CodeRabbit

  • New Features

    • Added selectable end-to-end test profiles for smoke and extended test runs.
    • Introduced standardized categories, scenarios, and execution-speed labels to improve test filtering and reporting.
  • Tests

    • Updated multiple end-to-end tests to use the shared typed label constants (lifecycle, configuration, resilience, networking, observability) and structured scenario/speed metadata.
    • Updated the e2e test runner to register and apply the selected profile’s labels via command-line flag handling.

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
@kubernetes-prow
kubernetes-prow Bot requested review from Cali0707 and mrunalp July 27, 2026 13:21
@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 jaideepr97 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

@kubernetes-prow kubernetes-prow Bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 27, 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.

@netlify

netlify Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploy Preview for mcp-lifecycle-operator ready!

Name Link
🔨 Latest commit 0b96770
🔍 Latest deploy log https://app.netlify.com/projects/mcp-lifecycle-operator/deploys/6a6777931e98a5000819faf3
😎 Deploy Preview https://deploy-preview-273--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 added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 27, 2026
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 00af8ac9-eea8-4663-aac3-1bd82f34c5b1

📥 Commits

Reviewing files that changed from the base of the PR and between 10df939 and 0b96770.

📒 Files selected for processing (2)
  • test/e2e/framework/labels/scenario/scenario.go
  • test/e2e/lifecycle_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/e2e/lifecycle_test.go

📝 Walkthrough

Walkthrough

Adds standardized category, scenario, and speed labels to e2e tests, introduces smoke and extended profile selection, and applies selected profile labels during test initialization.

Changes

E2E label selection

Layer / File(s) Summary
Typed label constants
test/e2e/framework/labels/*
Defines shared category, scenario, and speed label constants.
Profile registry and resolution
test/e2e/framework/profiles.go
Adds profile registration, lookup, priority handling, CLI flag registration, and profile resolution.
Default profiles and TestMain wiring
test/e2e/framework/profiles_defaults.go, test/e2e/main_test.go
Registers smoke and extended profiles and applies selected labels to the e2e configuration.
Standardized feature labels
test/e2e/*_test.go
Replaces ad-hoc feature labels with shared category, scenario, and speed labels across configuration, resilience, lifecycle, networking, observability, and reconciliation tests.

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

Sequence Diagram(s)

sequenceDiagram
  participant TestMain
  participant ResolveProfile
  participant ProfileRegistry
  participant E2EConfig
  TestMain->>ResolveProfile: resolve -profile
  ResolveProfile->>ProfileRegistry: lookup selected profile
  ProfileRegistry-->>ResolveProfile: return label selectors
  ResolveProfile-->>TestMain: return labels
  TestMain->>E2EConfig: apply labels
Loading

Possibly related PRs

Suggested reviewers: mrunalp, cali0707

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding e2e labels and profiles for selective execution.
Linked Issues check ✅ Passed The PR implements the requested category/speed labels, smoke and extended profiles, pluggable registration, and preserves no-flag behavior.
Out of Scope Changes check ✅ Passed The added scenario labels and registry helpers still support selective execution and don't introduce unrelated changes.
✨ 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.

@codecov

codecov Bot commented Jul 27, 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     #273   +/-   ##
=======================================
  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 `@test/e2e/lifecycle_test.go`:
- Around line 115-119: Update the scenario label in TestMCPServerUpdatePort from
scenario.CRUD to scenario.SpecUpdate, since the test modifies
s.Spec.Config.Port. Keep the existing feature, category, and speed labels
unchanged.

In `@test/e2e/manager_test.go`:
- Around line 53-56: The affected features lack scenario-dimension labels,
preventing scenario-based selection. Add semantically appropriate scenario.Label
values to TestManagerPodRunning and TestMetricsEndpoint in
test/e2e/manager_test.go, TestMCPHandshake in test/e2e/mcp_handshake_test.go,
and TestNetworkPolicyCreated, TestNetworkPolicyPortUpdate, and
TestNetworkPolicyGarbageCollected in test/e2e/networkpolicy_test.go; extend
test/e2e/framework/labels/scenario/scenario.go only if no existing taxonomy
value fits.
🪄 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: 828b655c-dd41-426b-842c-baabf60dfd2c

📥 Commits

Reviewing files that changed from the base of the PR and between eb4f33c and 10df939.

📒 Files selected for processing (13)
  • test/e2e/configuration_test.go
  • test/e2e/failure_scenarios_test.go
  • test/e2e/framework/labels/category/category.go
  • test/e2e/framework/labels/scenario/scenario.go
  • test/e2e/framework/labels/speed/speed.go
  • test/e2e/framework/profiles.go
  • test/e2e/framework/profiles_defaults.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 test/e2e/lifecycle_test.go Outdated
Comment thread test/e2e/manager_test.go
Rename scenario.CRUD to scenario.Deploy for clarity. CRUD is too
broad. Deploy means create+verify.

Fix TestMCPServerUpdatePort to use scenario.SpecUpdate instead of
scenario.Deploy since it modifies Spec.Config.Port.

Add package doc to scenario explaining it is an optional secondary
label for slicing larger categories.

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: add test labels for selective execution

1 participant