Skip to content

Commit

Permalink
e2e: double parallel test nodes in ci (#2411)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Mar 2, 2023
1 parent fd3bee6 commit 83ab70f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build-x86-image.yaml
Expand Up @@ -267,7 +267,7 @@ jobs:
- build-kube-ovn
- build-e2e-binaries
runs-on: ubuntu-22.04
timeout-minutes: 60
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -627,7 +627,7 @@ jobs:
- build-kube-ovn
- build-e2e-binaries
runs-on: ubuntu-22.04
timeout-minutes: 30
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -719,7 +719,7 @@ jobs:
- build-kube-ovn
- build-e2e-binaries
runs-on: ubuntu-22.04
timeout-minutes: 30
timeout-minutes: 15
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -947,7 +947,7 @@ jobs:
- build-vpc-nat-gateway
- build-e2e-binaries
runs-on: ubuntu-22.04
timeout-minutes: 30
timeout-minutes: 10
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -1161,7 +1161,7 @@ jobs:
- build-kube-ovn
- build-e2e-binaries
runs-on: ubuntu-22.04
timeout-minutes: 30
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
Expand Down
28 changes: 20 additions & 8 deletions Makefile.e2e
Expand Up @@ -8,6 +8,8 @@ K8S_NETPOL_E2E_FOCUS = "sig-network.*Feature:NetworkPolicy"
K8S_NETPOL_E2E_SKIP = "sig-network.*NetworkPolicyLegacy"
K8S_NETPOL_LEGACY_E2E_FOCUS = "sig-network.*NetworkPolicyLegacy"

GINKGO_PARALLEL_MULTIPLIER = $(shell echo $${GINKGO_PARALLEL_MULTIPLIER:-2})

ifeq ($(shell echo $(E2E_BRANCH) | grep -o ^release-),release-)
VERSION_NUM = $(subst release-,,$(E2E_BRANCH))
VER_MAJOR = $(shell echo $(VERSION_NUM) | cut -f1 -d.)
Expand All @@ -32,6 +34,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) * $(GINKGO_PARALLEL_MULTIPLIER)))
endif

define ginkgo_option
--$(1)=$(shell echo '$(2)' | sed -E 's/^[[:space:]]+//' | sed -E 's/"[[:space:]]+"/" --$(1)="/g')
endef
Expand All @@ -51,22 +58,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 --always-emit-ginkgo-writer --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 -p --randomize-all --always-emit-ginkgo-writer --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 -p --randomize-all --always-emit-ginkgo-writer --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 +98,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 --always-emit-ginkgo-writer \
--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 --always-emit-ginkgo-writer \
--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 --always-emit-ginkgo-writer \
--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 --always-emit-ginkgo-writer \
--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) --randomize-all --always-emit-ginkgo-writer \
--focus=CNI:Kube-OVN ./test/e2e/security/security.test

0 comments on commit 83ab70f

Please sign in to comment.