Skip to content

Commit

Permalink
prow.sh: publish individual JUnit files as separate artifacts
Browse files Browse the repository at this point in the history
"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.
  • Loading branch information
pohly committed Dec 17, 2022
1 parent 78c0fb7 commit 38e1146
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions prow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,10 @@ run_e2e () (
# the full Kubernetes E2E testsuite while only running a few tests.
move_junit () {
if ls "${ARTIFACTS}"/junit_[0-9]*.xml 2>/dev/null >/dev/null; then
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
mkdir -p "${ARTIFACTS}/junit/${name}" &&
mkdir -p "${ARTIFACTS}/junit/steps" &&
run_filter_junit -t="External.Storage|CSI.mock.volume" -o "${ARTIFACTS}/junit/steps/junit_${name}.xml" "${ARTIFACTS}"/junit_[0-9]*.xml &&
mv "${ARTIFACTS}"/junit_[0-9]*.xml "${ARTIFACTS}/junit/${name}/"
fi
}
trap move_junit EXIT
Expand Down Expand Up @@ -1085,13 +1088,14 @@ kubectl exec "$pod" -c "${CSI_PROW_SANITY_CONTAINER}" -- /bin/sh -c "\${CHECK_PA
EOF
chmod u+x "${CSI_PROW_WORK}"/*dir_in_pod.sh
mkdir -p "${ARTIFACTS}/junit/steps"
# This cannot run in parallel, because -csi.junitfile output
# from different Ginkgo nodes would go to the same file. Also the
# staging and target directories are the same.
run_with_loggers "${CSI_PROW_WORK}/csi-sanity" \
-ginkgo.v \
-csi.junitfile "${ARTIFACTS}/junit_sanity.xml" \
-csi.junitfile "${ARTIFACTS}/junit/steps/junit_sanity.xml" \
-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}")" \
-csi.stagingdir "/tmp/staging" \
-csi.mountdir "/tmp/mount" \
Expand Down Expand Up @@ -1121,7 +1125,8 @@ make_test_to_junit () {
# Plain make-test.xml was not delivered as text/xml by the web
# server and ignored by spyglass. It seems that the name has to
# match junit*.xml.
out="${ARTIFACTS}/junit_make_test.xml"
out="${ARTIFACTS}/junit/steps/junit_make_test.xml"
mkdir -p "$(dirname "$out")"
testname=
echo "<testsuite>" >>"$out"
Expand Down Expand Up @@ -1385,8 +1390,8 @@ main () {
fi
# Merge all junit files into one. This gets rid of duplicated "skipped" tests.
if ls "${ARTIFACTS}"/junit_*.xml 2>/dev/null >&2; then
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}"
if ls "${ARTIFACTS}"/junit/steps/junit_*.xml 2>/dev/null >&2; then
run_filter_junit -o "${ARTIFACTS}/junit_final.xml" "${ARTIFACTS}"/junit/steps/junit_*.xml
fi
return "$ret"
Expand Down

0 comments on commit 38e1146

Please sign in to comment.