Skip to content

Commit da1eb7c

Browse files
committed
Basic e2e tests
Signed-off-by: Jirka Kremser <[email protected]>
1 parent 1281e61 commit da1eb7c

16 files changed

+695
-16
lines changed

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ test: ## Runs golang unit tests.
5353
@$(call say,Running golang unit tests)
5454
go test -race -v ./...
5555

56+
.PHONY: e2e-test
57+
e2e-test: ## Runs end to end tests. This will spawn a k3d cluster.
58+
@$(call say,Running end to end tests)
59+
cd e2e-tests && go test -race -v ./...
60+
5661
codegen: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
5762
$(CONTROLLER_GEN) object:headerFile='hack/boilerplate.go.txt' paths='./...'
5863
./hack/update-codegen.sh

dev.Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dev-k3d: build-image ## Builds the container image for current arch, imports it
1818
dev-local: ## Prepare the SO and otel collector for local debug
1919
@$(call say,Prepare the conditions for local debug)
2020
helm upgrade --reuse-values \
21-
kedify-otel helmchart/otel-add-on \
21+
keda-otel helmchart/otel-add-on \
2222
--set replicaCount=1 \
2323
--set opentelemetry-collector.config.exporters.otlp.endpoint=$(LOCAL_ENDPOINT):4317
2424
kubectl patch so $(SO_NAME) --type=json -p '[{"op":"replace","path":"/spec/triggers/0/metadata/scalerAddress","value":"$(LOCAL_ENDPOINT):4318"}]'

e2e-tests/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/*

e2e-tests/go.mod

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
module github.com/kedify/otel-add-on-test
2+
3+
go 1.22.2
4+
5+
toolchain go1.22.7
6+
7+
require (
8+
github.com/gruntwork-io/terratest v0.47.2
9+
github.com/kedacore/keda/v2 v2.14.1-0.20240429185716-c55e306af94b
10+
github.com/onsi/ginkgo/v2 v2.21.0
11+
github.com/onsi/gomega v1.34.2
12+
github.com/stretchr/testify v1.9.0
13+
k8s.io/client-go v0.30.1
14+
sigs.k8s.io/controller-runtime v0.18.4
15+
)
16+
17+
require (
18+
github.com/beorn7/perks v1.0.1 // indirect
19+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
20+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
21+
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
22+
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
23+
github.com/expr-lang/expr v1.16.5 // indirect
24+
github.com/fsnotify/fsnotify v1.7.0 // indirect
25+
github.com/go-logr/logr v1.4.2 // indirect
26+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
27+
github.com/go-openapi/jsonreference v0.21.0 // indirect
28+
github.com/go-openapi/swag v0.23.0 // indirect
29+
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
30+
github.com/gogo/protobuf v1.3.2 // indirect
31+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
32+
github.com/golang/protobuf v1.5.4 // indirect
33+
github.com/google/gnostic-models v0.6.8 // indirect
34+
github.com/google/go-cmp v0.6.0 // indirect
35+
github.com/google/gofuzz v1.2.0 // indirect
36+
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect
37+
github.com/google/uuid v1.6.0 // indirect
38+
github.com/imdario/mergo v0.3.16 // indirect
39+
github.com/josharian/intern v1.0.0 // indirect
40+
github.com/json-iterator/go v1.1.12 // indirect
41+
github.com/mailru/easyjson v0.7.7 // indirect
42+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
43+
github.com/modern-go/reflect2 v1.0.2 // indirect
44+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
45+
github.com/pkg/errors v0.9.1 // indirect
46+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
47+
github.com/prometheus/client_golang v1.19.0 // indirect
48+
github.com/prometheus/client_model v0.6.1 // indirect
49+
github.com/prometheus/common v0.53.0 // indirect
50+
github.com/prometheus/procfs v0.14.0 // indirect
51+
github.com/spf13/pflag v1.0.5 // indirect
52+
golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f // indirect
53+
golang.org/x/net v0.30.0 // indirect
54+
golang.org/x/oauth2 v0.22.0 // indirect
55+
golang.org/x/sys v0.26.0 // indirect
56+
golang.org/x/term v0.25.0 // indirect
57+
golang.org/x/text v0.19.0 // indirect
58+
golang.org/x/time v0.5.0 // indirect
59+
golang.org/x/tools v0.26.0 // indirect
60+
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
61+
google.golang.org/protobuf v1.34.2 // indirect
62+
gopkg.in/inf.v0 v0.9.1 // indirect
63+
gopkg.in/yaml.v2 v2.4.0 // indirect
64+
gopkg.in/yaml.v3 v3.0.1 // indirect
65+
k8s.io/api v0.30.1 // indirect
66+
k8s.io/apiextensions-apiserver v0.30.1 // indirect
67+
k8s.io/apimachinery v0.30.3 // indirect
68+
k8s.io/klog/v2 v2.120.1 // indirect
69+
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
70+
k8s.io/utils v0.0.0-20240423183400-0849a56e8f22 // indirect
71+
knative.dev/pkg v0.0.0-20240423132823-3c6badc82748 // indirect
72+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
73+
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
74+
sigs.k8s.io/yaml v1.4.0 // indirect
75+
)
76+
77+
replace github.com/open-policy-agent/cert-controller => github.com/open-policy-agent/cert-controller v0.11.0

0 commit comments

Comments
 (0)