diff mbox series

[08/15] report: sort properties by name

Message ID 167884159597.2482843.3047170173182476876.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series fstests: improve junit xml reporting | expand

Commit Message

Darrick J. Wong March 15, 2023, 12:53 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

When we're generating a junit xml report, always sort the properties by
name.  This makes it easier for humans to find a particular property.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/report |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/common/report b/common/report
index 2e5959312a..3ec2d88178 100644
--- a/common/report
+++ b/common/report
@@ -32,7 +32,7 @@  _xunit_add_property()
 	local value="${!name}"
 
 	if [ ! -z "$value" ]; then
-		echo -e "\t\t<property name=\"$name\" value=\"$value\"/>" >> $REPORT_DIR/result.xml
+		echo -e "\t\t<property name=\"$name\" value=\"$value\"/>"
 	fi
 }
 _xunit_make_section_report()
@@ -77,7 +77,7 @@  ENDL
 	echo -e "\t<properties>" >> $REPORT_DIR/result.xml
 	for p in "${REPORT_ENV_LIST[@]}"; do
 		_xunit_add_property "$p"
-	done
+	done | sort >> $REPORT_DIR/result.xml
 	echo -e "\t</properties>" >> $REPORT_DIR/result.xml
 	if [ -f $report ]; then
 		cat $report >> $REPORT_DIR/result.xml