Skip to content

Commit

Permalink
e2e: double parallel test nodes in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Mar 1, 2023
1 parent d837d97 commit ea6ddd7
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions Makefile.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ ifeq ($(E2E_IP_FAMILY),dual)
K8S_CONFORMANCE_E2E_FOCUS += "sig-network.*Feature:IPv6DualStack"
endif

GINKGO_PARALLEL_OPT = -p
ifeq ($(shell echo $${CI:-false}),true)
GINKGO_PARALLEL_OPT = --procs $$(($$(nproc) * 2))
endif

define ginkgo_option
--$(1)=$(shell echo '$(2)' | sed -E 's/^[[:space:]]+//' | sed -E 's/"[[:space:]]+"/" --$(1)="/g')
endef
Expand All @@ -51,22 +56,22 @@ e2e-build:
.PHONY: k8s-conformance-e2e
k8s-conformance-e2e:
ginkgo build ./test/e2e/k8s-network
ginkgo -p --randomize-all --timeout=1h \
ginkgo $(GINKGO_PARALLEL_OPT) --randomize-all --progress --timeout=1h \
$(call ginkgo_option,focus,$(K8S_CONFORMANCE_E2E_FOCUS)) \
$(call ginkgo_option,skip,$(K8S_CONFORMANCE_E2E_SKIP)) \
./test/e2e/k8s-network/k8s-network.test

.PHONY: k8s-netpol-legacy-e2e
k8s-netpol-legacy-e2e:
ginkgo build ./test/e2e/k8s-network
ginkgo -p --randomize-all --timeout=2h \
ginkgo $(GINKGO_PARALLEL_OPT) --randomize-all --progress --timeout=2h \
$(call ginkgo_option,focus,$(K8S_NETPOL_LEGACY_E2E_FOCUS)) \
./test/e2e/k8s-network/k8s-network.test

.PHONY: k8s-netpol-e2e
k8s-netpol-e2e:
ginkgo build ./test/e2e/k8s-network
ginkgo -p --randomize-all --timeout=2h \
ginkgo $(GINKGO_PARALLEL_OPT) --randomize-all --progress --timeout=2h \
$(call ginkgo_option,focus,$(K8S_NETPOL_E2E_FOCUS)) \
$(call ginkgo_option,skip,$(K8S_NETPOL_E2E_SKIP)) \
./test/e2e/k8s-network/k8s-network.test
Expand All @@ -91,36 +96,41 @@ kube-ovn-conformance-e2e:
E2E_BRANCH=$(E2E_BRANCH) \
E2E_IP_FAMILY=$(E2E_IP_FAMILY) \
E2E_NETWORK_MODE=$(E2E_NETWORK_MODE) \
ginkgo -p --randomize-all --focus=CNI:Kube-OVN ./test/e2e/kube-ovn/kube-ovn.test
ginkgo $(GINKGO_PARALLEL_OPT) --randomize-all --progress \
--focus=CNI:Kube-OVN ./test/e2e/kube-ovn/kube-ovn.test

.PHONY: kube-ovn-ic-conformance-e2e
kube-ovn-ic-conformance-e2e:
ginkgo build ./test/e2e/ovn-ic
E2E_BRANCH=$(E2E_BRANCH) \
E2E_IP_FAMILY=$(E2E_IP_FAMILY) \
E2E_NETWORK_MODE=$(E2E_NETWORK_MODE) \
ginkgo -p --randomize-all --focus=CNI:Kube-OVN ./test/e2e/ovn-ic/ovn-ic.test
ginkgo $(GINKGO_PARALLEL_OPT) --randomize-all --progress \
--focus=CNI:Kube-OVN ./test/e2e/ovn-ic/ovn-ic.test

.PHONY: kube-ovn-lb-svc-conformance-e2e
kube-ovn-lb-svc-conformance-e2e:
ginkgo build ./test/e2e/lb-svc
E2E_BRANCH=$(E2E_BRANCH) \
E2E_IP_FAMILY=$(E2E_IP_FAMILY) \
E2E_NETWORK_MODE=$(E2E_NETWORK_MODE) \
ginkgo -p --randomize-all --focus=CNI:Kube-OVN ./test/e2e/lb-svc/lb-svc.test
ginkgo $(GINKGO_PARALLEL_OPT) --randomize-all --progress \
--focus=CNI:Kube-OVN ./test/e2e/lb-svc/lb-svc.test

.PHONY: kube-ovn-eip-conformance-e2e
kube-ovn-eip-conformance-e2e:
ginkgo build ./test/e2e/ovn-eip
E2E_BRANCH=$(E2E_BRANCH) \
E2E_IP_FAMILY=$(E2E_IP_FAMILY) \
E2E_NETWORK_MODE=$(E2E_NETWORK_MODE) \
ginkgo -p --randomize-all --focus=CNI:Kube-OVN ./test/e2e/ovn-eip/ovn-eip.test
ginkgo $(GINKGO_PARALLEL_OPT) --randomize-all --progress \
--focus=CNI:Kube-OVN ./test/e2e/ovn-eip/ovn-eip.test

.PHONY: kube-ovn-security-e2e
kube-ovn-security-e2e:
ginkgo build ./test/e2e/security
E2E_BRANCH=$(E2E_BRANCH) \
E2E_IP_FAMILY=$(E2E_IP_FAMILY) \
E2E_NETWORK_MODE=$(E2E_NETWORK_MODE) \
ginkgo -p --randomize-all --focus=CNI:Kube-OVN ./test/e2e/security/security.test
ginkgo $(GINKGO_PARALLEL_OPT) nproc --randomize-all --progress \
--focus=CNI:Kube-OVN ./test/e2e/security/security.test

0 comments on commit ea6ddd7

Please sign in to comment.