🌱 Add make targets for running single e2e scenarios#2790
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Adds developer-facing support for running individual Godog e2e scenarios against a persistent KIND cluster, enabling faster iteration without per-run cluster setup/teardown. This fits the operator-controller development workflow by improving local e2e debugging loops while reusing the existing Godog-based suite harness.
Changes:
- Introduces persistent cluster lifecycle targets (
e2e-setup/experimental-e2e-setupand matching teardown targets). - Adds a new
--e2e.scenarioflag and Gherkin-based scenario prefix →file.feature:LINEresolution in the e2eTestMain. - Documents the iterative workflow and the new scenario-selection flag.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/README.md | Documents persistent cluster workflow and single-scenario make targets. |
| test/e2e/features_test.go | Adds --e2e.scenario flag and Gherkin parsing to map scenario prefixes to file:line filters. |
| Makefile | Adds setup/teardown targets and an e2e/% pattern target for running a single feature/prefix. |
| go.mod | Promotes gherkin/messages dependencies to direct requirements for the new parsing code. |
| AGENTS.md | Updates contributor guidance with the iterative e2e workflow and examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .PHONY: e2e/% | ||
| e2e/%: E2E_TIMEOUT ?= 20m | ||
| e2e/%: KUBECONFIG ?= $(KUBECONFIG_DIR)/operator-controller-e2e.kubeconfig | ||
| e2e/%: #EXHELP Run e2e scenario against a cluster created by e2e-setup or experimental-e2e-setup (tear down with e2e-teardown). |
There was a problem hiding this comment.
Fixed: added explicit KUBECONFIG override example for the experimental cluster in the help text and documentation.
| make e2e/install E2E_TIMEOUT=30m # Override timeout | ||
| make e2e/install KUBECONFIG=~/.kube/config # Override kubeconfig | ||
|
|
There was a problem hiding this comment.
Fixed: added an explicit example showing KUBECONFIG override for the experimental cluster.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2790 +/- ##
==========================================
- Coverage 70.44% 70.29% -0.16%
==========================================
Files 143 142 -1
Lines 10625 10577 -48
==========================================
- Hits 7485 7435 -50
- Misses 2579 2580 +1
- Partials 561 562 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
447c53c to
2f2e70d
Compare
| test-e2e: kind-clean-e2e #HELP Run e2e test suite on local kind cluster | ||
| test-experimental-e2e: kind-clean-experimental-e2e #HELP Run experimental e2e test suite on local kind cluster | ||
|
|
There was a problem hiding this comment.
Should these be with the other test-e2e/test-experimental-e2e lines?
There was a problem hiding this comment.
Yes, they are — e2e-setup and experimental-e2e-setup are placed immediately after the test-e2e/test-experimental-e2e lines. They mirror the same variant-specific variable overrides (E2E_SOURCE_MANIFEST, E2E_RELEASE_MANIFEST, KIND_CONFIG) and depend on the same wait-% chain.
There was a problem hiding this comment.
I mean should they be moveI mean, should these lines be moved up to ~340
There was a problem hiding this comment.
Done — setup variable overrides moved up next to the test-e2e/test-experimental-e2e overrides block.
| .PHONY: e2e-teardown | ||
| e2e-teardown: $(KIND) #EXHELP Delete the standard e2e KIND cluster. | ||
| $(KIND) delete cluster --name operator-controller-e2e | ||
|
|
||
| .PHONY: experimental-e2e-teardown | ||
| experimental-e2e-teardown: $(KIND) #EXHELP Delete the experimental e2e KIND cluster. | ||
| $(KIND) delete cluster --name operator-controller-experimental-e2e |
There was a problem hiding this comment.
Any way to combine these with kind-clean-% or parameterize them to avoid duplication?
(Yes, I know you can't depend on kind-clean-% directly, but maybe they can call a common recipe?)
There was a problem hiding this comment.
The existing kind-clean-% has a dependency on e2e-coverage-% (which depends on e2e-run-%, etc.), so we can't reuse it directly without pulling in the entire test chain. We could extract a kind-delete-% recipe that both kind-clean-% and e2e-teardown call, but that would touch the existing targets from #2785. Happy to do it if you think it's worth it.
There was a problem hiding this comment.
I'd prefer not to have 3 recipes basically doing the same thing, and possibly getting out of sync.
There was a problem hiding this comment.
Addressed — with #2792 merged, kind-clean-% is now standalone. Teardown targets are prereq-only delegations to kind-clean-operator-controller-e2e / kind-clean-operator-controller-experimental-e2e, zero recipe duplication.
| .PHONY: e2e-setup | ||
| e2e-setup: E2E_SOURCE_MANIFEST := $(STANDARD_E2E_MANIFEST) | ||
| e2e-setup: E2E_RELEASE_MANIFEST := $(STANDARD_RELEASE_MANIFEST) | ||
| e2e-setup: wait-e2e #EXHELP Create a KIND cluster with standard OLM deployed for iterative e2e testing. |
There was a problem hiding this comment.
So, let me understand this, since this changed recently (and I didn't get a chance to review):
test-% -> kind-clean-%
kind-clean-% -> e2e-coverage-%
e2e-coverage-% -> e2e-run-%
e2e-run-% -> prometheus-%
prometheus-% -> wait-% << SAME
%-setup -> wait-% << SAME
wait-% -> lint-deployed-%
lint-deployed-% -> kind-deployed-%
kind-deploy-% -> kind-load-% manifests
kind-load-% -> kind-cluster-%
kind-cluster-% -> docker-build
So, basically you strung these out as parameterized recipes, rather than having a long list of dependencies on a single target?
There was a problem hiding this comment.
Correct — the chain is exactly as you describe. The pattern rules were introduced in #2785, and the %-setup targets in this PR reuse the same chain, just stopping at wait-% instead of continuing through e2e-run-% → e2e-coverage-% → kind-clean-%.
2f2e70d to
0036574
Compare
Add `make e2e/<feature>/<scenario-prefix>` for running individual Godog scenarios by name prefix against an already-running cluster. The prefix is resolved to godog's file:line syntax using the Gherkin parser. Add `e2e-setup` and `experimental-e2e-setup` targets to create persistent KIND clusters for iterative development, with matching `e2e-teardown` and `experimental-e2e-teardown` for cleanup. Co-Authored-By: Claude <noreply@anthropic.com>
0036574 to
1834117
Compare
|
/lgtm cancel Did not mean to do lgtm and approve! |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rashmigottipati, tmshort The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
88bd84f
into
operator-framework:main
Description
Add developer-facing Makefile targets for running individual Godog e2e scenarios
without full suite setup/teardown on each iteration.
What's new
make e2e/<feature>/<scenario-prefix>— runs e2e scenarios matching a nameprefix against an already-running cluster. The prefix is resolved to godog's
native
file.feature:LINEsyntax using the Gherkin parser inTestMain.make e2e-setup/make experimental-e2e-setup— create persistent KINDclusters with OLM deployed for iterative development (no teardown after tests).
make e2e-teardown/make experimental-e2e-teardown— delete the clusterswhen done.
Reviewer Checklist