Skip to content

Commit b4e692b

Browse files
authored
Merge pull request kubernetes#74854 from neolit123/conformance-nodes
conformace/run_e2e.sh: pass shellcheck and autodetect ginkgo nodes
2 parents 0a4308f + fe2301f commit b4e692b

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

cluster/images/conformance/conformance-e2e.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ spec:
6363
- name: E2E_SKIP
6464
value: ""
6565
- name: E2E_PROVIDER
66-
value: "local"
66+
value: "skeleton"
6767
- name: E2E_PARALLEL
68-
value: "1"
68+
value: "false"
6969
volumeMounts:
7070
- name: output-volume
7171
mountPath: /tmp/results

cluster/images/conformance/run_e2e.sh

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ shutdown () {
2525

2626
# Kind of a hack to wait for this pid to finish.
2727
# Since it's not a child of this shell we cannot use wait.
28-
tail --pid ${E2E_SUITE_PID} -f /dev/null
28+
tail --pid "${E2E_SUITE_PID}" -f /dev/null
2929
saveResults
3030
}
3131

@@ -39,23 +39,28 @@ saveResults() {
3939
# We get the TERM from kubernetes and handle it gracefully
4040
trap shutdown TERM
4141

42-
ginkgo_args=(
43-
"--focus=${E2E_FOCUS}"
44-
"--skip=${E2E_SKIP}"
45-
"--noColor=true"
46-
)
47-
42+
ginkgo_args=()
4843
if [[ -n ${E2E_DRYRUN:-} ]]; then
4944
ginkgo_args+=("--dryRun=true")
5045
fi
5146

5247
case ${E2E_PARALLEL} in
53-
'y'|'Y') ginkgo_args+=("--nodes=25") ;;
54-
[1-9]|[1-9][0-9]*) ginkgo_args+=("--nodes=${E2E_PARALLEL}") ;;
48+
'y'|'Y'|'true')
49+
# The flag '--p' will automatically detect the optimal number of ginkgo nodes.
50+
ginkgo_args+=("--p")
51+
# Skip serial tests if parallel mode is enabled.
52+
E2E_SKIP="\\[Serial\\]|${E2E_SKIP}" ;;
5553
esac
5654

57-
echo "/usr/local/bin/ginkgo ${ginkgo_args[@]} /usr/local/bin/e2e.test -- --disable-log-dump --repo-root=/kubernetes --provider=\"${E2E_PROVIDER}\" --report-dir=\"${RESULTS_DIR}\" --kubeconfig=\"${KUBECONFIG}\""
58-
/usr/local/bin/ginkgo "${ginkgo_args[@]}" /usr/local/bin/e2e.test -- --disable-log-dump --repo-root=/kubernetes --provider="${E2E_PROVIDER}" --report-dir="${RESULTS_DIR}" --kubeconfig="${KUBECONFIG}" | tee ${RESULTS_DIR}/e2e.log &
55+
ginkgo_args+=(
56+
"--focus=${E2E_FOCUS}"
57+
"--skip=${E2E_SKIP}"
58+
"--noColor=true"
59+
)
60+
61+
set -x
62+
/usr/local/bin/ginkgo "${ginkgo_args[@]}" /usr/local/bin/e2e.test -- --disable-log-dump --repo-root=/kubernetes --provider="${E2E_PROVIDER}" --report-dir="${RESULTS_DIR}" --kubeconfig="${KUBECONFIG}" | tee "${RESULTS_DIR}"/e2e.log &
63+
set +x
5964
# $! is the pid of tee, not ginkgo
60-
wait $(pgrep ginkgo)
65+
wait "$(pgrep ginkgo)"
6166
saveResults

hack/.shellcheck_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
./cluster/gce/upgrade-aliases.sh
1818
./cluster/gce/upgrade.sh
1919
./cluster/gce/util.sh
20-
./cluster/images/conformance/run_e2e.sh
2120
./cluster/log-dump/log-dump.sh
2221
./cluster/pre-existing/util.sh
2322
./cluster/restore-from-backup.sh

0 commit comments

Comments
 (0)