Skip to content

Enable build failure when code coverage is below threshold#7228

Merged
srnagar merged 4 commits into
Azure:masterfrom
srnagar:code-coverage
Jan 8, 2020
Merged

Enable build failure when code coverage is below threshold#7228
srnagar merged 4 commits into
Azure:masterfrom
srnagar:code-coverage

Conversation

@srnagar

@srnagar srnagar commented Jan 7, 2020

Copy link
Copy Markdown
Member

This PR includes two changes:

  • Fails build if the code coverage drops below threshold
  • Includes jacoco test coverage reporting steps in archetype-sdk-client.yml which were previously configured in client.yml

Comment thread pom.client.xml
<outputDirectory>${project.reporting.outputDirectory}/test-coverage</outputDirectory>
</configuration>
</execution>
<execution>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JonathanGiles is this particular change going to require us to up the version and re-release the parent pom?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JimSuplizio since this change only introduces a check to fail the build when test coverage is low, it's not end user-facing. So, version update and re-release is not necessary.

@srnagar

srnagar commented Jan 7, 2020

Copy link
Copy Markdown
Member Author

/azp run java - core - ci

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment thread pom.client.xml Outdated
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>0.09</minimum>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth extracting these two minimum values out to properties so that child poms may overwrite this (in the future when we start setting a valid minimum and libraries need to opt-out for a valid reason)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, updated this to use properties and also customized the threshold for a couple of storage modules that had really low coverage to:

  • demonstrate how to customize the threshold per module
  • increase the base threshold to a much higher number than 9%

@srnagar
srnagar merged commit 0c2df36 into Azure:master Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants