Skip to content

Commit

Permalink
ci: in-place patch tests for arm to disable acceleration
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhail-sakhnov committed Oct 30, 2024
1 parent 06a719b commit da49b82
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,13 @@ jobs:
docker pull "$TEST_IMAGE"
docker image tag "$TEST_IMAGE" "$IMG_E2E_TEST"
make load-example-vms
# - run: make e2e
# timeout-minutes: 15
- name: Patch e2e tests to not use acceleration in arm runners
if: matrix.arch == 'arm64'
run: make arm_patch_e2e

- run: make e2e
timeout-minutes: 15

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,15 @@ e2e: check-local-context e2e-tools ## Run e2e kuttl tests
$(KUTTL) test --config tests/e2e/kuttl-test.yaml $(if $(CI),--skip-delete)
rm -f kubeconfig

# arm doesn't support cpu hot plug and memory hot plug and CI runners are based on qemu so no kvm acceleration as well
arm_patch_e2e: yq
@find tests/e2e -name "*.yaml" | xargs -I{} ./bin/yq eval '(select(.kind == "VirtualMachine") | .spec.enableAcceleration = false) // .' -i {}
@find tests/e2e -name "*.yaml" | xargs -I{} ./bin/yq eval '(select(.kind == "VirtualMachine") | .status.memoryProvider = "VirtioMem") // .' -i {}
@find tests/e2e -name "*.yaml" | xargs -I{} ./bin/yq eval '(select(.kind == "VirtualMachine") | .spec.guest.memoryProvider = "VirtioMem") // .' -i {}

revert_path_e2e:
git checkout tests/e2e

##@ Local kind cluster

.PHONY: kind-setup
Expand Down Expand Up @@ -506,7 +515,12 @@ else ifeq ($(GOARCH), amd64)
else
$(error Unsupported architecture: $(GOARCH))
endif

YQ_ARCH ?= $(GOARCH)
YQ ?= $(LOCALBIN)/yq

KUBECTL ?= $(LOCALBIN)/kubectl

KUBECTL_VERSION ?= v1.28.12

KIND ?= $(LOCALBIN)/kind
Expand Down Expand Up @@ -544,6 +558,11 @@ kubectl: $(KUBECTL) ## Download kubectl locally if necessary.
$(KUBECTL): $(LOCALBIN)
@test -s $(LOCALBIN)/kubectl || { curl -sfSLo $(KUBECTL) https://dl.k8s.io/release/$(KUBECTL_VERSION)/bin/$(GOOS)/$(GOARCH)/kubectl && chmod +x $(KUBECTL); }

.PHONY: yq
yq: $(YQ)
$(YQ):
@test -s $(YQ) || { curl -sfSLo $(YQ) https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_arm64 && chmod +x $(YQ); }

.PHONY: kuttl
kuttl: $(KUTTL) ## Download kuttl locally if necessary.
$(KUTTL): $(LOCALBIN)
Expand Down

0 comments on commit da49b82

Please sign in to comment.