Skip to content

Commit

Permalink
DOC-163. Making travis happy - add check if tests are enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
valb3r committed Jun 11, 2019
1 parent 1f30072 commit 4aabd46
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
19 changes: 4 additions & 15 deletions last-module-codecoverage-check/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,6 @@

<build>
<plugins>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>${xml-maven-plugin.version}</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>transform</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
Expand Down Expand Up @@ -178,6 +163,10 @@
</includes>
<stylesheet>src/main/xsl/analyse.jacoco.result.xsl</stylesheet>
<parameters>
<parameter>
<name>testsEnabled</name>
<value>${skipTests}</value>
</parameter>
<parameter>
<name>lowerlimit</name>
<value>85</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@


<xsl:output method="text" version="1.0" encoding="UTF-8"/>
<xsl:param name="enabled" select="skipTests"/>
<xsl:param name="lowerlimit" select="lowerlimit"/>
<xsl:param name="outputdir" select="outputdir"/>
<xsl:param name="type">LINE</xsl:param>
Expand All @@ -29,38 +30,48 @@
sum covered: <xsl:value-of select="$sumcovered"/>
totallines: <xsl:value-of select="$totallines"/>
quote: <xsl:value-of select="$quote"/>
enabled: <xsl:value-of select="$enabled"/>


</xsl:message>

<xsl:if test=" $quote &lt; $lowerlimit">
<xsl:result-document href="{$outputdir}/XSL-ERROR.txt" method="text">
The total code coverate quote is <xsl:value-of select="$quote"/> % and thus below the expected minimum of <xsl:value-of select="$lowerlimit"/> %
</xsl:result-document>
<xsl:message terminate="yes">
[ERROR] ======================================================================================
[ERROR] The total code coverate quote is <xsl:value-of select="$quote"/> % and thus below the expected minimum of <xsl:value-of select="$lowerlimit"/> %
[ERROR] ======================================================================================
<xsl:if test="$enabled = false()">
<xsl:message terminate="no">
[INFO] ======================================================================================
[INFO] Coverage check is disabled by system property.
[INFO] ======================================================================================
</xsl:message>
</xsl:if>
<xsl:if test=" string($quote) = 'NaN' ">
<xsl:result-document href="{$outputdir}/XSL-ERROR.txt" method="text">
Stylesheet did not calculate a quote. Propably jacoco did not run or did not create a jacoco.xml
<xsl:if test="$enabled = true()">
<xsl:if test="quote &lt; $lowerlimit">
<xsl:result-document href="{$outputdir}/XSL-ERROR.txt" method="text">
The total code coverate quote is <xsl:value-of select="$quote"/> % and thus below the expected minimum of <xsl:value-of select="$lowerlimit"/> %
</xsl:result-document>
<xsl:message terminate="yes">
[ERROR] ======================================================================================
[ERROR] The total code coverate quote is <xsl:value-of select="$quote"/> % and thus below the expected minimum of <xsl:value-of select="$lowerlimit"/> %
[ERROR] ======================================================================================
</xsl:message>
</xsl:if>
<xsl:if test="string($quote) = 'NaN' ">
<xsl:result-document href="{$outputdir}/XSL-ERROR.txt" method="text">
Stylesheet did not calculate a quote. Propably jacoco did not run or did not create a jacoco.xml
</xsl:result-document>
<xsl:message terminate="yes">
[ERROR] ======================================================================================
[ERROR] Stylesheet did not calculate a quote. Propably jacoco did not run or did not create a jacoco.xml
[ERROR] ======================================================================================
</xsl:message>
</xsl:if>
<xsl:result-document href="{$outputdir}/XSL-EVALUATION-RESULT.txt" method="text">
The total code coverate quote is <xsl:value-of select="$quote"/> % and thus above the expected minimum of <xsl:value-of select="$lowerlimit"/> %
</xsl:result-document>
<xsl:message terminate="yes">
[ERROR] ======================================================================================
[ERROR] Stylesheet did not calculate a quote. Propably jacoco did not run or did not create a jacoco.xml
[ERROR] ======================================================================================
<xsl:message terminate="no">
[INFO] ======================================================================================
[INFO]The total code coverage quote is <xsl:value-of select="$quote"/> % and thus above the expected minimum of <xsl:value-of select="$lowerlimit"/> %
[INFO] ======================================================================================
</xsl:message>
</xsl:if>
<xsl:result-document href="{$outputdir}/XSL-EVALUATION-RESULT.txt" method="text">
The total code coverate quote is <xsl:value-of select="$quote"/> % and thus above the expected minimum of <xsl:value-of select="$lowerlimit"/> %
</xsl:result-document>
<xsl:message terminate="no">
[INFO] ======================================================================================
[INFO]The total code coverate quote is <xsl:value-of select="$quote"/> % and thus above the expected minimum of <xsl:value-of select="$lowerlimit"/> %
[INFO] ======================================================================================
</xsl:message>
</xsl:template>

<xsl:template match="group">
Expand Down

0 comments on commit 4aabd46

Please sign in to comment.