Skip to content

ci: add compact option for tests#45

Open
misaert wants to merge 1 commit into
mainfrom
ci-tests-compact
Open

ci: add compact option for tests#45
misaert wants to merge 1 commit into
mainfrom
ci-tests-compact

Conversation

@misaert
Copy link
Copy Markdown
Collaborator

@misaert misaert commented Feb 13, 2026

It permits to have a compact text for tests like:

Run vendor/bin/pest --testsuite='Unit tests' --compact --coverage --coverage-clover=coverage.xml
  
2026-02-13 13:46:58.386 Listening on http://127.0.0.1:8081
  !.......................................!!!!.!.....!.......2026-02-13 13:46:58.498 - "POST /.well-known/mercure HTTP/1.1" 201 26 0.000
2026-02-13 13:46:58.504 - "POST /.well-known/mercure HTTP/1.1" 201 26 0.000
2026-02-13 13:46:58.508 - "POST /.well-known/mercure HTTP/1.1" 403 54 0.000
2026-02-13 13:46:58.523 - "POST /.well-known/mercure HTTP/1.1" 503 0 0.000
2026-02-13 13:46:58.526 - "POST /.well-known/mercure HTTP/1.1" 504 0 0.000
.................
  ..2026-02-13 13:46:58.592 - "POST ./well-known/mercure HTTP/1.1" 200 0 0.000
2026-02-13 13:46:58.593 - "POST ./well-known/mercure HTTP/1.1" 200 0 0.000
..2026-02-13 13:46:58.596 - "POST ./well-known/mercure HTTP/1.1" 204 0 0.000
2026-02-13 13:46:58.596 - "POST ./well-known/mercure HTTP/1.1" 403 5 0.000
.2026-02-13 13:46:58.601 - "GET / HTTP/1.1" 204 0 0.000
2026-02-13 13:46:58.602 - "GET / HTTP/1.1" 204 0 0.000
...........ss..........................................................
  ...
  Tests:    7 deprecated, 2 skipped, 146 passed (211 assertions)
  Duration: 0.57s
  ────────────────────────────────────────────────────────────────────────────  
                                                                Total: 100.0 %  

@misaert misaert requested a review from bpolaszek February 13, 2026 13:46
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ec6ea31) to head (c44e5c2).

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #45   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity       165       165           
===========================================
  Files             27        27           
  Lines            437       437           
===========================================
  Hits             437       437           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bpolaszek
Copy link
Copy Markdown
Owner

I actually prefer the (current) testdox option since it helps better spotting of failed tests (and what tests were ran priorily).
Why would you advocate for this format?

@misaert
Copy link
Copy Markdown
Collaborator Author

misaert commented Feb 13, 2026

Even with compact, we have the failed tests:

$ vendor/bin/pest --testsuite='Unit tests' --compact
2026-02-13 16:37:23.229 Listening on http://127.0.0.1:8081

  !.......................................!!!!.!.....!.......2026-02-13 16:37:23.259 - "POST /.well-known/mercure HTTP/1.1" 201 26 0.000
2026-02-13 16:37:23.261 - "POST /.well-known/mercure HTTP/1.1" 201 26 0.000
2026-02-13 16:37:23.264 - "POST /.well-known/mercure HTTP/1.1" 403 54 0.000
2026-02-13 16:37:23.273 - "POST /.well-known/mercure HTTP/1.1" 503 0 0.000
2026-02-13 16:37:23.275 - "POST /.well-known/mercure HTTP/1.1" 504 0 0.000
...................2026-02-13 16:37:23.318 - "POST ./well-known/mercure HTTP/1.1" 200 0 0.000
2026-02-13 16:37:23.319 - "POST ./well-known/mercure HTTP/1.1" 200 0 0.000
..2026-02-13 16:37:23.320 - "POST ./well-known/mercure HTTP/1.1" 204 0 0.000
2026-02-13 16:37:23.320 - "POST ./well-known/mercure HTTP/1.1" 403 5 0.000
.2026-02-13 16:37:23.323 - "GET / HTTP/1.1" 204 0 0.000
2026-02-13 16:37:23.323 - "GET / HTTP/1.1" 204 0 0.000
...........ss.........................................................⨯⨯⨯⨯
  ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────  
   FAILED  Tests\Unit\Security\JWT\Extractor\QueryTokenExtractorTest > it extracts token from authorization query parameter with ('/.well-known/mercure?authoriz…vl…   
  Expecting 'eyJhbGciOiJIUzI1NiIsInR5cCI6I…vlj80A' not to be 'eyJhbGciOiJIUzI1NiIsInR5cCI6I…vlj80A'.

  at tests/Unit/Security/JWT/Extractor/QueryTokenExtractorTest.php:13
      9▕ 
     10▕ it('extracts token from authorization query parameter', function (string $uri, ?string $expected) {
     11▕     $extractor = new QueryTokenExtractor();
     12▕     $request = new ServerRequest('GET', $uri);
  ➜  13▕     expect($extractor->extract($request))->not->toBe($expected);
     14▕ })->with(function () {
     15▕     $validToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30._esyynAyo2Z6PyGe0mM_SuQ3c-C7sMQJ1YxVLvlj80A';
     16▕ 
     17▕     yield ['/.well-known/mercure?authorization=' . $validToken, $validToken];

  1   tests/Unit/Security/JWT/Extractor/QueryTokenExtractorTest.php:13

  ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────  
   FAILED  Tests\Unit\Security\JWT\Extractor\QueryTokenExtractorTest > it extracts token from authorization query parameter with ('/.well-known/mercure?authorizati…   
  Expecting null not to be null.

  at tests/Unit/Security/JWT/Extractor/QueryTokenExtractorTest.php:13
      9▕ 
     10▕ it('extracts token from authorization query parameter', function (string $uri, ?string $expected) {
     11▕     $extractor = new QueryTokenExtractor();
     12▕     $request = new ServerRequest('GET', $uri);
  ➜  13▕     expect($extractor->extract($request))->not->toBe($expected);
     14▕ })->with(function () {
     15▕     $validToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30._esyynAyo2Z6PyGe0mM_SuQ3c-C7sMQJ1YxVLvlj80A';
     16▕ 
     17▕     yield ['/.well-known/mercure?authorization=' . $validToken, $validToken];

  1   tests/Unit/Security/JWT/Extractor/QueryTokenExtractorTest.php:13

  ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────  
   FAILED  Tests\Unit\Security\JWT\Extractor\QueryTokenExtractorTest > it extracts token from authorization query parameter with ('/.well-known/mercure?authorizati…   
  Expecting null not to be null.

  at tests/Unit/Security/JWT/Extractor/QueryTokenExtractorTest.php:13
      9▕ 
     10▕ it('extracts token from authorization query parameter', function (string $uri, ?string $expected) {
     11▕     $extractor = new QueryTokenExtractor();
     12▕     $request = new ServerRequest('GET', $uri);
  ➜  13▕     expect($extractor->extract($request))->not->toBe($expected);
     14▕ })->with(function () {
     15▕     $validToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30._esyynAyo2Z6PyGe0mM_SuQ3c-C7sMQJ1YxVLvlj80A';
     16▕ 
     17▕     yield ['/.well-known/mercure?authorization=' . $validToken, $validToken];

  1   tests/Unit/Security/JWT/Extractor/QueryTokenExtractorTest.php:13

  ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────  
   FAILED  Tests\Unit\Security\JWT\Extractor\QueryTokenExtractorTest > it extracts token from authorization query parameter with ('/.well-known/mercure', null)        
  Expecting null not to be null.

  at tests/Unit/Security/JWT/Extractor/QueryTokenExtractorTest.php:13
      9▕ 
     10▕ it('extracts token from authorization query parameter', function (string $uri, ?string $expected) {
     11▕     $extractor = new QueryTokenExtractor();
     12▕     $request = new ServerRequest('GET', $uri);
  ➜  13▕     expect($extractor->extract($request))->not->toBe($expected);
     14▕ })->with(function () {
     15▕     $validToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30._esyynAyo2Z6PyGe0mM_SuQ3c-C7sMQJ1YxVLvlj80A';
     16▕ 
     17▕     yield ['/.well-known/mercure?authorization=' . $validToken, $validToken];

  1   tests/Unit/Security/JWT/Extractor/QueryTokenExtractorTest.php:13


  Tests:    7 deprecated, 4 failed, 2 skipped, 142 passed (211 assertions)
  Duration: 0.22s

I think it is clearer to see only the failed ones on CI.

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.

2 participants