Skip to content

Conversation

@Divyaasm
Copy link
Collaborator

Description

  1. Support server module and other modules split from the gradle check tasks
  2. Archive all the coverage reports generated during the run.
  3. Gradle script changes to support the feature

Issues Resolved

Addresses build side changes for the meta issue opensearch-project/OpenSearch#19378

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

'''
junit allowEmptyResults: true, testResults: '**/build/test-results/**/*.xml'
archiveArtifacts artifacts: 'codeCoverage.xml', onlyIfSuccessful: true
archiveArtifacts artifacts: 'codeCoverage/**', onlyIfSuccessful: true
Copy link
Member

@gaiksaya gaiksaya Oct 14, 2025

Choose a reason for hiding this comment

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

Is the value of onlyIfSuccessful right? Seems confusing when it is placed under always block but only archiveArtifacts if successful.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah Sayali. It's valid, only archives if the build is successful. The files aren't even created if the build fails.

Copy link
Member

Choose a reason for hiding this comment

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

Isn't that what @bowenlan-amzn and we were discussing. That failure also needs to generate codecoverage? opensearch-project/opensearch-build-libraries#744

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That is a different problem Sayali. Will need to expliticitly generate reports from the .exec files using jacococli or a gradle command in failed block .
This PR handles the successful condition and generates all the required reports independently to generate coverage data for unit and integration tests.

Copy link
Member

Choose a reason for hiding this comment

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

In that case should this entire block be placed under success block of jenkins instead of always?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We would anyway create the reports with same names. So once I add the failure block I will remove onlyIfSuccessful condition. Archiving will be applicable to every build status in that case.

Copy link
Member

Choose a reason for hiding this comment

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

Sure sounds good. I believe we are yet to add module_name arg in build-lib side?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, just a small change will send the PR.

@codecov
Copy link

codecov bot commented Oct 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.57%. Comparing base (e48ea12) to head (64440d4).
⚠️ Report is 22 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5778   +/-   ##
=======================================
  Coverage   96.57%   96.57%           
=======================================
  Files         405      405           
  Lines       18526    18526           
=======================================
  Hits        17892    17892           
  Misses        634      634           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Divya Madala <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants