mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 00:07:50 +00:00
Merge pull request #47099 from mengqiy/add_junit_for_cmd_tests
Automatic merge from submit-queue (batch tested with PRs 47204, 46808, 47432, 47400, 47099) support junit in test-cmd Output junit result for cmd tests. Fixes #45196 There will be a followup PR to refactor the cmd test into functions as test cases there is not a lot changes in `hack/make-rules/test-cmd-util.sh` ```release-note NONE ```
This commit is contained in:
commit
304106f0f7
File diff suppressed because it is too large
Load Diff
11
third_party/forked/shell2junit/sh2ju.sh
vendored
11
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,18 +155,24 @@ $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
|
||||||
|
|
||||||
|
return $err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user