Skip to content

e2e-tests (3/4): Add envtest mode for faster in-process e2e testing#409

Draft
nikatza wants to merge 2 commits into
refactor-tests-2from
refactor-tests-3
Draft

e2e-tests (3/4): Add envtest mode for faster in-process e2e testing#409
nikatza wants to merge 2 commits into
refactor-tests-2from
refactor-tests-3

Conversation

@nikatza

@nikatza nikatza commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

This PR adds envtest-based testing mode that runs e2e tests in-process using controller-runtime's envtest framework. Tests complete in approximately seconds rather than in minutes.

Implementation

The gNMI test server runs as an embedded component within the test process rather than as a Kubernetes pod, eliminating the overhead of pod scheduling, image pulling, and network communication. Both envtest and cluster modes share identical test data files in txtar format and use the same test discovery logic, ensuring consistent validation. Currently only sequential testing is enabled.

Use envtest for quick feedback during development, then validate with cluster mode before submitting changes.

Testing

# Run envtest mode (~10 seconds)
make test-e2e-envtest PROVIDER=cisco-nxos-gnmi

@nikatza nikatza force-pushed the refactor-tests-3 branch from 78654a7 to d200e98 Compare June 16, 2026 22:11
@nikatza nikatza changed the title e2e-tests (3/4): Add test resources for NXOS e2e-tests (3/4): Add envtest mode for faster in-process e2e testing Jun 17, 2026
@nikatza nikatza force-pushed the refactor-tests-2 branch from 82d714b to 829e761 Compare June 17, 2026 23:40
@nikatza nikatza force-pushed the refactor-tests-3 branch from d200e98 to 823e208 Compare June 17, 2026 23:40
@github-actions github-actions Bot added size/XL and removed size/XXL labels Jun 17, 2026
@nikatza nikatza force-pushed the refactor-tests-3 branch from 823e208 to f735c68 Compare June 17, 2026 23:45
@nikatza nikatza force-pushed the refactor-tests-2 branch 2 times, most recently from be16d2f to e20ae93 Compare June 18, 2026 07:59
@nikatza nikatza force-pushed the refactor-tests-3 branch 2 times, most recently from 51d400f to ace1a56 Compare June 18, 2026 08:15
nikatza added 2 commits June 18, 2026 10:26
Add envtest mode for fast in-process e2e testing. This alternative
testing mode runs the same test cases as cluster mode but executes
them in-process using controller-runtime's envtest framework.

Run with: make test-e2e-envtest PROVIDER=cisco-nxos-gnmi

New files:
- envtest_suite_test.go: Ginkgo suite with //go:build envtest tag
- envtest_test.go: Provider-based test runner
- testutil/envtest.go: EnvtestEnvironment with in-process gNMI server

Signed-off-by: Pujol <enric.pujol@sap.com>
Add test-e2e-envtest target that runs e2e tests in envtest mode
(no cluster required). Uses setup-envtest to provide kubebuilder assets.

Signed-off-by: Pujol <enric.pujol@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant