Skip to content

Commit

Permalink
Code coverage in aggregate reports (#7734)
Browse files Browse the repository at this point in the history
* Drop in code coverage generation.

* Set pom file location.

* Increase job timeout.

* Remove nio dependency for now.
  • Loading branch information
mitchdenny authored Jan 28, 2020
1 parent 980616d commit 34cbb46
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
5 changes: 0 additions & 5 deletions eng/jacoco-test-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@
<artifactId>azure-storage-blob-cryptography</artifactId>
<version>12.4.0-beta.1</version> <!-- {x-version-update;com.azure:azure-storage-blob-cryptography;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob-nio</artifactId>
<version>12.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-storage-blob-nio;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-file-share</artifactId>
Expand Down
36 changes: 36 additions & 0 deletions eng/pipelines/aggregate-reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pr: none

jobs:
- job: Generate
timeoutInMinutes: 180
variables:
- template: templates/variables/globals.yml
pool:
Expand Down Expand Up @@ -50,6 +51,41 @@ jobs:
publishJUnitResults: false
goals: 'install site:site site:stage'

- task: Maven@3
displayName: 'Generate aggregate code coverage report'
inputs:
mavenPomFile: 'pom.client.xml'
options: '$(DefaultOptions) -Dinclude-non-shipping-modules -Dgpg.skip -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true'
mavenOptions: '-Xmx3072m $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'verify'

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
mergeTestResults: true
testRunTitle: 'Linux on Java 1.11'

# Azure DevOps only seems to respect the last code coverage result published, so only do this for Linux + Java LTS.
# Code coverage reporting is setup only for Track 2 modules.
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: JaCoCo
summaryFileLocation: eng/jacoco-test-coverage/target/site/test-coverage/jacoco.xml
reportDirectory: eng/jacoco-test-coverage/target/site/test-coverage/
failIfCoverageEmpty: true

# Publish code coverage to an artifact so it can be uploaded to the Maven site.
# Do this for track 2 modules only. Code coverage from previous step is only published for Linux + Java LTS.
- task: PublishPipelineArtifact@0
displayName: 'Publish coverage artifact'
inputs:
artifactName: coverage
targetPath: eng/jacoco-test-coverage/target/site/

- script: |
git clone https://github.com/JonathanGiles/DependencyChecker.git
mkdir input && cp eng/DependencyChecker/client_dependencies.json input/dependencies.json
Expand Down

0 comments on commit 34cbb46

Please sign in to comment.