Mesa (master): gitlab-ci/deqp: generate xml results for fails/flakes

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 22 22:06:40 UTC 2019


Module: Mesa
Branch: master
Commit: 415d565d96278d81255bf85eefdb2553e15e15c6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=415d565d96278d81255bf85eefdb2553e15e15c6

Author: Rob Clark <robdclark at chromium.org>
Date:   Sun Nov 17 11:57:26 2019 -0800

gitlab-ci/deqp: generate xml results for fails/flakes

Extract .qpa for the individual unexpected results and flakes, and
translate to xml, preserved with the artifacts.  This allows easy
browsing of the test logs for fails/flakes, for easier debugging.

The # of logs to preserve is capped at 50 to avoid saving 100s of
megabytes of logs in case someone pushes a change that breaks
everything.

Signed-off-by: Rob Clark <robdclark at chromium.org>
Acked-by: Eric Engestrom <eric.engestrom at intel.com>

---

 .gitlab-ci/deqp-runner.sh | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/.gitlab-ci/deqp-runner.sh b/.gitlab-ci/deqp-runner.sh
index b651570cf1c..044ff5981ad 100755
--- a/.gitlab-ci/deqp-runner.sh
+++ b/.gitlab-ci/deqp-runner.sh
@@ -99,6 +99,43 @@ report_flakes() {
 
 }
 
+extract_xml_result() {
+    testcase=$1
+    shift 1
+    qpas=$*
+    start="#beginTestCaseResult $testcase"
+    for qpa in $qpas; do
+        while IFS= read -r line; do
+            if [ "$line" = "$start" ]; then
+                dst="$testcase.qpa"
+                echo "#beginSession" > $dst
+                echo $line >> $dst
+                while IFS= read -r line; do
+                    if [ "$line" = "#endTestCaseResult" ]; then
+                        echo $line >> $dst
+                        echo "#endSession" >> $dst
+                        /deqp/executor/testlog-to-xml $dst "$RESULTS/$testcase.xml"
+                        # copy the stylesheets here so they only end up in artifacts
+                        # if we have one or more result xml in artifacts
+                        cp /deqp/testlog.{css,xsl} "$RESULTS/"
+                        return 0
+                    fi
+                    echo $line >> $dst
+                done
+                return 1
+            fi
+        done < $qpa
+    done
+}
+
+extract_xml_results() {
+    qpas=$*
+    while IFS= read -r testcase; do
+        testcase=${testcase%,*}
+        extract_xml_result $testcase $qpas
+    done
+}
+
 # wrapper to supress +x to avoid spamming the log
 quiet() {
     set +x
@@ -120,6 +157,9 @@ if [ $DEQP_EXITCODE -ne 0 ]; then
         $RESULTS/cts-runner-unexpected-results.txt
     head -n 50 $RESULTS/cts-runner-unexpected-results.txt
 
+    # Save the logs for up to the first 50 unexpected results:
+    head -n 50 $RESULTS/cts-runner-unexpected-results.txt | quiet extract_xml_results /tmp/*.qpa
+
     count=`cat $RESULTS/cts-runner-unexpected-results.txt | wc -l`
 
     # Re-run fails to detect flakes.  But use a small threshold, if




More information about the mesa-commit mailing list