Skip to content

Conversation

@abdulraqeeb33
Copy link
Contributor

@abdulraqeeb33 abdulraqeeb33 commented Nov 12, 2025

Description

One Line Summary

Adding diff coverage in the CI/CD pipeline

Details

Adds diff coverage checking to enforce test coverage on changed code. The checkCoverage.sh script checks coverage for files modified in the PR against the base branch. The default is set to 80% threshold.
Coverage results are automatically posted as PR comments, and the build fails if coverage is below the threshold.
The Skip Coverage Check label can be used to bypass the coverage step while still showing coverage results.

Motivation

We need to make sure any code added to the code base needs to have proper coverage.

Scope

Limited to internal testing.

Testing

Unit testing

Added extra code for testing purposes.

Manual testing

./coverage/checkCoverage.sh

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
    • If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
    • Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
  • I have reviewed this PR myself, ensuring it meets each checklist item
    • WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.

This change is Reviewable

@github-actions
Copy link
Contributor

github-actions bot commented Nov 12, 2025

📊 Diff Coverage Report

Diff Coverage Report

Threshold: 80%

Changed Files Coverage

  • ⚠️ CoverageTestHelper.kt: Not in coverage report (may not be compiled/tested)
  • IDManager.kt: 2/11 lines (18.2%)
    • ⚠️ Below threshold: 9 uncovered lines

Overall Coverage

2/11 lines covered (18.2%)

❌ Coverage Check Failed

Files below 80% threshold:

  • IDManager.kt: 18.2% (9 uncovered lines)

📥 View workflow run

@abdulraqeeb33 abdulraqeeb33 added the Skip Coverage Check To skip coverage check in the run label Nov 26, 2025
* @return true if the [id] provided was created via [createLocalId].
*/
fun isLocalId(id: String): Boolean = id.startsWith(LOCAL_PREFIX)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is extra code i have added to show case the results. I will delete this code once this PR is reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Coverage Check To skip coverage check in the run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants