]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
report: sort properties by name
authorDarrick J. Wong <djwong@kernel.org>
Wed, 15 Mar 2023 00:53:15 +0000 (17:53 -0700)
committerZorro Lang <zlang@kernel.org>
Sun, 26 Mar 2023 14:05:51 +0000 (22:05 +0800)
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>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/report

index 2e5959312a6674ed64073e7bd5d4d92a12972bb5..3ec2d881784661731120135780c282a2ff6278e5 100644 (file)
@@ -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