e2e-tests (3/4): Add gNMI integration tests with envtest#409
Open
nikatza wants to merge 3 commits into
Open
Conversation
nikatza
force-pushed
the
refactor-tests-3
branch
from
June 16, 2026 22:11
78654a7 to
d200e98
Compare
envtest mode for faster in-process e2e testing
nikatza
force-pushed
the
refactor-tests-2
branch
from
June 17, 2026 23:40
82d714b to
829e761
Compare
nikatza
force-pushed
the
refactor-tests-3
branch
from
June 17, 2026 23:40
d200e98 to
823e208
Compare
nikatza
force-pushed
the
refactor-tests-3
branch
from
June 17, 2026 23:45
823e208 to
f735c68
Compare
nikatza
force-pushed
the
refactor-tests-2
branch
2 times, most recently
from
June 18, 2026 07:59
be16d2f to
e20ae93
Compare
nikatza
force-pushed
the
refactor-tests-3
branch
2 times, most recently
from
June 18, 2026 08:15
51d400f to
ace1a56
Compare
nikatza
force-pushed
the
refactor-tests-2
branch
from
June 18, 2026 08:54
8b82070 to
e0403cc
Compare
nikatza
force-pushed
the
refactor-tests-3
branch
from
June 18, 2026 08:54
ace1a56 to
bce5bb0
Compare
nikatza
force-pushed
the
refactor-tests-3
branch
from
July 14, 2026 17:16
bce5bb0 to
2cf82d6
Compare
envtest mode for faster in-process e2e testingenvtest
nikatza
force-pushed
the
refactor-tests-3
branch
2 times, most recently
from
July 15, 2026 08:53
dd3f643 to
5b100a6
Compare
nikatza
force-pushed
the
refactor-tests-1
branch
5 times, most recently
from
July 15, 2026 14:22
f81d9b2 to
47fda5a
Compare
nikatza
force-pushed
the
refactor-tests-3
branch
3 times, most recently
from
July 16, 2026 13:23
268ae9b to
625b160
Compare
nikatza
force-pushed
the
refactor-tests-3
branch
5 times, most recently
from
July 16, 2026 17:09
e22db40 to
6a91fa7
Compare
nikatza
force-pushed
the
refactor-tests-3
branch
from
July 16, 2026 17:14
6a91fa7 to
c06cf19
Compare
nikatza
marked this pull request as ready for review
July 16, 2026 18:32
IvoGoman
reviewed
Jul 17, 2026
nikatza
force-pushed
the
refactor-tests-3
branch
5 times, most recently
from
July 23, 2026 15:06
b9e836b to
9e6c201
Compare
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. Testdata files support optional state/preload sections to set initial gNMI server state before reconciliation. This is for example required to successfully reconcile devices: the controller requires the last boot time. Updated test cases accordingly. As there is only one gNMI test server per process, all tests share the same device. This means that test cases must clean up all resources they create, otherwise the server will be polluted by the left over resources. As Envtest runs without kube-controller-manager, there is no garbage collector to cascade deletions, meaning each test needs to explicitly clean up resources it creates, and it must do so in the correct order to prevent finalizer deadlocks. For example, a Device cannot be deleted while it still has dependent resources with finalizers. Additionally, not all custom resources in network-operator have controllers. Resources like Interface, BGP, and OSPF have reconcilers that add finalizers and set status conditions. Other resources (typically config-only types) are stored in the API but have no controller — no finalizer, no conditions. Thus, the test framework must handle: wait for conditions on controller-managed resources, prevent blocking indefinitely on config-only ones, and clean up resources in the correct order without relying on cascading deletion. The waitForResource helper probes for a finalizer with a short timeout. Controllers add finalizers early in reconciliation (within ~1 second), so if none appears after 3 seconds, the resource is assumed to be config-only and the helper returns immediately. For controller-managed resources, it waits for the Ready or Configured condition. The cleanupAllResources helper lists all network-operator resources in the namespace, then partitions them by checking each resource's finalizers field. Controller-managed resources (those with finalizers) are deleted first, waiting for finalizer removal while Device still exists. Config-only resources (no finalizers) are deleted afterward without waiting. Finally, the Device is deleted. This approach avoids hardcoded list of resource types. 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 dynamic process count via Ginkgo's --procs flag. Signed-off-by: Pujol <enric.pujol@sap.com>
nikatza
force-pushed
the
refactor-tests-3
branch
from
July 24, 2026 10:28
9e6c201 to
5e5733a
Compare
Merging this branch will not change overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
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.