e2e-tests (3/4): Add gNMI integration tests with envtest#409
Draft
nikatza wants to merge 6 commits into
Draft
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
8b82070 to
e0403cc
Compare
ace1a56 to
bce5bb0
Compare
e2e tests should only evaluate the correct deployment of the operator as defined by the kubebuilder markers. Hence, in this commit we remove all the gNMI related infrastructure from the e2e tests. The current integration tests with the gNMI test server will be later moved into its own space within the project. The tests will use an `envtest` environment, removing the need to deploy a cluster to evaluate that the workflow from k8s resource to provider payload is correctly implemented: no need to have it as a module. The standalone main.go and Dockerfile are removed. We relocate the txtar test fixtures from test/e2e/testdata/ to test/gnmi/testdata/, where the gNMI integration tests will live. The default profile in kustomize now has prometheus enabled by default. With this change we can eliminate some code and remove the Makefile targets that modify the profile when running the e2e tests. Allow overriding the Prometheus Operator and cert-manager installation URLs via environment variables PROMETHEUS_OPERATOR_URL and CERT_MANAGER_URL. Signed-off-by: Pujol <enric.pujol@sap.com>
bce5bb0 to
2cf82d6
Compare
envtest mode for faster in-process e2e testingenvtest
2cf82d6 to
dd3f643
Compare
This commit introduces test utilities for envtest-based gNMI integration tests. These tests rely on `envtest` and the gNMI test server to verify that the gNMI payload sent is correct. This means we need methods for state management (ClearGNMIState, PreloadGNMIState) and JSON comparison helpers. As we move forward we will need to test multiple providers. For this we provide a provider factory, which for the moment only supports OpenConfig. The testserver package is enhanced to support graceful shutdown via context cancellation, enabling proper cleanup in test teardown hooks. Signed-off-by: Pujol <enric.pujol@sap.com>
This commit introduces envtest-based integration tests for gNMI functionality using the OpenConfig provider. The tests verify the end-to-end workflow from Kubernetes resources to provider gNMI payloads without requiring a full cluster deployment. The test architecture uses a per-process gNMI test server to enable parallel test execution with Ginkgo's --procs flag. Each Ginkgo process creates its own suite-level server in BeforeSuite, shares it across all tests within that process, and cleans it up in AfterSuite. Tests within each process run serially, ensuring proper isolation through per-test namespaces and state clearing between tests. Signed-off-by: Pujol <enric.pujol@sap.com>
…lacks VLAN support) The OpenConfig provider does not yet support VLAN interface configuration, causing the interface_routed_vlan test to fail. Skip this test by renaming the fixture file to .skip extension until VLAN support is implemented. Signed-off-by: Pujol <enric.pujol@sap.com>
Add a dedicated GitHub Actions workflow for gNMI integration tests using the OpenConfig provider. The workflow runs in parallel with other test jobs, executing tests with 4 processes via Ginkgo's --procs flag and completing in approximately 20 seconds. The workflow is triggered on pushes to main and pull requests, with the same path ignores as other test workflows (docs and markdown files). It installs ginkgo and setup-envtest as dependencies before running the test suite. This separate workflow file provides cleaner separation from unit tests and makes it easier to configure gNMI-specific test settings independently. Signed-off-by: Pujol <enric.pujol@sap.com>
With the adoption of an in-process gNMI test server we have no more use of the HTTP end-point previously offered. Signed-off-by: Pujol <enric.pujol@sap.com>
dd3f643 to
5b100a6
Compare
6d57acb to
d5e47cd
Compare
f81d9b2 to
47fda5a
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 introduces envtest-based gNMI integration tests for the OpenConfig provider, enabling faster validation of the Kubernetes resources to gNMI sequence without requiring a full cluster deployment.
The test architecture uses a per-process gNMI server design that enables parallel test execution with Ginkgo's --procs flag. Each process creates its own suite-level server in BeforeSuite and shares it across tests running serially within that process.