Skip to content

Commit 38e1146

Browse files
committed
prow.sh: publish individual JUnit files as separate artifacts
"junit/steps/junit_*.xml" contains the summary JUnit file of each step (sanity, make_test, etc.). The original files as written by the e2e.test binary are under "junit/<name>" where name is "parallel", "serial", etc. This makes it possible to look up information that might get lost during the transformation with filter-junit.go and debug that command.
1 parent 78c0fb7 commit 38e1146

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Diff for: prow.sh

+10-5
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,10 @@ run_e2e () (
10081008
# the full Kubernetes E2E testsuite while only running a few tests.
10091009
move_junit () {
10101010
if ls "${ARTIFACTS}"/junit_[0-9]*.xml 2>/dev/null >/dev/null; then
1011-
run_filter_junit -t="External.Storage|CSI.mock.volume" -o "${ARTIFACTS}/junit_${name}.xml" "${ARTIFACTS}"/junit_[0-9]*.xml && rm -f "${ARTIFACTS}"/junit_[0-9]*.xml
1011+
mkdir -p "${ARTIFACTS}/junit/${name}" &&
1012+
mkdir -p "${ARTIFACTS}/junit/steps" &&
1013+
run_filter_junit -t="External.Storage|CSI.mock.volume" -o "${ARTIFACTS}/junit/steps/junit_${name}.xml" "${ARTIFACTS}"/junit_[0-9]*.xml &&
1014+
mv "${ARTIFACTS}"/junit_[0-9]*.xml "${ARTIFACTS}/junit/${name}/"
10121015
fi
10131016
}
10141017
trap move_junit EXIT
@@ -1085,13 +1088,14 @@ kubectl exec "$pod" -c "${CSI_PROW_SANITY_CONTAINER}" -- /bin/sh -c "\${CHECK_PA
10851088
EOF
10861089
10871090
chmod u+x "${CSI_PROW_WORK}"/*dir_in_pod.sh
1091+
mkdir -p "${ARTIFACTS}/junit/steps"
10881092
10891093
# This cannot run in parallel, because -csi.junitfile output
10901094
# from different Ginkgo nodes would go to the same file. Also the
10911095
# staging and target directories are the same.
10921096
run_with_loggers "${CSI_PROW_WORK}/csi-sanity" \
10931097
-ginkgo.v \
1094-
-csi.junitfile "${ARTIFACTS}/junit_sanity.xml" \
1098+
-csi.junitfile "${ARTIFACTS}/junit/steps/junit_sanity.xml" \
10951099
-csi.endpoint "dns:///$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' csi-prow-control-plane):$(kubectl get "services/${CSI_PROW_SANITY_SERVICE}" -o "jsonpath={..nodePort}")" \
10961100
-csi.stagingdir "/tmp/staging" \
10971101
-csi.mountdir "/tmp/mount" \
@@ -1121,7 +1125,8 @@ make_test_to_junit () {
11211125
# Plain make-test.xml was not delivered as text/xml by the web
11221126
# server and ignored by spyglass. It seems that the name has to
11231127
# match junit*.xml.
1124-
out="${ARTIFACTS}/junit_make_test.xml"
1128+
out="${ARTIFACTS}/junit/steps/junit_make_test.xml"
1129+
mkdir -p "$(dirname "$out")"
11251130
testname=
11261131
echo "<testsuite>" >>"$out"
11271132
@@ -1385,8 +1390,8 @@ main () {
13851390
fi
13861391
13871392
# Merge all junit files into one. This gets rid of duplicated "skipped" tests.
1388-
if ls "${ARTIFACTS}"/junit_*.xml 2>/dev/null >&2; then
1389-
run_filter_junit -o "${CSI_PROW_WORK}/junit_final.xml" "${ARTIFACTS}"/junit_*.xml && rm "${ARTIFACTS}"/junit_*.xml && mv "${CSI_PROW_WORK}/junit_final.xml" "${ARTIFACTS}"
1393+
if ls "${ARTIFACTS}"/junit/steps/junit_*.xml 2>/dev/null >&2; then
1394+
run_filter_junit -o "${ARTIFACTS}/junit_final.xml" "${ARTIFACTS}"/junit/steps/junit_*.xml
13901395
fi
13911396
13921397
return "$ret"

0 commit comments

Comments
 (0)