Skip to content

Comments

Update test suite to ensure 100% code coverage#44

Merged
clue merged 1 commit intoclue:1.xfrom
clue-labs:coverage
Feb 21, 2026
Merged

Update test suite to ensure 100% code coverage#44
clue merged 1 commit intoclue:1.xfrom
clue-labs:coverage

Conversation

@clue
Copy link
Owner

@clue clue commented Feb 21, 2026

Builds on top of #42 and clue/reactphp-eventsource#35

@clue clue added this to the v1.4.0 milestone Feb 21, 2026
@clue clue requested a review from Copilot February 21, 2026 18:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds automated 100% code coverage validation to the test suite. It builds on top of the test environment improvements from PR #42, adding both CI enforcement and documentation for the code coverage requirement.

Changes:

  • Added automated coverage validation in CI workflow to fail builds if code coverage is below 100%
  • Added code coverage badge to README
  • Documented the code coverage requirement and how to generate coverage reports locally

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
README.md Added code coverage badge and documentation explaining the 100% coverage requirement with instructions for generating local coverage reports
.github/workflows/ci.yml Added clover.xml coverage report generation and PHP script to validate 100% code coverage after test runs
Comments suppressed due to low confidence (2)

.github/workflows/ci.yml:42

  • The XML parsing lacks error handling. If the clover.xml file doesn't exist, is malformed, or doesn't have the expected structure, the script will fail with a PHP error instead of a clear message. Consider adding error handling to check if the file exists and if the expected XML structure is present before accessing the metrics attributes.
          $metrics = simplexml_load_file('clover.xml')->project->metrics;
          exit((int) $metrics['statements'] === (int) $metrics['coveredstatements'] ? 0 : 1);

.github/workflows/ci.yml:42

  • The coverage check script doesn't provide any diagnostic output when coverage is below 100%. Consider adding an error message that shows the actual coverage percentage to help developers understand what needs to be fixed. For example, output the number of covered vs total statements before exiting.
      - name: Check 100% code coverage
        shell: php {0}
        run: |
          <?php
          $metrics = simplexml_load_file('clover.xml')->project->metrics;
          exit((int) $metrics['statements'] === (int) $metrics['coveredstatements'] ? 0 : 1);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@clue clue merged commit 627ec86 into clue:1.x Feb 21, 2026
20 checks passed
@clue clue deleted the coverage branch February 21, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant