codecov / codecov-cli

Codecov's Command Line Interface. Used for uploading to Codecov in your CI, Test Labelling, Local Upload, and more
Apache License 2.0
56 stars 39 forks source link

Take Java JUnit conventions into account when detecting test files to upload #550

Open leonardehrenfried opened 3 weeks ago

leonardehrenfried commented 3 weeks ago

I've just discovered the test upload feature - great work!

I've tried it on a Maven/Java project and the majority of my test files were not detected because Maven/JUnit/Surefire prefixes them with TEST and not test.

https://github.com/opentripplanner/OpenTripPlanner/actions/runs/11665161617/job/32477225744

For this reason I'm adding this to the default patterns for Junit test uploads.

rohan-at-sentry commented 3 weeks ago

@leonardehrenfried thanks for the PR. I also wanted to point out that you can set the regex to something that works for you using the files param (assuming you're using the Test-results action. For more, see docs - https://docs.codecov.com/docs/test-analytics-beta#troubleshooting

Out of curiosity, how did you come across this feature? Feature discovery is something we're looking to better optimize, so your thoughts would be helpful

leonardehrenfried commented 3 weeks ago

I will try setting files in the action. While the troubleshooting guide you looked at gives me a good idea how to do it, I looked at the docs of this repo and there it's not quite so clear. Do you welcome doc PRs?

I discovered this feature when a new tab appeared on my coverage report page:

Screenshot From 2024-11-04 21-36-19

rohan-at-sentry commented 3 weeks ago

Thanks @leonardehrenfried - I'm assuming you mean PR on the https://github.com/codecov/test-results-action? If so, yes PRs totally welcome.

rohan-at-sentry commented 3 weeks ago

@joseph-sentry can you review this PR please

codecov[bot] commented 1 day ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.66%. Comparing base (c20a203) to head (8c611c2).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #550 +/- ## ========================================== - Coverage 95.67% 95.66% -0.01% ========================================== Files 86 83 -3 Lines 3118 3115 -3 ========================================== - Hits 2983 2980 -3 Misses 135 135 ``` | [Flag](https://app.codecov.io/gh/codecov/codecov-cli/pull/550/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | Coverage Δ | | |---|---|---| | [python3.10](https://app.codecov.io/gh/codecov/codecov-cli/pull/550/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `?` | | | [python3.11](https://app.codecov.io/gh/codecov/codecov-cli/pull/550/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `?` | | | [python3.12](https://app.codecov.io/gh/codecov/codecov-cli/pull/550/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `95.92% <ø> (ø)` | | | [python3.8](https://app.codecov.io/gh/codecov/codecov-cli/pull/550/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `?` | | | [python3.9](https://app.codecov.io/gh/codecov/codecov-cli/pull/550/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.