github.com/xgoffin/jenkins-library@v1.154.0/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  
    80  ## ${docGenConfiguration}
    81  
    82  ## ${docJenkinsPluginDependencies}
    83  
    84  ## Side effects
    85  
    86  none
    87  
    88  ## Exceptions
    89  
    90  none
    91  
    92  ## Example
    93  
    94  ```groovy
    95  // publish test results with coverage
    96  testsPublishResults(
    97    junit: [updateResults: true, archive: true],
    98    jacoco: [archive: true]
    99  )
   100  ```
   101  
   102  ```groovy
   103  // publish test results with coverage
   104  testsPublishResults(
   105    junit: [pattern: '**/target/TEST*.xml', archive: true],
   106    cobertura: [pattern: '**/target/coverage/cobertura-coverage.xml']
   107  )
   108  ```