github.com/ouraigua/jenkins-library@v0.0.0-20231028010029-fbeaf2f3aa9b/documentation/docs/steps/testsPublishResults.md (about) 1 # ${docGenStepName} 2 3 ## ${docGenDescription} 4 5 ## Prerequisites 6 7 * **test result files** - To use this step, there must be test result files available. 8 * installed plugins: 9 * [junit](https://plugins.jenkins.io/junit) 10 * [jacoco](https://plugins.jenkins.io/jacoco) 11 * [cobertura](https://plugins.jenkins.io/cobertura) 12 * [performance](https://plugins.jenkins.io/performance) 13 14 ## Pipeline configuration 15 16 none 17 18 ## Explanation of pipeline step 19 20 Usage of pipeline step: 21 22 ```groovy 23 testsPublishResults( 24 junit: [updateResults: true, archive: true], 25 jacoco: [archive: true] 26 ) 27 ``` 28 29 ## ${docGenParameters} 30 31 ### junit 32 33 | parameter | mandatory | default | possible values | 34 | ----------|-----------|---------|-----------------| 35 | pattern | no | `'**/TEST-*.xml'` | | 36 | archive | no | `false` | true, false | 37 | updateResults | no | `false` | true, false | 38 | allowEmptyResults | no | `true` | true, false | 39 40 ### jacoco 41 42 | parameter | mandatory | default | possible values | 43 | ----------|-----------|---------|-----------------| 44 | pattern | no | `'**/target/*.exec'` | | 45 | include | no | `''` | `'**/*.class'` | 46 | exclude | no | `''` | `'**/Test*'` | 47 | archive | no | `false` | true, false | 48 | allowEmptyResults | no | `true` | true, false | 49 50 ### cobertura 51 52 | parameter | mandatory | default | possible values | 53 | ----------|-----------|---------|-----------------| 54 | pattern | no | `'**/target/coverage/cobertura-coverage.xml'` | | 55 | archive | no | `false` | true, false | 56 | allowEmptyResults | no | `true` | true, false | 57 | onlyStableBuilds | no | `true` | true, false | 58 59 ### jmeter 60 61 | parameter | mandatory | default | possible values | 62 | ----------|-----------|--------------|-----------------| 63 | pattern | no | `'**/*.jtl'` | | 64 | errorFailedThreshold | no | `20` | | 65 | errorUnstableThreshold | no | `10` | | 66 | errorUnstableResponseTimeThreshold | no | `` | | 67 | relativeFailedThresholdPositive | no | `0` | | 68 | relativeFailedThresholdNegative | no | `0` | | 69 | relativeUnstableThresholdPositive | no | `0` | | 70 | relativeUnstableThresholdNegative | no | `0` | | 71 | modeOfThreshold | no | `false` | true, false | 72 | modeThroughput | no | `false` | true, false | 73 | nthBuildNumber | no | `0` | | 74 | configType | no | `PRT` | | 75 | failBuildIfNoResultFile | no | `false` | true, false | 76 | compareBuildPrevious | no | `true` | true, false | 77 | archive | no | `false` | true, false | 78 | allowEmptyResults | no | `true` | true, false | 79 | filterRegex | no | ' ' | | 80 81 ## ${docGenConfiguration} 82 83 ## ${docJenkinsPluginDependencies} 84 85 ## Side effects 86 87 none 88 89 ## Exceptions 90 91 none 92 93 ## Example 94 95 ```groovy 96 // publish test results with coverage 97 testsPublishResults( 98 junit: [updateResults: true, archive: true], 99 jacoco: [archive: true] 100 ) 101 ``` 102 103 ```groovy 104 // publish test results with coverage 105 testsPublishResults( 106 junit: [pattern: '**/target/TEST*.xml', archive: true], 107 cobertura: [pattern: '**/target/coverage/cobertura-coverage.xml'] 108 ) 109 ```