Repository navigation
HDDS-17463. Publish GitHub Actions summary for coverage check - #12054
Conversation
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
… in CI Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
…en report Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @kjs1095 for the patch, LGTM.
| @test "coverage_summary.py unit tests" { | ||
| cd "${BATS_TEST_DIRNAME}" | ||
| run python3 -m unittest test_coverage_summary | ||
| [ "$status" -eq 0 ] |
There was a problem hiding this comment.
For follow-up: I think we should add a separate check for Python tests to avoid the need to hook these into the bats check.
There was a problem hiding this comment.
Agreed.
While checking dev-support/ci/selective_ci_checks.sh, contributors need to understand that any new Python utility requires its own .bats file. (Or the test code will not be executed). It's unnecessary cognitive load.
Happy to take this as a follow-up!
chihsuan
left a comment
There was a problem hiding this comment.
Thanks for the patch! @kjs1095 This looks good overall. I left two small inline comments.
same formula as SonarCloud
FYI, on master 8220773 this PR's summary showed 81.8%, while Sonar showed 79.9%. The gap mostly comes from coverage.sh class selection, so I filed HDDS-17836. No change needed here.
| with mock.patch.dict(os.environ, {}, clear=True): | ||
| self.assertNotIn("📦 Full HTML report: [download artifact]", self.render()) | ||
|
|
||
| def test_package_table_sorted_by_missed(self): |
There was a problem hiding this comment.
I just noticed this doesn't really test sorting by missed, since the samples are already in name order. It still passes with key=lambda p: p.name. Could we add a case where the two orders disagree?
There was a problem hiding this comment.
Good catch!
Will add cases for sorting by missed
|
Thanks @kjs1095 for updating the patch. The failed |
UpdatedI updated the follow-up Jira link (I copied the wrong ticket link). ==== I filed HDDS-17840 as a follow-up. |
|
Hi @chihsuan , I responded to each feedback with commits. |
I guess it's HDDS-17840. |
What changes were proposed in this pull request?
From JIRA description
Coverage check (runs for push builds) publishes report and posts to Sonar (only in Apache). It could also post a GitHub Actions summary to make it easier to quickly understand coverage of a commit without downloading the bundle.
Scope
coverage.shand prints a Markdown summaryci.ymlgets a new step after the archive step that appends the output to$GITHUB_STEP_SUMMARYtest_coverage_summary.py, run through a bats wrapper likejunit_summary.bats.Markdown coverage summary content
(Refer screenshots in section
How was this patch tested?)<details>block with per-package tableDesign decisions
(covered lines + covered branches) / (lines + branches)[1]Reference
[1] https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects/metric-definitions
[2] https://www.jacoco.org/jacoco/trunk/doc/counters.html
[3] https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#step-isolation-and-limits
Co-authored-by: Claude Code (Claude Fable 5.1) noreply@anthropic.com
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-17463
How was this patch tested?
Local ran:
Fork CI ran CI Run Link
Screenshot