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: prevent codecov from publishing coverage report early #1806

Merged
merged 3 commits into from
Jul 24, 2024

Conversation

StephenHulme
Copy link
Contributor

@StephenHulme StephenHulme commented Jul 24, 2024

JS tests finish before Ruby tests, meaning CodeCov publishes it's report before all information has been recieved.

Changes proposed in this pull request

  • Tell CodeCov to wait for 2 reports before commenting on PR

Related to

DPL-1034: Combine code coverage from both Javascript and Ruby code

Instructions for Reviewers

[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to main]
    - Check story numbers included
    - Check for debug code
    - Check version

Copy link

codecov bot commented Jul 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.40%. Comparing base (2934db3) to head (475d6da).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1806   +/-   ##
========================================
  Coverage    91.40%   91.40%           
========================================
  Files          376      376           
  Lines         7656     7656           
========================================
  Hits          6998     6998           
  Misses         658      658           
Flag Coverage Δ
javascript 93.65% <ø> (ø)
pull_request 91.40% <ø> (?)
push 91.39% <ø> (-0.02%) ⬇️
ruby 91.09% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

codecov:
notify:
# do not notify until at least n builds have been uploaded from the CI pipeline
after_n_builds: 4 # js_test (push), js_test (pull_request), ruby_test (push), ruby_test (pull_request)
Copy link
Contributor

Choose a reason for hiding this comment

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

👨🏻‍🍳 😚 👌🏻

Copy link
Contributor

@BenTopping BenTopping left a comment

Choose a reason for hiding this comment

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

Looks sensible. What happens if an action is cancelled or a test suite fails, does that still count as a 'build'?

@StephenHulme
Copy link
Contributor Author

Screenshot 2024-07-24 at 10 53 06

It's working 🙂
Note the edit history:

  • Initially after_n_builds was set to 2
  • 15 minutes ago: received js_test (push), js_test (pull_request)
  • 11 minutes ago: received ruby_test (push), ruby_test (pull_request)
  • Then I changed after_n_builds to 4:
  • 1 minute ago: received all 4 coverage reports

@StephenHulme
Copy link
Contributor Author

Looks sensible. What happens if an action is cancelled or a test suite fails, does that still count as a 'build'?

I think 'build' in this context is any uploaded coverage report. In this case, I imagine that no report will be generated - which is probably sensible since it doesn't have sufficient data. A more active failure mode might be preferable, but I think this is a reasonable tradeoff for the increased accuracy.

Copy link

codeclimate bot commented Jul 24, 2024

Code Climate has analyzed commit 475d6da and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 91.0% (0.0% change).

View more on Code Climate.

@StephenHulme StephenHulme merged commit baf1b58 into develop Jul 24, 2024
12 checks passed
@StephenHulme StephenHulme deleted the sh51/prevent-multiple-codecov-reports branch July 24, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants