Skip to content

Commit e22db40

Browse files
committed
ci(test/gnmi): Run OpenConfig gNMI integration tests in CI
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. Signed-off-by: Pujol <enric.pujol@sap.com>
1 parent 43ebfec commit e22db40

3 files changed

Lines changed: 52 additions & 28 deletions

File tree

.github/workflows/test-gnmi.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and IronCore contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Test gNMI integration
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
paths-ignore:
11+
- 'docs/**'
12+
- '**/*.md'
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
test-gnmi:
19+
name: Run gNMI Integration Tests (OpenConfig)
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v7
23+
- uses: actions/setup-go@v6
24+
with:
25+
go-version-file: 'go.mod'
26+
- name: Install ginkgo
27+
run: go install github.com/onsi/ginkgo/v2/ginkgo@latest
28+
- name: Running gNMI tests
29+
run: make test-gnmi TESTGNMI_PROVIDER=openconfig GINKGO_PROCS=4
30+

Makefile

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ default: build-all
3737
IMG ?= controller:latest
3838

3939
# E2E test dependency versions
40-
E2E_PROMETHEUS_OPERATOR_VERSION ?= v0.82.2
41-
E2E_CERTMANAGER_VERSION ?= v1.17.2
40+
TESTE2E_PROMETHEUS_OPERATOR_VERSION ?= v0.82.2
41+
TESTE2E_CERTMANAGER_VERSION ?= v1.17.2
4242

4343
# CONTAINER_TOOL defines the container tool to be used for building images.
4444
# The default is docker, but it can be overridden to use other tools (i.e. podman or nerdctl).
@@ -88,22 +88,19 @@ test-e2e: FORCE
8888
}
8989
@printf "\e[1;36m>> go test ./test/e2e/ -v -ginkgo.v\e[0m\n"
9090
@KIND_CLUSTER=$(KIND_CLUSTER) \
91-
E2E_PROMETHEUS_OPERATOR_VERSION=$(E2E_PROMETHEUS_OPERATOR_VERSION) \
92-
E2E_CERTMANAGER_VERSION=$(E2E_CERTMANAGER_VERSION) \
91+
E2E_PROMETHEUS_OPERATOR_VERSION=$(TESTE2E_PROMETHEUS_OPERATOR_VERSION) \
92+
E2E_CERTMANAGER_VERSION=$(TESTE2E_CERTMANAGER_VERSION) \
9393
go test ./test/e2e/ -v -ginkgo.v
9494

95-
# Run gNMI server unit tests
96-
test-gnmi-unit: FORCE
97-
@printf "\e[1;36m>> go test ./test/gnmi/testserver/...\e[0m\n"
98-
@go test ./test/gnmi/testserver/...
95+
# Provider for gNMI integration tests
96+
TESTGNMI_PROVIDER ?= openconfig
97+
# Number of parallel Ginkgo processes
98+
GINKGO_PROCS ?= 4
9999

100-
# Provider for gNMI integration tests (default: openconfig)
101-
PROVIDER ?= openconfig
102-
103-
# Run gNMI integration tests (envtest-based)
104-
test-gnmi: FORCE test-gnmi-unit install-setup-envtest
105-
@printf "\e[1;36m>> ginkgo run --procs=4 ./test/gnmi/ (PROVIDER=$(PROVIDER))\e[0m\n"
106-
@KUBEBUILDER_ASSETS=$$(setup-envtest use 1.32 -p path) PROVIDER=$(PROVIDER) ginkgo run --procs=4 ./test/gnmi/
100+
# Run gNMI integration tests
101+
test-gnmi: FORCE install-setup-envtest
102+
@printf "\e[1;36m>> ginkgo run --procs=$(GINKGO_PROCS) ./test/gnmi/ (PROVIDER=$(TESTGNMI_PROVIDER))\e[0m\n"
103+
@KUBEBUILDER_ASSETS=$$(setup-envtest use 1.32 -p path) PROVIDER=$(TESTGNMI_PROVIDER) ginkgo run --procs=$(GINKGO_PROCS) ./test/gnmi/
107104

108105
docker-build: FORCE
109106
@printf "\e[1;36m>> $(CONTAINER_TOOL) build --tag=$(IMG) .\e[0m\n"

Makefile.maker.yaml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,22 +127,19 @@ verbatim: |
127127
}
128128
@printf "\e[1;36m>> go test ./test/e2e/ -v -ginkgo.v\e[0m\n"
129129
@KIND_CLUSTER=$(KIND_CLUSTER) \
130-
E2E_PROMETHEUS_OPERATOR_VERSION=$(E2E_PROMETHEUS_OPERATOR_VERSION) \
131-
E2E_CERTMANAGER_VERSION=$(E2E_CERTMANAGER_VERSION) \
130+
E2E_PROMETHEUS_OPERATOR_VERSION=$(TESTE2E_PROMETHEUS_OPERATOR_VERSION) \
131+
E2E_CERTMANAGER_VERSION=$(TESTE2E_CERTMANAGER_VERSION) \
132132
go test ./test/e2e/ -v -ginkgo.v
133133
134-
# Run gNMI server unit tests
135-
test-gnmi-unit: FORCE
136-
@printf "\e[1;36m>> go test ./test/gnmi/testserver/...\e[0m\n"
137-
@go test ./test/gnmi/testserver/...
134+
# Provider for gNMI integration tests
135+
TESTGNMI_PROVIDER ?= openconfig
136+
# Number of parallel Ginkgo processes
137+
GINKGO_PROCS ?= 4
138138
139-
# Provider for gNMI integration tests (default: openconfig)
140-
PROVIDER ?= openconfig
141-
142-
# Run gNMI integration tests (envtest-based)
143-
test-gnmi: FORCE test-gnmi-unit install-setup-envtest
144-
@printf "\e[1;36m>> ginkgo run --procs=4 ./test/gnmi/ (PROVIDER=$(PROVIDER))\e[0m\n"
145-
@KUBEBUILDER_ASSETS=$$(setup-envtest use 1.32 -p path) PROVIDER=$(PROVIDER) ginkgo run --procs=4 ./test/gnmi/
139+
# Run gNMI integration tests
140+
test-gnmi: FORCE install-setup-envtest
141+
@printf "\e[1;36m>> ginkgo run --procs=$(GINKGO_PROCS) ./test/gnmi/ (PROVIDER=$(TESTGNMI_PROVIDER))\e[0m\n"
142+
@KUBEBUILDER_ASSETS=$$(setup-envtest use 1.32 -p path) PROVIDER=$(TESTGNMI_PROVIDER) ginkgo run --procs=$(GINKGO_PROCS) ./test/gnmi/
146143
147144
docker-build: FORCE
148145
@printf "\e[1;36m>> $(CONTAINER_TOOL) build --tag=$(IMG) .\e[0m\n"

0 commit comments

Comments
 (0)