Skip to content

Commit de17184

Browse files
committed
Update KVM and ginkgo setup
Signed-off-by: David Cassany <[email protected]>
1 parent f7aafec commit de17184

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

.github/workflows/build_and_test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@ jobs:
130130
- name: Enable KVM group perms
131131
run: |
132132
sudo apt-get update
133-
sudo apt-get install qemu qemu-utils ovmf qemu-system-x86
133+
sudo apt-get install qemu-utils ovmf qemu-system-x86
134134
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
135135
sudo udevadm control --reload-rules
136136
sudo udevadm trigger --name-match=kvm
137137
- name: Run ${{ matrix.test }}
138138
run: |
139-
make DISK=/tmp/elemental-${{ env.FLAVOR }}.${{ env.ARCH}}.qcow2 ELMNTL_TARGETARCH=${{ env.ARCH }} ELMNTL_FIRMWARE=/usr/share/OVMF/OVMF_CODE.fd ${{ matrix.test }}
139+
make DISK=/tmp/elemental-${{ env.FLAVOR }}.${{ env.ARCH}}.qcow2 ELMNTL_TARGETARCH=${{ env.ARCH }} ELMNTL_FIRMWARE=/usr/share/OVMF/OVMF_CODE_4M.fd ${{ matrix.test }}
140140
# TODO include other logs SUT collects on failure
141141
- name: Upload serial console for ${{ matrix.test }}
142142
uses: actions/upload-artifact@v4

make/Makefile.test

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
GINKGO?=$(shell which ginkgo 2> /dev/null)
2-
ifeq ("$(GINKGO)","")
3-
GINKGO="$(HOME)/go/bin/ginkgo"
4-
endif
5-
6-
GINKGO_ARGS?=-v --fail-fast -r --timeout=3h
1+
GINKGO ?= "github.com/onsi/ginkgo/v2/ginkgo"
2+
GINKGO_ARGS ?=-v --fail-fast -r --timeout=3h
73

84
.PHONY: prepare-test
95
prepare-test:
@@ -13,7 +9,7 @@ ifeq ("$(DISK)","")
139
endif
1410
@scripts/run_vm.sh start $(DISK)
1511
@echo "VM started from $(DISK)"
16-
$(GINKGO) run $(GINKGO_ARGS) ./tests/wait-active
12+
go run $(GINKGO) run $(GINKGO_ARGS) ./tests/wait-active
1713

1814
.PHONY: prepare-installer-test
1915
prepare-installer-test:
@@ -31,27 +27,27 @@ test-clean:
3127

3228
.PHONY: test-smoke
3329
test-smoke: prepare-test
34-
$(GINKGO) run $(GINKGO_ARGS) ./tests/smoke
30+
go run $(GINKGO) run $(GINKGO_ARGS) ./tests/smoke
3531

3632
.PHONY: test-grubfallback
3733
test-grubfallback: prepare-test
38-
$(GINKGO) run $(GINKGO_ARGS) ./tests/grubfallback
34+
go run $(GINKGO) run $(GINKGO_ARGS) ./tests/grubfallback
3935

4036
.PHONY: test-recovery
4137
test-recovery: prepare-test
42-
$(GINKGO) run $(GINKGO_ARGS) ./tests/recovery
38+
go run $(GINKGO) run $(GINKGO_ARGS) ./tests/recovery
4339

4440
.PHONY: test-fallback
4541
test-fallback: prepare-test
46-
$(GINKGO) run $(GINKGO_ARGS) ./tests/fallback
42+
go run $(GINKGO) run $(GINKGO_ARGS) ./tests/fallback
4743

4844
.PHONY: test-fsck
4945
test-fsck: prepare-test
50-
$(GINKGO) run $(GINKGO_ARGS) ./tests/fsck
46+
go run $(GINKGO) run $(GINKGO_ARGS) ./tests/fsck
5147

5248
.PHONY: test-upgrade
5349
test-upgrade: prepare-test
54-
$(GINKGO) run $(GINKGO_ARGS) ./tests/upgrade
50+
go run $(GINKGO) run $(GINKGO_ARGS) ./tests/upgrade
5551

5652
.PHONY: test-deps
5753
test-deps:
@@ -60,16 +56,16 @@ test-deps:
6056
go install github.com/onsi/ginkgo/v2/ginkgo
6157

6258
.PHONY: test-cli
63-
test-cli: $(GINKGO)
64-
$(GINKGO) run --label-filter '!root' --fail-fast --race --covermode=atomic --coverprofile=coverage.txt --coverpkg=github.com/rancher/elemental-toolkit/... -p -r ${PKG}
59+
test-cli:
60+
go run $(GINKGO) run --label-filter '!root' --fail-fast --race --covermode=atomic --coverprofile=coverage.txt --coverpkg=github.com/rancher/elemental-toolkit/... -p -r ${PKG}
6561

6662
.PHONY: test-root
67-
test-root: $(GINKGO)
63+
test-root:
6864
ifneq ($(shell id -u), 0)
6965
@echo "This tests require root/sudo to run."
7066
@exit 1
7167
else
72-
$(GINKGO) run --label-filter root --fail-fast --race --covermode=atomic --coverprofile=coverage_root.txt --coverpkg=github.com/rancher/elemental-toolkit/... -procs=1 -r ${PKG}
68+
go run $(GINKGO) run --label-filter root --fail-fast --race --covermode=atomic --coverprofile=coverage_root.txt --coverpkg=github.com/rancher/elemental-toolkit/... -procs=1 -r ${PKG}
7369
endif
7470

7571

0 commit comments

Comments
 (0)