Skip to content

Commit

Permalink
Code Coverage Status Check on pb file presence, Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rd4dev committed Aug 18, 2024
1 parent de40692 commit 6989c6c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
needs: [ evaluate-code-coverage-reports, comment_coverage_report ]
# The expression if: ${{ !cancelled() }} runs a job or step regardless of its success or failure while responding to cancellations,
# serving as a cancellation-compliant alternative to if: ${{ always() }} in concurrent workflows.
if: ${{ needs.compute_changed_files.outputs.can_skip_files != 'true' && !cancelled()}}
if: ${{ needs.evaluate-code-coverage-reports.outputs.pb_file_empty != 'true' && !cancelled()}}
runs-on: ubuntu-20.04
steps:
- name: Check that coverage status is passed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,15 +496,6 @@ class CoverageReporter(
}
}

val skipCoverageReportText = buildString {
append("## Coverage Report\n")
append("### Results\n")
append("Coverage Analysis: **SKIP** :next_track_button:\n\n")
append("_This PR did not introduce any changes to Kotlin source or test files._\n\n")
append("#\n")
append("> To learn more, visit the [Oppia Android Code Coverage](https://github.com/oppia/oppia-android/wiki/Oppia-Android-Code-Coverage) wiki page")
}

val wikiPageLinkNote = buildString {
val wikiPageReferenceNote = ">To learn more, visit the [Oppia Android Code Coverage]" +
"(https://github.com/oppia/oppia-android/wiki/Oppia-Android-Code-Coverage) wiki page"
Expand All @@ -514,6 +505,14 @@ class CoverageReporter(
append(wikiPageReferenceNote)
}

val skipCoverageReportText = buildString {
append("## Coverage Report\n")
append("### Results\n")
append("Coverage Analysis: **SKIP** :next_track_button:\n\n")
append("_This PR did not introduce any changes to Kotlin source or test files._")
append(wikiPageLinkNote)
}

val finalReportText = coverageReportContainer.coverageReportList.takeIf { it.isNotEmpty() }
?.let {
"## Coverage Report\n\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,9 +1023,8 @@ class CoverageReporterTest {
append("## Coverage Report\n")
append("### Results\n")
append("Coverage Analysis: **SKIP** :next_track_button:\n\n")
append("_This PR did not introduce any changes to Kotlin source or test files._\n\n")
append("#\n")
append("> To learn more, visit the [Oppia Android Code Coverage](https://github.com/oppia/oppia-android/wiki/Oppia-Android-Code-Coverage) wiki page")
append("_This PR did not introduce any changes to Kotlin source or test files._")
append(oppiaCoverageWikiPageLinkNote)
}

assertThat(readFinalMdReport()).isEqualTo(expectedMarkdown)
Expand Down

0 comments on commit 6989c6c

Please sign in to comment.