Skip to content

Commit dd29a92

Browse files
committed
e2e: add building blocks and test agent mode
add building blocks for tests: - proxy which acts as a reverse proxy between agent and backend - observer to count the requests between agent and backend - actioner to act as a user on backend or to create jwt for agent - dbReadWriter to act directly on the db to check or create resources like private keys for agent authentication Signed-off-by: Cosmin Tupangiu <[email protected]>
1 parent 7b154d9 commit dd29a92

File tree

18 files changed

+1622
-112
lines changed

18 files changed

+1622
-112
lines changed

.github/workflows/e2e.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,14 @@ jobs:
5353
run: make build.e2e
5454

5555
- name: Pull test images
56-
run: podman pull docker.io/library/postgres:17
56+
run: |
57+
podman pull docker.io/library/postgres:17
58+
podman pull docker.io/vmware/vcsim:latest
5759
5860
- name: Run e2e tests
5961
run: |
6062
./bin/e2e \
61-
--backend-image=${{ env.BACKEND_IMAGE }}:${{ env.BACKEND_TAG }} \
62-
--agent-image=${{ env.AGENT_IMAGE }} \
63-
--podman-socket=${{ env.PODMAN_SOCKET }}
63+
-backend-image=${{ env.BACKEND_IMAGE }}:${{ env.BACKEND_TAG }} \
64+
-agent-image=${{ env.AGENT_IMAGE }} \
65+
-podman-socket=${{ env.PODMAN_SOCKET }} \
66+
--ginkgo.v

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: generate generate.proto build build.e2e run help tidy tidy-check clean lint format check-format check-generate validate-all image
1+
.PHONY: generate generate.proto build build.e2e e2e run help tidy tidy-check clean lint format check-format check-generate validate-all image
22

33
PODMAN ?= podman
44
GIT_COMMIT=$(shell git rev-list -1 HEAD --abbrev-commit)
@@ -19,6 +19,8 @@ GO_BUILD_FLAGS := ${GO_BUILD_FLAGS}
1919
help:
2020
@echo "Targets:"
2121
@echo " build: build the agent binary"
22+
@echo " build.e2e: build the e2e test binary"
23+
@echo " e2e: run e2e tests"
2224
@echo " image: build container image"
2325
@echo " run: run the agent"
2426
@echo " run.ui: start React dev server"
@@ -44,6 +46,13 @@ build.e2e:
4446
go build -tags "exclude_graphdriver_btrfs containers_image_openpgp" -o bin/e2e ./test/e2e
4547
@echo "Build complete: bin/e2e"
4648

49+
E2E_AGENT_IMAGE ?= $(IMAGE_NAME):$(IMAGE_TAG)
50+
E2E_BACKEND_IMAGE ?= quay.io/kubev2v/migration-planner-api:latest
51+
52+
e2e: build.e2e
53+
@echo "🧪 Running e2e tests..."
54+
./bin/e2e -agent-image=$(E2E_AGENT_IMAGE) -backend-image=$(E2E_BACKEND_IMAGE) --ginkgo.v
55+
4756
# Build container image
4857
image:
4958
@echo "📦 Building container image $(IMAGE_NAME):$(IMAGE_TAG)..."

go.mod

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ require (
1313
github.com/gin-contrib/zap v1.1.5
1414
github.com/gin-gonic/gin v1.11.0
1515
github.com/go-extras/cobraflags v0.0.0-20260116100222-f76efc9500d4
16+
github.com/golang-jwt/jwt/v5 v5.3.0
1617
github.com/google/uuid v1.6.0
1718
github.com/jzelinskie/cobrautil/v2 v2.0.0-20240819150235-f7fe73942d0f
18-
github.com/kubev2v/forklift v0.0.0-20260109132042-6ac29b3130c3
19-
github.com/kubev2v/migration-planner v0.3.1-0.20260120154119-449e7b20a97c
19+
github.com/kubev2v/forklift v0.0.0-20260130164321-c17a5c5a3baa
20+
github.com/kubev2v/migration-planner v0.4.1-0.20260203094707-e49cf70017c7
21+
github.com/lib/pq v1.10.0
2022
github.com/oapi-codegen/runtime v1.1.2
2123
github.com/onsi/ginkgo/v2 v2.27.2
2224
github.com/onsi/gomega v1.38.2
23-
github.com/opencontainers/runtime-spec v1.2.1
2425
github.com/spf13/cobra v1.10.2
2526
github.com/spf13/pflag v1.0.10
2627
github.com/spf13/viper v1.21.0
@@ -42,6 +43,8 @@ require (
4243
github.com/agnivade/levenshtein v1.2.1 // indirect
4344
github.com/apache/arrow-go/v18 v18.4.1 // indirect
4445
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
46+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.274.0 // indirect
47+
github.com/aws/smithy-go v1.23.2 // indirect
4548
github.com/beorn7/perks v1.0.1 // indirect
4649
github.com/blang/semver/v4 v4.0.0 // indirect
4750
github.com/bytedance/gopkg v0.1.3 // indirect
@@ -136,13 +139,15 @@ require (
136139
github.com/hashicorp/go-version v1.7.0 // indirect
137140
github.com/inconshreveable/mousetrap v1.1.0 // indirect
138141
github.com/jinzhu/copier v0.4.0 // indirect
142+
github.com/jinzhu/inflection v1.0.0 // indirect
143+
github.com/jinzhu/now v1.1.5 // indirect
139144
github.com/joho/godotenv v1.5.1 // indirect
140145
github.com/josharian/intern v1.0.0 // indirect
141146
github.com/json-iterator/go v1.1.12 // indirect
142147
github.com/jzelinskie/stringz v0.0.2 // indirect
143148
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.7 // indirect
144149
github.com/kevinburke/ssh_config v1.4.0 // indirect
145-
github.com/klauspost/compress v1.18.2 // indirect
150+
github.com/klauspost/compress v1.18.3 // indirect
146151
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
147152
github.com/klauspost/pgzip v1.2.6 // indirect
148153
github.com/kr/fs v0.1.0 // indirect
@@ -178,14 +183,15 @@ require (
178183
github.com/opencontainers/go-digest v1.0.0 // indirect
179184
github.com/opencontainers/image-spec v1.1.1 // indirect
180185
github.com/opencontainers/runc v1.3.4 // indirect
186+
github.com/opencontainers/runtime-spec v1.2.1 // indirect
181187
github.com/opencontainers/runtime-tools v0.9.1-0.20250523060157-0ea5ed0382a2 // indirect
182188
github.com/opencontainers/selinux v1.13.1 // indirect
183-
github.com/openshift/api v0.0.0-20260107103503-6d35063ca179 // indirect
189+
github.com/openshift/api v0.0.0-20260130140113-71e91db96ffc // indirect
184190
github.com/openshift/client-go v0.0.0-20260108185524-48f4ccfc4e13 // indirect
185191
github.com/openshift/custom-resource-status v1.1.2 // indirect
186192
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
187193
github.com/perimeterx/marshmallow v1.1.5 // indirect
188-
github.com/pierrec/lz4/v4 v4.1.22 // indirect
194+
github.com/pierrec/lz4/v4 v4.1.25 // indirect
189195
github.com/pkg/errors v0.9.1 // indirect
190196
github.com/pkg/sftp v1.13.9 // indirect
191197
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
@@ -239,18 +245,18 @@ require (
239245
go.yaml.in/yaml/v2 v2.4.3 // indirect
240246
go.yaml.in/yaml/v3 v3.0.4 // indirect
241247
golang.org/x/arch v0.22.0 // indirect
242-
golang.org/x/crypto v0.46.0 // indirect
243-
golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 // indirect
244-
golang.org/x/mod v0.31.0 // indirect
245-
golang.org/x/net v0.48.0 // indirect
248+
golang.org/x/crypto v0.47.0 // indirect
249+
golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect
250+
golang.org/x/mod v0.32.0 // indirect
251+
golang.org/x/net v0.49.0 // indirect
246252
golang.org/x/oauth2 v0.32.0 // indirect
247253
golang.org/x/sync v0.19.0 // indirect
248-
golang.org/x/sys v0.39.0 // indirect
249-
golang.org/x/telemetry v0.0.0-20251208220230-2638a1023523 // indirect
250-
golang.org/x/term v0.38.0 // indirect
251-
golang.org/x/text v0.32.0 // indirect
254+
golang.org/x/sys v0.40.0 // indirect
255+
golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 // indirect
256+
golang.org/x/term v0.39.0 // indirect
257+
golang.org/x/text v0.33.0 // indirect
252258
golang.org/x/time v0.14.0 // indirect
253-
golang.org/x/tools v0.40.0 // indirect
259+
golang.org/x/tools v0.41.0 // indirect
254260
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
255261
google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 // indirect
256262
google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect
@@ -260,10 +266,11 @@ require (
260266
gopkg.in/inf.v0 v0.9.1 // indirect
261267
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
262268
gopkg.in/yaml.v3 v3.0.1 // indirect
269+
gorm.io/gorm v1.25.11 // indirect
263270
k8s.io/apiextensions-apiserver v0.34.1 // indirect
264271
k8s.io/client-go v0.34.1 // indirect
265272
k8s.io/klog/v2 v2.130.1 // indirect
266-
k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect
273+
k8s.io/kube-openapi v0.0.0-20260127142750-a19766b6e2d4 // indirect
267274
k8s.io/utils v0.0.0-20260108192941-914a6e750570 // indirect
268275
kubevirt.io/api v1.6.2 // indirect
269276
kubevirt.io/containerized-data-importer-api v1.63.1 // indirect

0 commit comments

Comments
 (0)