From 2926a39a61b8a976e91864d7c65cd7dfaba15c84 Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 16 Aug 2026 10:30:53 +0200 Subject: [PATCH 1/4] exclude timeout test from ci --- composer.json | 2 +- tests/CircuitBreakerTest.php | 19 ++++++++++++++++++- tests/ClientErrorTest.php | 9 ++++++++- tests/CurlTest.php | 32 ++++++++++++++++++++++++++++++++ tests/ExponentialBackoffTest.php | 27 ++++++++++++++++++++++++++- tests/FollowRedirectionsTest.php | 13 +++++++++++++ tests/LoggerTest.php | 7 ++++++- tests/RedirectionTest.php | 9 ++++++++- tests/ServerErrorTest.php | 9 ++++++++- tests/SuccessTest.php | 4 ++++ 10 files changed, 124 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 3b999e1..fc5aa1f 100644 --- a/composer.json +++ b/composer.json @@ -39,6 +39,6 @@ "require-dev": { "innmind/static-analysis": "~1.3", "innmind/coding-standard": "~2.0", - "innmind/black-box": "~6.5" + "innmind/black-box": "~6.12" } } diff --git a/tests/CircuitBreakerTest.php b/tests/CircuitBreakerTest.php index 7283b1a..a75f23f 100644 --- a/tests/CircuitBreakerTest.php +++ b/tests/CircuitBreakerTest.php @@ -24,10 +24,15 @@ Period, }; use Innmind\Immutable\Either; -use Innmind\BlackBox\PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\{ + TestCase, + Attributes\Group, +}; class CircuitBreakerTest extends TestCase { + #[Group('local')] + #[Group('ci')] public function testDoesntOpenCircuitOnSuccessfulResponse() { $request = Request::of( @@ -51,6 +56,8 @@ public function testDoesntOpenCircuitOnSuccessfulResponse() $this->assertEquals($expected, $fulfill($request)); } + #[Group('local')] + #[Group('ci')] public function testDoesntOpenCircuitOnRedirectionResponse() { $request = Request::of( @@ -74,6 +81,8 @@ public function testDoesntOpenCircuitOnRedirectionResponse() $this->assertEquals($expected, $fulfill($request)); } + #[Group('local')] + #[Group('ci')] public function testDoesntOpenCircuitOnClientErrorResponse() { $request = Request::of( @@ -97,6 +106,8 @@ public function testDoesntOpenCircuitOnClientErrorResponse() $this->assertEquals($expected, $fulfill($request)); } + #[Group('local')] + #[Group('ci')] public function testOpenCircuitOnServerError() { $request = Request::of( @@ -125,6 +136,8 @@ public function testOpenCircuitOnServerError() )); } + #[Group('local')] + #[Group('ci')] public function testOpenCircuitOnConnectionFailure() { $request = Request::of( @@ -149,6 +162,8 @@ public function testOpenCircuitOnConnectionFailure() )); } + #[Group('local')] + #[Group('ci')] public function testOpenCircuitOnlyForTheDomainThatFailed() { $request1 = Request::of( @@ -185,6 +200,8 @@ public function testOpenCircuitOnlyForTheDomainThatFailed() $this->assertEquals($expected2, $fulfill($request2)); } + #[Group('local')] + #[Group('ci')] public function testRecloseTheCircuitAfterTheSpecifiedDelay() { $request = Request::of( diff --git a/tests/ClientErrorTest.php b/tests/ClientErrorTest.php index 45edd53..3fb313c 100644 --- a/tests/ClientErrorTest.php +++ b/tests/ClientErrorTest.php @@ -13,10 +13,15 @@ }; use Innmind\Url\Url; use Innmind\Immutable\Sequence; -use Innmind\BlackBox\PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\{ + TestCase, + Attributes\Group, +}; class ClientErrorTest extends TestCase { + #[Group('local')] + #[Group('ci')] public function testAcceptClientErrorfulResponses() { $_ = Sequence::of(...StatusCode::cases()) @@ -38,6 +43,8 @@ public function testAcceptClientErrorfulResponses() }); } + #[Group('local')] + #[Group('ci')] public function testRejectOtherKindOfResponse() { $_ = Sequence::of(...StatusCode::cases()) diff --git a/tests/CurlTest.php b/tests/CurlTest.php index 4c1fd70..898c5bd 100644 --- a/tests/CurlTest.php +++ b/tests/CurlTest.php @@ -43,6 +43,7 @@ }; use Innmind\BlackBox\{ PHPUnit\Framework\TestCase, + PHPUnit\Framework\Attributes\Group, PHPUnit\BlackBox, Set, }; @@ -58,6 +59,8 @@ public function setUp(): void $this->curl = Transport::curl(Clock::live()); } + #[Group('local')] + #[Group('ci')] public function testOkResponse() { $success = ($this->curl)(Request::of( @@ -83,6 +86,8 @@ public function testOkResponse() ); } + #[Group('local')] + #[Group('ci')] public function testRedirection() { $redirection = ($this->curl)(Request::of( @@ -109,6 +114,8 @@ public function testRedirection() ); } + #[Group('local')] + #[Group('ci')] public function testClientError() { $error = ($this->curl)(Request::of( @@ -135,6 +142,8 @@ public function testClientError() ); } + #[Group('local')] + #[Group('ci')] public function testFailure() { $error = ($this->curl)($request = Request::of( @@ -157,6 +166,8 @@ public function testFailure() ); } + #[Group('local')] + #[Group('ci')] public function testResponseBody() { $success = ($this->curl)(Request::of( @@ -208,6 +219,8 @@ public function testResponseBody() ); } + #[Group('local')] + #[Group('ci')] public function testHead() { $success = ($this->curl)(Request::of( @@ -227,6 +240,8 @@ public function testHead() ); } + #[Group('local')] + #[Group('ci')] public function testPost(): BlackBox\Proof { return $this @@ -268,6 +283,8 @@ public function testPost(): BlackBox\Proof }); } + #[Group('local')] + #[Group('ci')] public function testPostLargeContent() { // The file is a bit more than 2Mo, so if everything was kept in memory @@ -304,6 +321,8 @@ public function testPostLargeContent() ->megaBytes(3); } + #[Group('local')] + #[Group('ci')] public function testMinorVersionOfProtocolMayNotBePresent() { // Packagist respond with HTTP/2 instead of HTTP/2.0 @@ -320,6 +339,8 @@ public function testMinorVersionOfProtocolMayNotBePresent() $this->assertSame(ProtocolVersion::v20, $success->protocolVersion()); } + #[Group('local')] + #[Group('ci')] public function testConcurrency() { $request = Request::of( @@ -355,6 +376,8 @@ public function testConcurrency() ->seconds((int) \ceil(2 * $forOneRequest)); } + #[Group('local')] + #[Group('ci')] public function testMaxConcurrency() { $curl = $this->curl->map(static fn($config) => $config->limitConcurrencyTo(1)); @@ -395,6 +418,8 @@ public function testMaxConcurrency() ->seconds((int) (2 * $forOneRequest)); } + #[Group('local')] + #[Group('ci')] public function testHeartbeat() { $heartbeat = 0; @@ -419,6 +444,8 @@ static function() use (&$heartbeat) { $this->assertGreaterThan(1, $heartbeat); } + #[Group('local')] + #[Group('ci')] public function testOutOfOrderUnwrapWithMaxConcurrency() { $curl = $this->curl->map(static fn($config) => $config->limitConcurrencyTo(2)); @@ -444,6 +471,8 @@ public function testOutOfOrderUnwrapWithMaxConcurrency() ); } + #[Group('local')] + #[Group('ci')] public function testSubsequentRequestsAreCalledCorrectlyInsideFlatMaps() { $curl = $this->curl->map(static fn($config) => $config->limitConcurrencyTo(2)); @@ -471,6 +500,8 @@ public function testSubsequentRequestsAreCalledCorrectlyInsideFlatMaps() ); } + #[Group('local')] + #[Group('ci')] public function testReleaseResources() { $initialCount = \count(\get_resources('stream')); @@ -496,6 +527,7 @@ public function testReleaseResources() $this->assertSame($initialCount, \count(\get_resources('stream'))); } + #[Group('local')] public function testTimeout() { foreach (['bin', 'bun'] as $server) { diff --git a/tests/ExponentialBackoffTest.php b/tests/ExponentialBackoffTest.php index f881f83..f360ecd 100644 --- a/tests/ExponentialBackoffTest.php +++ b/tests/ExponentialBackoffTest.php @@ -31,10 +31,15 @@ Attempt, SideEffect, }; -use Innmind\BlackBox\PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\{ + TestCase, + Attributes\Group, +}; class ExponentialBackoffTest extends TestCase { + #[Group('local')] + #[Group('ci')] public function testDoesntRetryWhenInformationResponseOnFirstCall() { $request = Request::of( @@ -56,6 +61,8 @@ public function testDoesntRetryWhenInformationResponseOnFirstCall() $this->assertEquals($expected, $fulfill($request)); } + #[Group('local')] + #[Group('ci')] public function testDoesntRetryWhenSuccessfulResponseOnFirstCall() { $request = Request::of( @@ -77,6 +84,8 @@ public function testDoesntRetryWhenSuccessfulResponseOnFirstCall() $this->assertEquals($expected, $fulfill($request)); } + #[Group('local')] + #[Group('ci')] public function testDoesntRetryWhenRedirectionResponseOnFirstCall() { $request = Request::of( @@ -98,6 +107,8 @@ public function testDoesntRetryWhenRedirectionResponseOnFirstCall() $this->assertEquals($expected, $fulfill($request)); } + #[Group('local')] + #[Group('ci')] public function testDoesntRetryWhenClientErrorResponseOnFirstCall() { $request = Request::of( @@ -119,6 +130,8 @@ public function testDoesntRetryWhenClientErrorResponseOnFirstCall() $this->assertEquals($expected, $fulfill($request)); } + #[Group('local')] + #[Group('ci')] public function testDoesntRetryWhenMalformedResponseOnFirstCall() { $request = Request::of( @@ -136,6 +149,8 @@ public function testDoesntRetryWhenMalformedResponseOnFirstCall() $this->assertEquals($expected, $fulfill($request)); } + #[Group('local')] + #[Group('ci')] public function testDoesntRetryWhenFailureOnFirstCall() { $request = Request::of( @@ -153,6 +168,8 @@ public function testDoesntRetryWhenFailureOnFirstCall() $this->assertEquals($expected, $fulfill($request)); } + #[Group('local')] + #[Group('ci')] public function testRetryWhileThereIsStillATooManyRequestsError() { $request = Request::of( @@ -195,6 +212,8 @@ public function testRetryWhileThereIsStillATooManyRequestsError() $this->assertSame(12, $calls); } + #[Group('local')] + #[Group('ci')] public function testRetryWhileThereIsStillAServerError() { $request = Request::of( @@ -237,6 +256,8 @@ public function testRetryWhileThereIsStillAServerError() $this->assertSame(12, $calls); } + #[Group('local')] + #[Group('ci')] public function testRetryWhileThereIsStillAConnectionFailure() { $request = Request::of( @@ -275,6 +296,8 @@ public function testRetryWhileThereIsStillAConnectionFailure() $this->assertSame(12, $calls); } + #[Group('local')] + #[Group('ci')] public function testStopRetryingWhenNoLongerReceivingAServerError() { $request = Request::of( @@ -317,6 +340,8 @@ public function testStopRetryingWhenNoLongerReceivingAServerError() $this->assertSame(2, $calls); } + #[Group('local')] + #[Group('ci')] public function testByDefaultRetriesFiveTimesByUsingAPowerOfE() { $request = Request::of( diff --git a/tests/FollowRedirectionsTest.php b/tests/FollowRedirectionsTest.php index 6bb8afa..8b139fb 100644 --- a/tests/FollowRedirectionsTest.php +++ b/tests/FollowRedirectionsTest.php @@ -31,6 +31,7 @@ use Innmind\Immutable\Either; use Innmind\BlackBox\{ PHPUnit\Framework\TestCase, + PHPUnit\Framework\Attributes\Group, PHPUnit\BlackBox, Set, }; @@ -40,6 +41,8 @@ class FollowRedirectionsTest extends TestCase { use BlackBox; + #[Group('local')] + #[Group('ci')] public function testDoesntModifyNonRedirectionResults(): BlackBox\Proof { $request = Request::of( @@ -98,6 +101,8 @@ public function testDoesntModifyNonRedirectionResults(): BlackBox\Proof }); } + #[Group('local')] + #[Group('ci')] public function testRedirectMaximum5Times(): BlackBox\Proof { return $this @@ -155,6 +160,8 @@ public function testRedirectMaximum5Times(): BlackBox\Proof }); } + #[Group('local')] + #[Group('ci')] public function testDoesntRedirectWhenNoLocationHeader(): BlackBox\Proof { return $this @@ -196,6 +203,8 @@ public function testDoesntRedirectWhenNoLocationHeader(): BlackBox\Proof }); } + #[Group('local')] + #[Group('ci')] public function testRedirectSeeOther(): BlackBox\Proof { return $this @@ -270,6 +279,8 @@ public function testRedirectSeeOther(): BlackBox\Proof }); } + #[Group('local')] + #[Group('ci')] public function testRedirect(): BlackBox\Proof { return $this @@ -350,6 +361,8 @@ public function testRedirect(): BlackBox\Proof }); } + #[Group('local')] + #[Group('ci')] public function testDoesntRedirectUnsafeMethods(): BlackBox\Proof { return $this diff --git a/tests/LoggerTest.php b/tests/LoggerTest.php index 90c7f3b..4a47598 100644 --- a/tests/LoggerTest.php +++ b/tests/LoggerTest.php @@ -18,7 +18,10 @@ }; use Innmind\Url\Url; use Psr\Log\NullLogger; -use Innmind\BlackBox\PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\{ + TestCase, + Attributes\Group, +}; class LoggerTest extends TestCase { @@ -32,6 +35,8 @@ public function setUp(): void ); } + #[Group('local')] + #[Group('ci')] public function testFulfill() { $request = Request::of( diff --git a/tests/RedirectionTest.php b/tests/RedirectionTest.php index f74db54..53acd1e 100644 --- a/tests/RedirectionTest.php +++ b/tests/RedirectionTest.php @@ -13,10 +13,15 @@ }; use Innmind\Url\Url; use Innmind\Immutable\Sequence; -use Innmind\BlackBox\PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\{ + TestCase, + Attributes\Group, +}; class RedirectionTest extends TestCase { + #[Group('local')] + #[Group('ci')] public function testAcceptRedirectionfulResponses() { $_ = Sequence::of(...StatusCode::cases()) @@ -38,6 +43,8 @@ public function testAcceptRedirectionfulResponses() }); } + #[Group('local')] + #[Group('ci')] public function testRejectOtherKindOfResponse() { $_ = Sequence::of(...StatusCode::cases()) diff --git a/tests/ServerErrorTest.php b/tests/ServerErrorTest.php index 6d7d66b..7105310 100644 --- a/tests/ServerErrorTest.php +++ b/tests/ServerErrorTest.php @@ -13,10 +13,15 @@ }; use Innmind\Url\Url; use Innmind\Immutable\Sequence; -use Innmind\BlackBox\PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\{ + TestCase, + Attributes\Group, +}; class ServerErrorTest extends TestCase { + #[Group('local')] + #[Group('ci')] public function testAcceptServerErrorfulResponses() { $_ = Sequence::of(...StatusCode::cases()) @@ -38,6 +43,8 @@ public function testAcceptServerErrorfulResponses() }); } + #[Group('local')] + #[Group('ci')] public function testRejectOtherKindOfResponse() { $_ = Sequence::of(...StatusCode::cases()) diff --git a/tests/SuccessTest.php b/tests/SuccessTest.php index b397bf8..eb2e122 100644 --- a/tests/SuccessTest.php +++ b/tests/SuccessTest.php @@ -17,6 +17,8 @@ class SuccessTest extends TestCase { + #[Group('local')] + #[Group('ci')] public function testAcceptSuccessfulResponses() { $_ = Sequence::of(...StatusCode::cases()) @@ -38,6 +40,8 @@ public function testAcceptSuccessfulResponses() }); } + #[Group('local')] + #[Group('ci')] public function testRejectOtherKindOfResponse() { $_ = Sequence::of(...StatusCode::cases()) From c9135e14578cc08798271a37264235196d1c799e Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 16 Aug 2026 10:33:49 +0200 Subject: [PATCH 2/4] specify only the ci tag must be run --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17789c4..f07f940 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,7 @@ jobs: uses: innmind/github-workflows/.github/workflows/black-box-matrix.yml@main with: scenarii: 20 + tags: ci coverage: uses: innmind/github-workflows/.github/workflows/coverage-matrix.yml@main secrets: inherit From 60d7dfd7e3358d57a5211eae4c1c9c1287e32b23 Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 16 Aug 2026 10:35:43 +0200 Subject: [PATCH 3/4] specify only the ci tag must be run for coverage job --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f07f940..35f96e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,8 @@ jobs: coverage: uses: innmind/github-workflows/.github/workflows/coverage-matrix.yml@main secrets: inherit + with: + tags: ci psalm: uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@main cs: From 97af5d432d5a8a83472b5699e196f5057416a661 Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 16 Aug 2026 10:38:51 +0200 Subject: [PATCH 4/4] add missing use statement --- tests/SuccessTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/SuccessTest.php b/tests/SuccessTest.php index eb2e122..ec058ca 100644 --- a/tests/SuccessTest.php +++ b/tests/SuccessTest.php @@ -13,7 +13,10 @@ }; use Innmind\Url\Url; use Innmind\Immutable\Sequence; -use Innmind\BlackBox\PHPUnit\Framework\TestCase; +use Innmind\BlackBox\PHPUnit\Framework\{ + TestCase, + Attributes\Group, +}; class SuccessTest extends TestCase {