Commit 5c1eb058 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau Committed by Ben Cooksley

Match test not run due to executable not found to jenkins <failure>.

This will ensure that should test executables not be found, we will flag them as failures for further investigation rather than silently ignoring them.

Differential Revision: https://phabricator.kde.org/D20874
parent c7fbf390
Pipeline #2883 skipped with stage
...@@ -60,21 +60,28 @@ THE SOFTWARE. ...@@ -60,21 +60,28 @@ THE SOFTWARE.
<xsl:variable name="numberOfTests" select="count(//Site/Testing/Test)"/> <xsl:variable name="numberOfTests" select="count(//Site/Testing/Test)"/>
<xsl:variable name="numberOfFailures" select="count(//Site/Testing/Test[@Status='failed'])"/> <xsl:variable name="numberOfFailures" select="count(//Site/Testing/Test[@Status='failed'])"/>
<xsl:variable name="numberOfSkipped" select="count(//Site/Testing/Test[@Status='notrun'])"/> <xsl:variable name="numberOfSkipped" select="count(//Site/Testing/Test[@Status='notrun'])"/>
<xsl:variable name="numberOfSkippedDueNotFound" select="count(//Site/Testing/Test[@Status='notrun']/Results/NamedMeasurement[@name='Completion Status'][Value='Unable to find executable'])"/>
<testsuite name="CTest" <testsuite name="CTest"
tests="{$numberOfTests}" tests="{$numberOfTests}"
failures="{$numberOfFailures}" failures="{$numberOfFailures + $numberOfSkippedDueNotFound}"
errors="0" errors="0"
skipped="{$numberOfSkipped}"> skipped="{$numberOfSkipped - $numberOfSkippedDueNotFound}">
<xsl:for-each select="//Site/Testing/Test"> <xsl:for-each select="//Site/Testing/Test">
<xsl:variable name="testName" select="translate(Name, '-', '_')"/> <xsl:variable name="testName" select="translate(Name, '-', '_')"/>
<xsl:variable name="duration" select="Results/NamedMeasurement[@name='Execution Time']/Value"/> <xsl:variable name="duration" select="Results/NamedMeasurement[@name='Execution Time']/Value"/>
<xsl:variable name="status" select="@Status"/> <xsl:variable name="status" select="@Status"/>
<xsl:variable name="completionStatus" select="Results/NamedMeasurement[@name='Completion Status']/Value"/>
<xsl:variable name="output" select="Results/Measurement/Value"/> <xsl:variable name="output" select="Results/Measurement/Value"/>
<xsl:variable name="className" select="translate(Path, '/.', '.')"/> <xsl:variable name="className" select="translate(Path, '/.', '.')"/>
<testcase classname="projectroot{$className}" <testcase classname="projectroot{$className}"
name="{$testName}"> name="{$testName}">
<xsl:choose> <xsl:choose>
<xsl:when test="@Status='passed'"/> <xsl:when test="@Status='passed'"/>
<xsl:when test="@Status='notrun' and $completionStatus='Unable to find executable'">
<failure>
<xsl:value-of select="$output"/>
</failure>
</xsl:when>
<xsl:when test="@Status='notrun'"> <xsl:when test="@Status='notrun'">
<skipped/> <skipped/>
</xsl:when> </xsl:when>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment