e2e-tests (3/4): Add envtest mode for faster in-process e2e testing#409
Draft
nikatza wants to merge 2 commits into
Draft
e2e-tests (3/4): Add envtest mode for faster in-process e2e testing#409nikatza wants to merge 2 commits into
envtest mode for faster in-process e2e testing#409nikatza wants to merge 2 commits into
Conversation
78654a7 to
d200e98
Compare
envtest mode for faster in-process e2e testing
82d714b to
829e761
Compare
d200e98 to
823e208
Compare
823e208 to
f735c68
Compare
be16d2f to
e20ae93
Compare
51d400f to
ace1a56
Compare
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>
8b82070 to
e0403cc
Compare
ace1a56 to
bce5bb0
Compare
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.
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