Skip to content

Jacoco: fix no coverage result in server and some other modules#6730

Merged
yadvr merged 1 commit intoapache:4.17from
weizhouapache:4.17-fix-jacoco-coverage
Sep 12, 2022
Merged

Jacoco: fix no coverage result in server and some other modules#6730
yadvr merged 1 commit intoapache:4.17from
weizhouapache:4.17-fix-jacoco-coverage

Conversation

@weizhouapache
Copy link
Copy Markdown
Member

According to https://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html
we need to add "@{argLine}" to argLine if it exists in pom.xml

Description

This PR fixes missing jacoco coverage report in some modules

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Copy Markdown
Member

@yadvr yadvr left a comment

Choose a reason for hiding this comment

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

Thanks for finding @weizhouapache, I think I had removed this on root pom.xml due to some historic reason (I forgot)

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Sep 12, 2022

@weizhouapache maybe worth checking local jacoco? I don't see any difference reported by sonarbot (not sure why codecov didn't kick in)

@weizhouapache
Copy link
Copy Markdown
Member Author

@weizhouapache maybe worth checking local jacoco? I don't see any difference reported by sonarbot (not sure why codecov didn't kick in)

@rohityadavcloud
I have added this change to my PR for vm autoscaling

the following page shows coverage result of changes on java files in server module.
https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6571&metric=new_coverage&view=list

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 12, 2022

Codecov Report

Merging #6730 (d6f875a) into 4.17 (d3bfdac) will increase coverage by 4.45%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               4.17    #6730      +/-   ##
============================================
+ Coverage      5.88%   10.34%   +4.45%     
- Complexity     3927     6609    +2682     
============================================
  Files          2451     2451              
  Lines        242338   242338              
  Branches      37923    37923              
============================================
+ Hits          14261    25060   +10799     
+ Misses       226502   214192   -12310     
- Partials       1575     3086    +1511     
Impacted Files Coverage Δ
...ava/com/cloud/network/as/AutoScaleManagerImpl.java 0.12% <0.00%> (+0.12%) ⬆️
...a/com/cloud/network/router/CommandSetupHelper.java 0.12% <0.00%> (+0.12%) ⬆️
server/src/main/java/com/cloud/api/ApiDBUtils.java 0.17% <0.00%> (+0.17%) ⬆️
...twork/contrail/management/ContrailManagerImpl.java 0.19% <0.00%> (+0.19%) ⬆️
...com/cloud/network/vpn/Site2SiteVpnManagerImpl.java 0.21% <0.00%> (+0.21%) ⬆️
...java/com/cloud/network/rules/RulesManagerImpl.java 0.23% <0.00%> (+0.23%) ⬆️
...oud/network/ExternalFirewallDeviceManagerImpl.java 0.25% <0.00%> (+0.25%) ⬆️
.../src/main/java/com/cloud/configuration/Config.java 89.26% <0.00%> (+0.26%) ⬆️
...com/cloud/network/NetworkMigrationManagerImpl.java 0.28% <0.00%> (+0.28%) ⬆️
.../cloud/network/ExternalDeviceUsageManagerImpl.java 0.30% <0.00%> (+0.30%) ⬆️
... and 449 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@yadvr yadvr added this to the 4.17.1.0 milestone Sep 12, 2022
@yadvr
Copy link
Copy Markdown
Member

yadvr commented Sep 12, 2022

w00t @weizhouapache good find, and well done. I suspect, adding argLine on server alone would have addressed a lot of missed unit tests. @shwstppr I suppose we can merge this as this doesn't change the code essentially but how coverage is analysed and args used in the surefire plugin, but does that still require us to fix the powermock issue?

@yadvr yadvr merged commit 20950e0 into apache:4.17 Sep 12, 2022
@weizhouapache weizhouapache deleted the 4.17-fix-jacoco-coverage branch June 23, 2023 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants