Skip to content

Update test suite to ensure 100% code coverage - #29

Merged
clue merged 1 commit into
clue:1.xfrom
clue-labs:coverage
Oct 25, 2026
Merged

clue merged 1 commit into
clue:1.xfrom
clue-labs:coverage

Conversation

@clue

@clue clue commented Oct 25, 2026

Copy link
Copy Markdown
Owner

This changeset updates the test suite to ensure 100% code coverage.

The coverage check skips legacy PHP 5.3, as createReceiver() requires PHP 5.4+ and can not be covered there. This also removes the explicit SO_REUSEADDR socket option, as PHP already sets this for all stream sockets, so multiple receivers can still share the same port.

Builds on top of #28, #27 and clue/reactphp-eventsource#35
Refs reactphp/socket#236

@clue clue added this to the v1.3.0 milestone Oct 25, 2026
@clue
clue requested a balanced review from Copilot October 25, 2026 17:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The coverage gate can succeed without a valid coverage report, undermining its enforcement.

1 open issue
What changed in this PR

This PR expands test coverage for the multicast socket factory and adds a CI gate intended to enforce 100% coverage, excluding legacy PHP 5.3.

Changes:

  • Add tests for socket creation failures and use a dynamically selected port in the invalid-address test.
  • Remove redundant SO_REUSEADDR configuration and adjust coverage exclusions.
  • Generate and check Clover coverage reports, with a README badge and local reporting instructions.
File Description
tests/​FunctionalTest.php Add failure-path tests and replace a fixed test port.
src/​Factory.php Simplify socket setup and annotate unsupported-environment branches.
README.md Document coverage expectations and report generation.
.github/​workflows/​ci.yml Generate Clover reports and enforce full coverage on PHP 5.4+.

Review effort: Balanced

Comment thread .github/workflows/ci.yml
@clue
clue merged commit c71fda4 into clue:1.x Oct 25, 2026
16 checks passed
@clue
clue deleted the coverage branch October 25, 2026 17:41
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.

2 participants