File tree Expand file tree Collapse file tree 3 files changed +73
-0
lines changed
Expand file tree Collapse file tree 3 files changed +73
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Benchmark Test
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - main
7+
8+ jobs :
9+ benchmark :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout code
13+ uses : actions/checkout@v4
14+ with :
15+ fetch-depth : 0
16+
17+ - name : Install Go
18+ uses : actions/setup-go@v5
19+ with :
20+ go-version-file : go.mod
21+
22+ - name : Install dependencies
23+ run : |
24+ go mod download
25+ go mod tidy
26+
27+ # - name: Debug via SSH
28+ # uses: mxschmitt/action-tmate@v3
29+
30+ - name : Run benchmark test
31+ # working-directory: test/e2e
32+ run : |
33+ mkdir -p /tmp/artifacts/
34+ ARTIFACT_PATH=/tmp/artifacts make test-benchmark
35+
36+ - name : Compare with baseline
37+ run : |
38+ go install golang.org/x/perf/cmd/benchstat@latest
39+ benchstat benchmarks/baseline.txt /tmp/artifacts/new.txt | tee /tmp/artifacts/output
40+
41+ - name : Upload benchmark results
42+ uses : actions/upload-artifact@v4
43+ with :
44+ name : benchmark-artifacts
45+ path : /tmp/artifacts/
46+
Original file line number Diff line number Diff line change @@ -167,6 +167,11 @@ test: manifests generate fmt lint test-unit test-e2e #HELP Run all tests.
167167e2e : # EXHELP Run the e2e tests.
168168 go test -count=1 -v ./test/e2e/...
169169
170+ .PHONY : benchmark
171+ benchmark : # EXHELP Run the benchmark tests.
172+ export CATALOG_IMG=registry.redhat.io/redhat/redhat-operator-index:v4.18
173+ go test -v -run=^$$ -bench=. -benchmem -count=10 -v ./test/e2e/... | tee /tmp/artifacts/new.txt
174+
170175E2E_REGISTRY_NAME := docker-registry
171176E2E_REGISTRY_NAMESPACE := operator-controller-e2e
172177
@@ -256,6 +261,12 @@ catalogd-pre-upgrade-setup:
256261catalogd-image-registry : # # Setup in-cluster image registry
257262 ./test/tools/imageregistry/registry.sh $(ISSUER_KIND ) $(ISSUER_NAME )
258263
264+ .PHONY : test-benchmark
265+ test-benchmark : KIND_CLUSTER_NAME := operator-controller-benchmark
266+ test-benchmark : KUSTOMIZE_BUILD_DIR := config/overlays/e2e
267+ test-benchmark : GO_BUILD_FLAGS := -cover
268+ test-benchmark : run image-registry benchmark kind-clean # HELP Run benchmark test suite on local kind cluster
269+
259270.PHONY : extension-developer-e2e
260271extension-developer-e2e : KUSTOMIZE_BUILD_DIR := config/overlays/cert-manager
261272extension-developer-e2e : KIND_CLUSTER_NAME := operator-controller-ext-dev-e2e # EXHELP Run extension-developer e2e on local kind cluster
Original file line number Diff line number Diff line change 1+ goos: darwin
2+ goarch: arm64
3+ pkg: github.com/operator-framework/operator-controller/test/e2e
4+ cpu: Apple M1 Pro
5+ BenchmarkCreateClusterCatalog-10 1 1352852042 ns/op 404520 B/op 3914 allocs/op
6+ BenchmarkCreateClusterCatalog-10 13 86982353 ns/op 36907 B/op 394 allocs/op
7+ BenchmarkCreateClusterCatalog-10 12 84962496 ns/op 34555 B/op 393 allocs/op
8+ BenchmarkCreateClusterCatalog-10 18 70375363 ns/op 34880 B/op 388 allocs/op
9+ BenchmarkCreateClusterCatalog-10 15 71715708 ns/op 37654 B/op 399 allocs/op
10+ BenchmarkCreateClusterCatalog-10 13 85251170 ns/op 36572 B/op 396 allocs/op
11+ BenchmarkCreateClusterCatalog-10 13 83413260 ns/op 38435 B/op 393 allocs/op
12+ BenchmarkCreateClusterCatalog-10 13 93851487 ns/op 37249 B/op 395 allocs/op
13+ BenchmarkCreateClusterCatalog-10 13 78722212 ns/op 36593 B/op 393 allocs/op
14+ BenchmarkCreateClusterCatalog-10 13 86393522 ns/op 37404 B/op 395 allocs/op
15+ PASS
16+ ok github.com/operator-framework/operator-controller/test/e2e 32.699s
You can’t perform that action at this time.
0 commit comments