簡體   English   中英

帶有故障安全報告的Jenkinsfile

[英]Jenkinsfile with failsafe reports

我有一個jenkinsfile生成maven surefire報告,還使用故障安全進行集成測試。

我可以從surefire存檔測試庫,並通過Jenkins中的鏈接查看它們,我也想為故障保護做同樣的事情。 故障安全插件根本不生成報告,更不用說通過Jenkins使其可用。

我怎么做? 這是我的jenkinsfile:

node {
   stage 'Checkout'
   git credentialsId: 'mike', url: 'mike@lhost:/repo'
   def mvnHome = tool 'M3'

   stage 'Build'
   sh "${mvnHome}/bin/mvn clean package verify"
   step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])

   stage 'SonarQube'
   sh "${mvnHome}/bin/mvn -Dsonar.host.url=http://192.168.3.70:9000 sonar:sonar"

}

這是failureave的POM:

       <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.13</version>
            <executions>
                <execution>
                    <id>integration-test</id>
                    <goals>
                        <goal>integration-test</goal>
                    </goals>
                </execution>
                <execution>
                    <id>verify</id>
                    <goals>
                        <goal>verify</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

同樣,我看到測試可以運行並通過,但是我看不到報告或如何使Jenkins存檔並顯示它們。

您只包括來自surefire的報告:

step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])

也許這會有所幫助:

step([$class: 'JUnitResultArchiver', testResults: '**/target/failsafe-reports/TEST-*.xml'])

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM