Skip to content

e2e-tests (3/4): Add gNMI integration tests with envtest#409

Draft
nikatza wants to merge 6 commits into
mainfrom
refactor-tests-3
Draft

e2e-tests (3/4): Add gNMI integration tests with envtest#409
nikatza wants to merge 6 commits into
mainfrom
refactor-tests-3

Conversation

@nikatza

@nikatza nikatza commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

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.

@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 nikatza force-pushed the refactor-tests-2 branch from 8b82070 to e0403cc Compare June 18, 2026 08:54
@nikatza nikatza force-pushed the refactor-tests-3 branch from ace1a56 to bce5bb0 Compare June 18, 2026 08:54
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>
@nikatza nikatza changed the base branch from refactor-tests-2 to refactor-tests-1 July 14, 2026 12:20
@nikatza nikatza force-pushed the refactor-tests-3 branch from bce5bb0 to 2cf82d6 Compare July 14, 2026 17:16
@github-actions github-actions Bot added size/XXL and removed size/XL labels Jul 14, 2026
@nikatza nikatza changed the title e2e-tests (3/4): Add envtest mode for faster in-process e2e testing e2e-tests (3/4): Add gNMI integration tests with envtest Jul 14, 2026
@nikatza nikatza force-pushed the refactor-tests-3 branch from 2cf82d6 to dd3f643 Compare July 14, 2026 17:27
nikatza added 5 commits July 15, 2026 10:37
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>
@nikatza nikatza force-pushed the refactor-tests-3 branch from dd3f643 to 5b100a6 Compare July 15, 2026 08:53
@nikatza nikatza force-pushed the refactor-tests-1 branch 3 times, most recently from 6d57acb to d5e47cd Compare July 15, 2026 10:09
@nikatza nikatza force-pushed the refactor-tests-1 branch 2 times, most recently from f81d9b2 to 47fda5a Compare July 15, 2026 14:22
Base automatically changed from refactor-tests-1 to main July 15, 2026 15:34
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