summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-03-14 17:52:42 -0700
committerZorro Lang <zlang@kernel.org>2023-03-26 22:00:20 +0800
commitb76a6cdb40b5091537cefcccd9165e3a88631eab (patch)
tree779c4556ed3783e45aeb43194ee6c37692b308dc /common
parentec13788638b36d64287407ad97a85a102fe0071c (diff)
report: derive an xml schema for the xunit report
The "xunit" report format emits an XML document that more or less follows the junit xml schema. However, there are two major exceptions: 1. fstests does not emit an @errors attribute on the testsuite element because we don't have the concept of unanticipated errors such as "unchecked throwables". 2. The system-out/system-err elements sound like they belong under the testcase element, though the schema itself imprecisely says "while the test was executed". The schema puts them under the top-level testsuite element, but we put them under the testcase element. Define an xml schema for the xunit report format, and update the xml headers to link to the schema file. This enables consumers of the reports to check mechanically that the incoming document follows the format. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'common')
-rw-r--r--common/report15
1 files changed, 12 insertions, 3 deletions
diff --git a/common/report b/common/report
index 64f9c866..1d846502 100644
--- a/common/report
+++ b/common/report
@@ -48,9 +48,18 @@ _xunit_make_section_report()
if [ -z "$date_time" ]; then
date_time=$(date +"%F %T")
fi
- local stats="failures=\"$bad_count\" skipped=\"$notrun_count\" tests=\"$tests_count\" time=\"$sect_time\""
- local hw_info="hostname=\"$HOST\" timestamp=\"${date_time/ /T}\" "
- echo "<testsuite name=\"xfstests\" $stats $hw_info >" >> $REPORT_DIR/result.xml
+
+ local fstests_ns="https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git"
+ cat >> $REPORT_DIR/result.xml << ENDL
+<testsuite
+ xmlns="$fstests_ns"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="$fstests_ns $fstests_ns/tree/doc/xunit.xsd"
+
+ name="xfstests"
+ failures="$bad_count" skipped="$notrun_count" tests="$tests_count" time="$sect_time"
+ hostname="$HOST" timestamp="${date_time/ /T}">
+ENDL
# Properties
echo -e "\t<properties>" >> $REPORT_DIR/result.xml