Skip to content

Commit

Permalink
Disable code coverage reporting. (#7331)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchdenny authored Jan 10, 2020
1 parent f6a240a commit f9e7827
Showing 1 changed file with 40 additions and 33 deletions.
73 changes: 40 additions & 33 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -317,36 +317,43 @@ jobs:
mergeTestResults: true
testRunTitle: $(RunTitle)

# Generate JaCoCo code coverage report on Java 11, Linux builds if the build reason is not PR.
- task: Maven@3
displayName: 'Generate aggregate code coverage report'
condition: and(eq(variables['OsName'], 'Linux'), eq(variables['JavaVersion'], '1.11'), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
# Aggregate reports for non-PR builds will use pom.client.xml and include non-shipping modules
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: $(JavaVersion)
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'verify'

# 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
condition: and(eq(variables['OsName'], 'Linux'), eq(variables['JavaVersion'], '1.11'), ne(variables['Build.Reason'], 'PullRequest'))
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'
condition: and(eq(variables['OsName'], 'Linux'), eq(variables['JavaVersion'], '1.11'), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
artifactName: coverage
targetPath: eng/jacoco-test-coverage/target/site/
# HACK: This has been disabled to unblock releases where aggregate code
# coverage reporting was causing agent timeouts. We've got an issue
# to discuss how to handle aggregate-style reporting across the repo
# but at the moment this isn't going to work:
#
# https://github.com/Azure/azure-sdk-for-java/issues/7271
#
# # Generate JaCoCo code coverage report on Java 11, Linux builds if the build reason is not PR.
# - task: Maven@3
# displayName: 'Generate aggregate code coverage report'
# condition: and(eq(variables['OsName'], 'Linux'), eq(variables['JavaVersion'], '1.11'), ne(variables['Build.Reason'], 'PullRequest'))
# inputs:
# # Aggregate reports for non-PR builds will use pom.client.xml and include non-shipping modules
# 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: $(JavaVersion)
# jdkArchitectureOption: 'x64'
# publishJUnitResults: false
# goals: 'verify'

# # 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
# condition: and(eq(variables['OsName'], 'Linux'), eq(variables['JavaVersion'], '1.11'), ne(variables['Build.Reason'], 'PullRequest'))
# 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'
# condition: and(eq(variables['OsName'], 'Linux'), eq(variables['JavaVersion'], '1.11'), ne(variables['Build.Reason'], 'PullRequest'))
# inputs:
# artifactName: coverage
# targetPath: eng/jacoco-test-coverage/target/site/

0 comments on commit f9e7827

Please sign in to comment.