Skip to content

Commit 42c4ddb

Browse files
authored
Merge pull request kubernetes#129701 from pohly/test-shell-output
tests: include stdout of failed commands in JUnit
2 parents 71dc1e9 + 03a3288 commit 42c4ddb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

third_party/forked/shell2junit/sh2ju.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
### -ierror="RegExp" : same as -error but case insensitive
2121
### -fail="RegExp" : Any line from stderr which contains this pattern becomes part of
2222
### the failure messsage, without the text matching that pattern.
23-
### Example: -failure="^ERROR: "
23+
### Example: -fail="^ERROR: "
2424
### Default is to use the entire stderr as failure message.
2525
### -output="Path" : path to output directory, defaults to "./results"
2626
### - Junit reports are left in the folder 'result' under the directory where the script is executed.
@@ -129,6 +129,7 @@ function juLog() {
129129
[[ -n "${H}" ]] && err=1
130130
fi
131131
[[ ${err} -ne 0 ]] && echo "+++ error: ${err}" | tee -a ${outf}
132+
outMsg=$(cat ${outf})
132133
rm -f ${outf}
133134

134135
errMsg=$(cat ${errf})
@@ -163,6 +164,7 @@ ${failureMsg}
163164
<testcase assertions=\"1\" name=\"${name}\" time=\"${time}\" classname=\"${class}\">
164165
${failure}
165166
<system-err><![CDATA[${errMsg}]]></system-err>
167+
<system-out><![CDATA[${outMsg}]]></system-out>
166168
</testcase>
167169
"
168170
## testsuite block

0 commit comments

Comments
 (0)