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

Upload code coverage report through CI #1320

Closed
tlfeng opened this issue Sep 30, 2021 · 5 comments
Closed

Upload code coverage report through CI #1320

tlfeng opened this issue Sep 30, 2021 · 5 comments
Assignees
Labels
CI CI related enhancement Enhancement or improvement to existing feature or request :test Adding or fixing a test

Comments

@tlfeng
Copy link
Collaborator

tlfeng commented Sep 30, 2021

Is your feature request related to a problem? Please describe.
A part of issue: #850
There hasn't got a place to see the code coverage of this repository.

Describe the solution you'd like
To achieve the goal of reporting test coverage, I plan to upload the code coverage report to Codecov through CI.
We have set a plan for OpenSearch/Dashboards plugins to report the code coverage, and I'm going to expand it to the
"OpenSearch".

The report can be uploaded to Codecov daily or during the "gradle check" process of Pull Requests.

The command to generate the code coverage report: the guide in TESTING.md
Steps to upload the report to Codecov:

The codecov dashboard to see all the code coverage information for opensearch-project: https://app.codecov.io/gh/opensearch-project

Describe alternatives you've considered
None.

Additional context
None.

@tlfeng tlfeng added enhancement Enhancement or improvement to existing feature or request CI CI related labels Sep 30, 2021
@tlfeng tlfeng added the :test Adding or fixing a test label Sep 30, 2021
@sampathbalivada
Copy link
Contributor

sampathbalivada commented Jan 18, 2022

I set up a GitHub Actions workflow to test things out at my end and seems like I have an issue running the tests. These are the tasks that I am running at my end. (All these are running on a replica of the main branch)

./gradlew check -Dtests.coverage=true
# the workflow run for the below task has been successful 
# because of 'true' but the build failed
./gradlew codeCoverageReport --parallel || true
./gradlew codeCoverageReportForUnitTest --parallel

All these tasks failed with the following exception.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':server:test'.

Runs for reference:
https://github.com/sampathbalivada/OpenSearch/runs/4852410823?check_suite_focus=true
https://github.com/sampathbalivada/OpenSearch/runs/4853613540?check_suite_focus=true
https://github.com/sampathbalivada/OpenSearch/runs/4856683788?check_suite_focus=true

I am able to perform assemble and precommit tasks but not being able to generate coverage reports. My guess is that I am missing a dependency here.

The workflow installs JDK11 and runs the above command(s). I have some questions here.

  • Are additional JDKs (8,11,14) required to run these tests? I only thought we need them to run backwards compatibility checks.
  • Is there a dependency that I am currently missing?

@dblock
Copy link
Member

dblock commented Jan 18, 2022

@sampathbalivada Check out #1665, that should answer many questions. Beyond setup, ./gradlew check requires hardware that GHA can't quite handle and we've been trying several workarounds short of running our own setup (we currently do with Jenkins and a bunch of instances supplied by AWS).

@sampathbalivada
Copy link
Contributor

Thank you for the information @dblock. Seems like this issue has a dependency on #39.

Also, since we are already doing ./gradlew check, wouldn't it be easier to add -Dtests.coverage=true and generate the coverage report there?

@dblock
Copy link
Member

dblock commented Feb 1, 2022

Also, since we are already doing ./gradlew check, wouldn't it be easier to add -Dtests.coverage=true and generate the coverage report there?

Likely!

@dreamer-89
Copy link
Member

Code coverage report upload was handled as part of public jenkins migration work. Since, the work is already completed, closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI CI related enhancement Enhancement or improvement to existing feature or request :test Adding or fixing a test
Projects
None yet
Development

No branches or pull requests

4 participants