Skip to content

Commit 8570853

Browse files
committed
Enable Prow tests
The project infra has been configured for this repository. Just need to make sure the appropriate scripts are in place. Signed-off-by: Alexander Wels <awels@redhat.com>
1 parent 7fc0344 commit 8570853

File tree

342 files changed

+44973
-2659
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

342 files changed

+44973
-2659
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ config/manager/kustomization.yaml
3131

3232
# kubevirtci
3333
_ci-configs/*
34+
35+
# ci artifacts
36+
_artifacts

Makefile

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,8 @@ $(info Using kubevirtci kubectl)
6868
KUBECTL_PATH = $(PWD)/cluster-up/kubectl.sh
6969
endif
7070

71-
# CONTAINER_TOOL defines the container tool to be used for building images.
72-
# Be aware that the target commands are only tested with Docker which is
73-
# scaffolded by default. However, you might want to replace it to use other
74-
# tools. (i.e. podman)
75-
CONTAINER_TOOL ?= docker
71+
MIGRATION_CONTROLLER_NAMESPACE ?= kubevirt
72+
CONTAINER_TOOL ?= podman
7673

7774
# Setting SHELL to bash allows bash commands to be executed by recipes.
7875
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
@@ -135,16 +132,18 @@ vet: ## Run go vet against code.
135132
go vet ./...
136133

137134
.PHONY: test
138-
test: manifests generate fmt vet setup-envtest ## Run tests.
139-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
135+
test: manifests generate fmt vet setup-envtest ginkgo ## Run tests.
136+
@echo "Running unit tests ginkgo $(GINKGO)"
137+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" KUBERNETES_MASTER="" $(GINKGO) -v --junit-report=$(ARTIFACTS)/junit.functest.xml $$(go list ./... | grep -v /e2e | awk '{gsub("kubevirt.io/kubevirt-migration-controller/", ""); print}')
140138

141139
# TODO(user): To use a different vendor for e2e tests, modify the setup under 'tests/e2e'.
142140
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
143141
# CertManager is installed by default; skip with:
144142
# - CERT_MANAGER_INSTALL_SKIP=true
145143
.PHONY: test-e2e
146-
test-e2e: manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
147-
go test ./test/e2e/ -v -ginkgo.v --kubectl-path=$(KUBECTL_PATH) --test-kubeconfig=$(KUBECONFIG) --kubeurl=$(KUBEURL)
144+
test-e2e: manifests generate fmt vet gotestsum ## Run the e2e tests. Expected an isolated environment using Kind.
145+
@echo "Running e2e tests gotestsum $(GOTESTSUM)"
146+
$(GOTESTSUM) --junitfile $(ARTIFACTS)/junit.functest.xml -- ./test/e2e/ -v -ginkgo.v --migration-controller-namespace=$(MIGRATION_CONTROLLER_NAMESPACE) --kubectl-path=$(KUBECTL_PATH) --test-kubeconfig=$(KUBECONFIG) --kubeurl=$(KUBEURL)
148147

149148
.PHONY: lint
150149
lint: golangci-lint ## Run golangci-lint linter
@@ -243,6 +242,9 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
243242
CLIENT_GEN ?= $(LOCALBIN)/client-gen
244243
ENVTEST ?= $(LOCALBIN)/setup-envtest
245244
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
245+
ARTIFACTS ?= $(PWD)/_artifacts
246+
GOTESTSUM ?= $(LOCALBIN)/gotestsum
247+
GINKGO ?= $(LOCALBIN)/ginkgo
246248

247249
## Tool Versions
248250
KUSTOMIZE_VERSION ?= v5.6.0
@@ -254,6 +256,8 @@ ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller
254256
#ENVTEST_K8S_VERSION is the version of Kubernetes to use for setting up ENVTEST binaries (i.e. 1.31)
255257
ENVTEST_K8S_VERSION ?= $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $$3}')
256258
GOLANGCI_LINT_VERSION ?= v1.63.4
259+
GOTESTSUM_VERSION ?= v1.13.0
260+
GINKGO_VERSION ?= v2.27.2
257261

258262
.PHONY: kustomize
259263
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
@@ -270,6 +274,16 @@ client-gen: $(CLIENT_GEN) ## Download client-gen locally if necessary.
270274
$(CLIENT_GEN): $(LOCALBIN)
271275
$(call go-install-tool,$(CLIENT_GEN),k8s.io/code-generator/cmd/client-gen,$(CLIENT_GEN_VERSION))
272276

277+
.PHONY: gotestsum
278+
gotestsum: $(GOTESTSUM) ## Download gotestsum locally if necessary.
279+
$(GOTESTSUM): $(LOCALBIN)
280+
$(call go-install-tool,$(GOTESTSUM),gotest.tools/gotestsum,$(GOTESTSUM_VERSION))
281+
282+
.PHONY: ginkgo
283+
ginkgo: $(GINKGO) ## Download ginkgo locally if necessary.
284+
$(GINKGO): $(LOCALBIN)
285+
$(call go-install-tool,$(GINKGO),github.com/onsi/ginkgo/v2/ginkgo,$(GINKGO_VERSION))
286+
273287
.PHONY: setup-envtest
274288
setup-envtest: envtest ## Download the binaries required for ENVTEST in the local bin directory.
275289
@echo "Setting up envtest binaries for Kubernetes version $(ENVTEST_K8S_VERSION)..."

config/default/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Adds namespace to all resources.
2-
namespace: kubevirt-migration-system
2+
namespace: kubevirt
33

44
# Value of this field is prepended to the
55
# names of all resources, e.g. a deployment named

config/manager/controller.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
apiVersion: v1
2-
kind: Namespace
3-
metadata:
4-
labels:
5-
control-plane: controller
6-
app.kubernetes.io/name: kubevirt-migration-controller
7-
app.kubernetes.io/managed-by: kustomize
8-
name: system
9-
---
1+
102
apiVersion: apps/v1
113
kind: Deployment
124
metadata:

go.mod

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ toolchain go1.24.10
77
godebug default=go1.23
88

99
require (
10-
github.com/go-logr/logr v1.4.2
11-
github.com/onsi/ginkgo/v2 v2.22.0
12-
github.com/onsi/gomega v1.36.1
10+
github.com/go-logr/logr v1.4.3
11+
github.com/onsi/ginkgo/v2 v2.27.2
12+
github.com/onsi/gomega v1.38.2
1313
github.com/openshift/api v0.0.0-20251111193948-50e2ece149d7
1414
github.com/prometheus/client_golang v1.19.1
1515
github.com/prometheus/common v0.55.0
@@ -24,6 +24,7 @@ require (
2424

2525
require (
2626
cel.dev/expr v0.18.0 // indirect
27+
github.com/Masterminds/semver/v3 v3.4.0 // indirect
2728
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
2829
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
2930
github.com/beorn7/perks v1.0.1 // indirect
@@ -47,7 +48,7 @@ require (
4748
github.com/google/cel-go v0.22.0 // indirect
4849
github.com/google/gnostic-models v0.7.0 // indirect
4950
github.com/google/go-cmp v0.7.0 // indirect
50-
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect
51+
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
5152
github.com/google/uuid v1.6.0 // indirect
5253
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
5354
github.com/inconshreveable/mousetrap v1.1.0 // indirect
@@ -79,19 +80,20 @@ require (
7980
go.yaml.in/yaml/v2 v2.4.2 // indirect
8081
go.yaml.in/yaml/v3 v3.0.4 // indirect
8182
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
82-
golang.org/x/net v0.38.0 // indirect
83+
golang.org/x/mod v0.27.0 // indirect
84+
golang.org/x/net v0.43.0 // indirect
8385
golang.org/x/oauth2 v0.27.0 // indirect
84-
golang.org/x/sync v0.12.0 // indirect
85-
golang.org/x/sys v0.31.0 // indirect
86-
golang.org/x/term v0.30.0 // indirect
87-
golang.org/x/text v0.23.0 // indirect
86+
golang.org/x/sync v0.16.0 // indirect
87+
golang.org/x/sys v0.35.0 // indirect
88+
golang.org/x/term v0.34.0 // indirect
89+
golang.org/x/text v0.28.0 // indirect
8890
golang.org/x/time v0.9.0 // indirect
89-
golang.org/x/tools v0.26.0 // indirect
91+
golang.org/x/tools v0.36.0 // indirect
9092
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
9193
google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7 // indirect
9294
google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 // indirect
9395
google.golang.org/grpc v1.65.0 // indirect
94-
google.golang.org/protobuf v1.36.5 // indirect
96+
google.golang.org/protobuf v1.36.7 // indirect
9597
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
9698
gopkg.in/inf.v0 v0.9.1 // indirect
9799
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)