ci: add coverage output and nightly workflow with etcd e2e suite

Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
This commit is contained in:
Maximilian Rink
2026-08-23 16:22:04 +02:00
committed by Marcel Fest
parent 5cd138a85b
commit 8a968618bf
3 changed files with 56 additions and 2 deletions

50
.github/workflows/nightly-e2e.yaml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: Nightly e2e
on:
schedule:
- cron: '30 2 * * *'
workflow_dispatch:
jobs:
unit-coverage:
runs-on: ubuntu-latest
name: Unit tests with coverage
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Install Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Run tests
run: make unit-tests
- name: Upload coverage
uses: actions/upload-artifact@v7
with:
name: unit-coverage
path: coverage.out
etcd-e2e:
runs-on: ubuntu-latest
name: Etcd E2E tests
timeout-minutes: 60
continue-on-error: true
steps:
- name: Ensure fs wont cause issues
run: sudo sysctl fs.inotify.max_user_instances=8192 && sudo sysctl fs.inotify.max_user_watches=524288
- name: Checkout code
uses: actions/checkout@v7
- name: Install Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Build image locally
run: make dockerx86Local
- name: Run Etcd tests
run: DOCKER_API_VERSION=1.48 E2E_KEEP_LOGS=true make e2e-tests-etcd
- name: Save logs
uses: actions/upload-artifact@v7
with:
name: etcd-e2e-logs
path: /tmp/kube-vip-test*
if: always()

1
.gitignore vendored
View File

@@ -3,6 +3,7 @@ kube-vip
.vscode
bin
testing/e2e/etcd/certs
coverage.out
pkg/etcd/etcd.pid
pkg/etcd/etcd-data
testing/e2e/e2e.test

View File

@@ -23,7 +23,7 @@ GINKGO_PROCS ?=
GINKGO_PARALLEL := $(if $(GINKGO_PROCS),--procs=$(GINKGO_PROCS),-p)
BUILDX_CACHE_FLAGS ?=
.PHONY: all build clean install uninstall simplify check run e2e-tests unit-tests integration-tests unit-tests-docker integration-tests-docker
.PHONY: all build clean install uninstall simplify check run e2e-tests unit-tests integration-tests unit-tests-docker integration-tests-docker e2e-tests-etcd
all: check install
@@ -133,7 +133,7 @@ manifest-test:
docker run $(REPOSITORY)/$(TARGET):$(DOCKERTAG) manifest daemonset --interface eth0 --vip 192.168.0.1 --image "$(REPOSITORY)/$(TARGET):$(DOCKERTAG)" --bgp --leaderElection --controlplane --services --inCluster
unit-tests:
go test -race ./...
go test -race -coverprofile=coverage.out -covermode=atomic ./...
unit-tests-docker:
docker run --rm -w /kube-vip -v $$(pwd):/kube-vip -v kube-vip-gomod-cache:/go/pkg/mod -v kube-vip-gobuild-cache:/root/.cache/go-build golang:$(GO_VERSION) sh -c "make unit-tests; status=$$?; chmod 666 coverage.out 2>/dev/null || true; exit $$status"
@@ -150,6 +150,9 @@ e2e-tests-rt: get-whoami
e2e-tests-bgp: get-whoami get-gobgp
GOMAXPROCS=4 TEST_MODE=bgp K8S_IMAGE_PATH=kindest/node:$(K8S_VERSION) E2E_IMAGE_PATH=$(REPOSITORY)/$(TARGET):$(DOCKERTAG) go run github.com/onsi/ginkgo/v2/ginkgo --tags=e2e -v $(GINKGO_PARALLEL) $(GINKGO_ARGS) ./testing/e2e
e2e-tests-etcd: get-whoami
K8S_IMAGE_PATH=kindest/node:$(K8S_VERSION) E2E_IMAGE_PATH=$(REPOSITORY)/$(TARGET):$(DOCKERTAG) go run github.com/onsi/ginkgo/v2/ginkgo --tags=e2e -v $(GINKGO_PARALLEL) $(GINKGO_ARGS) ./testing/e2e/etcd
e2e-tests: e2e-tests-arp e2e-tests-rt e2e-tests-bgp
service-tests: