Skip to content

Commit f56f22b

Browse files
committed
Provide instructions to generate conformance binary
1 parent c3237e8 commit f56f22b

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Session.vim
5151
.*.timestamp
5252
/site
5353
go.work.sum
54+
/conformance.test
5455

5556
/cache
5657
.venv/

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ GO_TEST_FLAGS ?=
5858
CEL_TEST_K8S_VERSION ?=
5959
CEL_TEST_CRD_CHANNEL ?= standard
6060

61+
# Compilation flags for binaries
62+
GOARCH ?= $(shell go env GOARCH)
63+
GOOS ?= $(shell go env GOOS)
64+
6165
all: generate vet fmt verify test
6266

6367
.PHONY: clean-generated
@@ -103,6 +107,11 @@ test.crds-validation:
103107
conformance:
104108
go test ${GO_TEST_FLAGS} -v ./conformance -run TestConformance -args ${CONFORMANCE_FLAGS}
105109

110+
# Build a conformance.test binary that can be used as a standalone binary to run conformance test
111+
.PHONY: conformance-bin
112+
conformance-bin:
113+
GOOS=$(GOOS) GOARCH=$(GOARCH) go test -c -v ./conformance
114+
106115
# Install CRD's and example resources to a preexisting cluster.
107116
.PHONY: install
108117
install: crd example

site-src/concepts/conformance.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,27 @@ implementations pass those tests.
183183
[network_plugins]: https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/
184184
[netpol]: https://kubernetes.io/docs/concepts/services-networking/network-policies/
185185

186+
### Compiling Conformance tests
187+
!!! note
188+
This step is optional, and the binary can be used to execute conformance tests
189+
on an environment different from the developer environment
190+
191+
In case there's a need to generate a conformance test binary to be executed on a
192+
different environment, a binary `conformance.test` can be generated with:
193+
194+
```
195+
make conformance-bin
196+
```
197+
198+
Specific GOOS and GOARCH flags can be passed to generate the binary for different
199+
architectures:
200+
201+
```
202+
make GOOS=darwin GOARCH=arm64 conformance-bin
203+
```
204+
205+
Then the conformance binary can be called as `./conformance.test <flags>`
206+
186207
### Conformance Profiles
187208

188209
The Conformance profiles are a tool to group multiple supported features, with the

0 commit comments

Comments
 (0)