Skip to content

Commit b66c082

Browse files
authored
Merge pull request #214 from pohly/junit-fixes
JUnit fixes
2 parents 78c0fb7 + b9b6763 commit b66c082

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

Diff for: filter-junit.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ type TestCase struct {
5656
Name string `xml:"name,attr"`
5757
Time string `xml:"time,attr"`
5858
SystemOut string `xml:"system-out,omitempty"`
59+
SystemErr string `xml:"system-err,omitempty"`
5960
Failure string `xml:"failure,omitempty"`
6061
Skipped SkipReason `xml:"skipped,omitempty"`
6162
}
@@ -109,7 +110,7 @@ func main() {
109110
if err := xml.Unmarshal(data, &junitv2); err != nil {
110111
panic(err)
111112
}
112-
junit = junitv2.TestSuite
113+
junit.TestCases = append(junit.TestCases, junitv2.TestSuite.TestCases...)
113114
}
114115
}
115116

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)