Skip to content

feat: migrate tests to Testo, require PHP 8.2 - #40

Merged
roxblnfk merged 2 commits into
4.xfrom
testo
Oct 9, 2026
Merged

roxblnfk merged 2 commits into
4.xfrom
testo

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

🔍 What was changed

  • Minimum PHP is now 8.2 ("php": ">=8.2").
  • Tests run on Testo instead of PHPUnit: phpunit/phpunit and phpunit.xml are gone, testo.php declares a single Unit suite over tests/Goridge, composer test / composer test-cover call testo. No mocking library was needed — the suite has no mocks.
  • CI calls spiral/gh-actions/.github/workflows/testo.yml@master (feat(testo): test PHP 8.2-8.6 by default, add test-server input spiral/gh-actions#10) with test-server: true and dependencies: ["lowest","highest"], so the PHP matrix is the workflow default 8.2–8.6.
  • vimeo/psalm is widened to ^6 || ^7. Infection is removed from require-dev: the Testo adapter needs Infection 0.33+, which requires PHP 8.3; infection.json.dist now targets Testo, so the Infection Phar (it bundles the adapter) keeps composer test-mutations working.

Review notes

  • A throwing #[AfterTest] hook in Testo does not fail the test (it only goes to stderr). The MultiRPC relay-leak check from tearDown() therefore runs through a small AfterEachTest interceptor in tests/Goridge/Support, which fails the test like PHPUnit did.
  • Method attributes are inherited by overriding methods: #[ExpectException] on a base MultiRPC test also applies to the MsgPackMultiRPCTest override. The overridden base tests keep Expect::exception() in the body.
  • testHandleRelayDisconnectWithPressureForceUndiscovered called expectException() twice; PHPUnit keeps only the last one, Testo checks both. The dead first expectation was dropped.

Checklist

  • How was this tested:
    • Tests run locally against the Go test server (Docker): 183 tests under PHPUnit before, 183 under Testo after, same methods and data sets (JUnit comparison), highest and lowest dependencies
    • MessagePack tests checked locally only with a temporary local fix to MsgpackCodec (without ext-msgpack the rybakit/msgpack fallback always throws — a missing return); the fix is not part of this PR
    • CI on the new workflow: PHP 8.2–8.6, lowest and highest dependencies

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
The relay-count check that ran in `tearDown()` moved to a small `AfterEachTest` interceptor: a failing `#[AfterTest]` hook in Testo only writes to stderr and leaves the test green.

Infection is dropped from require-dev: the Testo adapter needs Infection 0.33+, which requires PHP 8.3. `infection.json.dist` targets Testo, so the Infection Phar (bundles the adapter) keeps `composer test-mutations` working.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 36a263c8-4027-493e-8185-e8829df76ea5

📥 Commits

Reviewing files that changed from the base of the PR and between f8080fa and 39727ef.


📒 Files selected for processing (18)
  • .gitattributes
  • .github/workflows/phpunit.yml
  • .github/workflows/testo.yml
  • composer.json
  • infection.json.dist
  • phpunit.xml
  • testo.php
  • tests/Goridge/FrameTest.php
  • tests/Goridge/MsgPackMultiRPCTest.php
  • tests/Goridge/MsgPackRPCTest.php
  • tests/Goridge/MultiRPC.php
  • tests/Goridge/MultiRelayHelperTest.php
  • tests/Goridge/RPC.php
  • tests/Goridge/SocketFactoryTest.php
  • tests/Goridge/StaticFactoryTest.php
  • tests/Goridge/StreamTest.php
  • tests/Goridge/Support/AfterEachTest.php
  • tests/Goridge/Support/AfterEachTestInterceptor.php

 _______________________________________________
< Finding more bugs than your brain at 4:00 pm. >
 -----------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@roxblnfk
roxblnfk merged commit 1dca0f0 into 4.x Oct 9, 2026
11 of 12 checks passed
@roxblnfk
roxblnfk deleted the testo branch October 9, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant