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

Fix codecov upload for codecov-action v5 #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dbwiddis
Copy link
Member

@dbwiddis dbwiddis commented Feb 5, 2025

Description

The action to upload code coverage changed parameter name in v5 from file to files.

Issues Resolved

Warning: Unexpected input(s) 'file', valid inputs are ['base_sha', 'binary', 'codecov_yml_path', 'commit_parent', 'directory', 'disable_file_fixes', 'disable_search', 'disable_safe_directory', 'disable_telem', 'dry_run', 'env_vars', 'exclude', 'fail_ci_if_error', 'files', 'flags', 'force', 'git_service', 'gcov_args', 'gcov_executable', 'gcov_ignore', 'gcov_include', 'handle_no_reports_found', 'job_code', 'name', 'network_filter', 'network_prefix', 'os', 'override_branch', 'override_build', 'override_build_url', 'override_commit', 'override_pr', 'plugins', 'report_code', 'report_type', 'root_dir', 'run_command', 'skip_validation', 'slug', 'swift_project', 'token', 'url', 'use_legacy_upload_endpoint', 'use_oidc', 'use_pypi', 'verbose', 'version', 'working-directory']

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.

@dbwiddis dbwiddis force-pushed the fix-ci-image branch 2 times, most recently from c7365e4 to b0fdaba Compare February 5, 2025 18:08
@dbwiddis dbwiddis changed the title Fix startup options for CI Image Fix upload parameter for codecov-action v5 Feb 5, 2025
@dbwiddis
Copy link
Member Author

dbwiddis commented Feb 5, 2025

./codecov upload-coverage --git-service github --sha c3b05a2 --branch dbwiddis:fix-ci-image --file ./build/reports/jacoco/test/jacocoTestReport.xml --gcov-executable gcov
[PYI-982:ERROR] Failed to load Python shared library '/tmp/_MEIN2yBMh/libpython3.11.so.1.0': dlopen: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/_MEIN2yBMh/libpython3.11.so.1.0)

@peterzhuamazon
Copy link
Member

@peterzhuamazon
Copy link
Member

peterzhuamazon commented Feb 5, 2025

Basically due to the image we are using is AL2 docker image, and codecov above v3 uses python11, you have to upload the report file, then download, before sending it to codecov using ubuntu-latest.

@dbwiddis
Copy link
Member Author

dbwiddis commented Feb 5, 2025

Basically due to the image we are using is AL2 docker image, and codecov v3 or above uses python11, you have to upload the report file, then download, before sending it to codecov using ubuntu-latest.

Thanks. I was multitasking and tweaking this between other tests, appreciate the pointer.

@dbwiddis
Copy link
Member Author

dbwiddis commented Feb 5, 2025

you have to upload the report file, then download, before sending it to codecov using ubuntu-latest.

After looking at this, I'm not sure it's a better solution than what I had in #52. Looks like the codecov upload needs to be not on the CI container; and it's a lot simpler to just run unit tests and do coverage all by themselves on a non-CI runner than to wait for all JDK tests (including integ tests) to finish and do this upload/download dance....

So re-opened #52 to consider if we just want to do that one

@dbwiddis dbwiddis changed the title Fix upload parameter for codecov-action v5 Fix codecov upload for codecov-action v5 Feb 5, 2025
@dbwiddis dbwiddis force-pushed the fix-ci-image branch 3 times, most recently from 43e9d28 to edc78e8 Compare February 5, 2025 22:16
with:
file: ./build/reports/jacoco/test/jacocoTestReport.xml
name: coverage-report-linux
Copy link
Member

@peterzhuamazon peterzhuamazon Feb 5, 2025

Choose a reason for hiding this comment

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

Since you are using multiple java means you need to change coverage-report-linux to coverage-report-linux-${{ matrix.java }} so that multiple runs will upload with different name on the artifact.

Same for download.

@dbwiddis

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, previously the codecov was filtered to run only on one jdk.

But I don't think that's the problem. I'm guessing the change from file to files needs a different argument of some sort, just have been commuting and haven't looked into it yet

Copy link
Member Author

Choose a reason for hiding this comment

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

Or, the problem is that I don't have the jacoco line in my build.gradle 🤦‍♂️

Copy link
Member

Choose a reason for hiding this comment

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

Warning: No files were found with the provided path: ./jacocoTestReport.xml. No artifacts will be uploaded.

Copy link
Member Author

Choose a reason for hiding this comment

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

Or, I do, but since I have modules my path starting with ./build doesn't work, I need ./modulepath/build.

Copy link
Member Author

Choose a reason for hiding this comment

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

WooHoo!

==> Running upload-coverage
./codecov upload-coverage --git-service github --sha 3a5a07f --branch dbwiddis:fix-ci-image --file ./coverage-reports/aos-client/build/reports/jacoco/test/jacocoTestReport.xml --file ./coverage-reports/remote-client/build/reports/jacoco/test/jacocoTestReport.xml --file ./coverage-reports/ddb-client/build/reports/jacoco/test/jacocoTestReport.xml --file ./coverage-reports/core/build/reports/jacoco/test/jacocoTestReport.xml --gcov-executable gcov
info - 2025-02-06 01:06:10,812 -- ci service found: github-actions
warning - 2025-02-06 01:06:10,816 -- No config file could be found. Ignoring config.
warning - 2025-02-06 01:06:10,834 -- xcrun is not installed or can't be found.
warning - 2025-02-06 01:06:10,836 -- No gcov data found.
warning - 2025-02-06 01:06:10,836 -- coverage.py is not installed or can't be found.
info - 2025-02-06 01:06:10,844 -- Found 4 coverage files to report
info - 2025-02-06 01:06:10,844 -- > /home/runner/work/opensearch-remote-metadata-sdk/opensearch-remote-metadata-sdk/coverage-reports/aos-client/build/reports/jacoco/test/jacocoTestReport.xml
info - 2025-02-06 01:06:10,845 -- > /home/runner/work/opensearch-remote-metadata-sdk/opensearch-remote-metadata-sdk/coverage-reports/remote-client/build/reports/jacoco/test/jacocoTestReport.xml
info - 2025-02-06 01:06:10,845 -- > /home/runner/work/opensearch-remote-metadata-sdk/opensearch-remote-metadata-sdk/coverage-reports/core/build/reports/jacoco/test/jacocoTestReport.xml
info - 2025-02-06 01:06:10,845 -- > /home/runner/work/opensearch-remote-metadata-sdk/opensearch-remote-metadata-sdk/coverage-reports/ddb-client/build/reports/jacoco/test/jacocoTestReport.xml
info - 2025-02-06 01:06:11,288 -- Your upload is now processing. When finished, results will be available at: https://app.codecov.io/github/opensearch-project/opensearch-remote-metadata-sdk/commit/3a5a07fc55262577fb328f5e0ff5f5b74079e934
info - 2025-02-06 01:06:11,513 -- Process Upload complete

Copy link
Member Author

Choose a reason for hiding this comment

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

Except...
Screenshot 2025-02-05 at 5 13 41 PM

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe the whole public/private/public flip messed it up?

Screenshot 2025-02-05 at 5 15 05 PM

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.

2 participants