Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: ingtegration test coverage #3133

Closed
wants to merge 1 commit into from
Closed

Conversation

hsinn0
Copy link
Contributor

@hsinn0 hsinn0 commented Nov 14, 2024

  • Added a task to get the report.

- Added a task to get the report.
@hsinn0 hsinn0 requested a review from a team November 14, 2024 21:23
@hsinn0
Copy link
Contributor Author

hsinn0 commented Nov 14, 2024

When running the new Gradle task as described in the build.gradle, I get:

\> Task :cloudfoundry-identity-uaa:jacocoLogIntegrationTestCoverage
Test Coverage:
    - Class Coverage: 13%
    - Method Coverage: 14.4%
    - Branch Coverage: 3.7%
    - Line Coverage: 8.6%
    - Instruction Coverage: 6.9%
    - Complexity Coverage: 8.4%
\> Task :jacocoLogAggregatedCoverage
Test Coverage:
    - Class Coverage: 14%
    - Method Coverage: 15.2%
    - Branch Coverage: 4%
    - Line Coverage: 9.3%
    - Instruction Coverage: 7.5%
    - Complexity Coverage: 9%

You can also get the coverage number from IntelliJ Idea by running integrationTest gradle task there with Run with Coverage option there. In my case, the numbers from Idea was slightly different from the gradle task result above, but close enough. There is an option to run integrationTest task with Coverage in IntelliJ Idea. However, the coverage report from it was not what we expected. It was not showing coverage for the app server code path that was being executed.

@hsinn0 hsinn0 marked this pull request as draft November 14, 2024 22:57
@hsinn0 hsinn0 removed the request for review from a team November 14, 2024 22:57
@hsinn0
Copy link
Contributor Author

hsinn0 commented Nov 15, 2024

This is not working. The JaCoCo coverage data is collected not from app server but from the integration test process itself. Looking at our integrationTest definition, it should have been somewhat obvious but I missed that. Will have to change to instrument cargo.local process instead.

@hsinn0 hsinn0 closed this Nov 15, 2024
@hsinn0 hsinn0 deleted the pr/integ_test_coverage branch November 15, 2024 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

1 participant