mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
change junit output format
This commit is contained in:
parent
1480f6c368
commit
590ea991a5
10
third_party/forked/shell2junit/sh2ju.sh
vendored
10
third_party/forked/shell2junit/sh2ju.sh
vendored
@ -137,11 +137,6 @@ function juLog() {
|
|||||||
content="$content
|
content="$content
|
||||||
<testcase assertions=\"1\" name=\"$name\" time=\"$time\" classname=\"$class\">
|
<testcase assertions=\"1\" name=\"$name\" time=\"$time\" classname=\"$class\">
|
||||||
$failure
|
$failure
|
||||||
<system-out>
|
|
||||||
<![CDATA[
|
|
||||||
$out
|
|
||||||
]]>
|
|
||||||
</system-out>
|
|
||||||
<system-err>
|
<system-err>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
$errMsg
|
$errMsg
|
||||||
@ -160,17 +155,22 @@ $errMsg
|
|||||||
|
|
||||||
# file exists. Need to append to it. If we remove the testsuite end tag, we can just add it in after.
|
# file exists. Need to append to it. If we remove the testsuite end tag, we can just add it in after.
|
||||||
sed -i "s^</testsuite>^^g" $juDIR/junit-$suite.xml ## remove testSuite so we can add it later
|
sed -i "s^</testsuite>^^g" $juDIR/junit-$suite.xml ## remove testSuite so we can add it later
|
||||||
|
sed -i "s^</testsuites>^^g" $juDIR/junit-$suite.xml
|
||||||
cat <<EOF >> "$juDIR/junit-$suite.xml"
|
cat <<EOF >> "$juDIR/junit-$suite.xml"
|
||||||
$content
|
$content
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
else
|
else
|
||||||
# no file exists. Adding a new file
|
# no file exists. Adding a new file
|
||||||
cat <<EOF > "$juDIR/junit-$suite.xml"
|
cat <<EOF > "$juDIR/junit-$suite.xml"
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<testsuites>
|
||||||
<testsuite failures="$errors" assertions="$assertions" name="$suite" tests="1" errors="$errors" time="$total">
|
<testsuite failures="$errors" assertions="$assertions" name="$suite" tests="1" errors="$errors" time="$total">
|
||||||
$content
|
$content
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user