From a3796daa420842d1cc3859352b594cee8d691692 Mon Sep 17 00:00:00 2001 From: nuno maduro Date: Sun, 3 May 2026 13:24:10 +0100 Subject: [PATCH] wip --- src/Plugins/Tia.php | 6 +-- .../collision_with_data_set_________.snap | 2 + tests/.pest/snapshots/Visual/Todo/todo.snap | 2 + .../Visual/Todo/todo_in_parallel.snap | 2 + tests/.pest/snapshots/Visual/Todo/todos.snap | 2 + .../Visual/Todo/todos_in_parallel.snap | 2 + tests/.snapshots/Failure.php.inc | 30 ++++++++++++++ tests/.snapshots/SuccessOnly.php.inc | 21 ++++++++++ tests/.snapshots/success.txt | 41 ++++++++++++++++++- tests/Visual/Parallel.php | 5 ++- 10 files changed, 107 insertions(+), 6 deletions(-) diff --git a/src/Plugins/Tia.php b/src/Plugins/Tia.php index b6429bd5..6a998948 100644 --- a/src/Plugins/Tia.php +++ b/src/Plugins/Tia.php @@ -1005,9 +1005,9 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable private function emitCoverageDriverMissing(): void { - $this->renderBadge('WARN', 'No coverage driver is available — skipped.'); - $this->renderChild('Needs ext-pcov or Xdebug with coverage mode enabled to record the dependency graph.'); - $this->renderChild('Install or enable one and rerun with --tia.'); + $this->output->writeln(''); + + $this->renderChild('Running in TIA mode, however TIA as skipped as it needs Needs ext-pcov or Xdebug.'); } /** diff --git a/tests/.pest/snapshots/Visual/Collision/collision_with_data_set_________.snap b/tests/.pest/snapshots/Visual/Collision/collision_with_data_set_________.snap index 1bc29248..f1d62c46 100644 --- a/tests/.pest/snapshots/Visual/Collision/collision_with_data_set_________.snap +++ b/tests/.pest/snapshots/Visual/Collision/collision_with_data_set_________.snap @@ -1,4 +1,6 @@ + ─ Running in TIA mode, however TIA as skipped as it needs Needs ext-pcov or Xdebug. + FAIL Tests\Fixtures\CollisionTest ⨯ error ✓ success diff --git a/tests/.pest/snapshots/Visual/Todo/todo.snap b/tests/.pest/snapshots/Visual/Todo/todo.snap index 09710340..3ac2a538 100644 --- a/tests/.pest/snapshots/Visual/Todo/todo.snap +++ b/tests/.pest/snapshots/Visual/Todo/todo.snap @@ -1,4 +1,6 @@ + ─ Running in TIA mode, however TIA as skipped as it needs Needs ext-pcov or Xdebug. + TODO Tests\Features\BeforeEachProxiesToTestCallWithTodo - 4 todos ↓ is marked as todo 1 ↓ is marked as todo 2 diff --git a/tests/.pest/snapshots/Visual/Todo/todo_in_parallel.snap b/tests/.pest/snapshots/Visual/Todo/todo_in_parallel.snap index 09710340..3ac2a538 100644 --- a/tests/.pest/snapshots/Visual/Todo/todo_in_parallel.snap +++ b/tests/.pest/snapshots/Visual/Todo/todo_in_parallel.snap @@ -1,4 +1,6 @@ + ─ Running in TIA mode, however TIA as skipped as it needs Needs ext-pcov or Xdebug. + TODO Tests\Features\BeforeEachProxiesToTestCallWithTodo - 4 todos ↓ is marked as todo 1 ↓ is marked as todo 2 diff --git a/tests/.pest/snapshots/Visual/Todo/todos.snap b/tests/.pest/snapshots/Visual/Todo/todos.snap index 09710340..3ac2a538 100644 --- a/tests/.pest/snapshots/Visual/Todo/todos.snap +++ b/tests/.pest/snapshots/Visual/Todo/todos.snap @@ -1,4 +1,6 @@ + ─ Running in TIA mode, however TIA as skipped as it needs Needs ext-pcov or Xdebug. + TODO Tests\Features\BeforeEachProxiesToTestCallWithTodo - 4 todos ↓ is marked as todo 1 ↓ is marked as todo 2 diff --git a/tests/.pest/snapshots/Visual/Todo/todos_in_parallel.snap b/tests/.pest/snapshots/Visual/Todo/todos_in_parallel.snap index 09710340..3ac2a538 100644 --- a/tests/.pest/snapshots/Visual/Todo/todos_in_parallel.snap +++ b/tests/.pest/snapshots/Visual/Todo/todos_in_parallel.snap @@ -1,4 +1,6 @@ + ─ Running in TIA mode, however TIA as skipped as it needs Needs ext-pcov or Xdebug. + TODO Tests\Features\BeforeEachProxiesToTestCallWithTodo - 4 todos ↓ is marked as todo 1 ↓ is marked as todo 2 diff --git a/tests/.snapshots/Failure.php.inc b/tests/.snapshots/Failure.php.inc index efd42309..60ebd0a6 100644 --- a/tests/.snapshots/Failure.php.inc +++ b/tests/.snapshots/Failure.php.inc @@ -1,28 +1,58 @@ + + ─ Running in TIA mode, however TIA as skipped as it needs Needs ext-pcov or Xdebug. +##teamcity[testSuiteStarted name='Tests/tests/Failure' locationHint='pest_qn://tests/.tests/Failure.php' flowId='1234'] +##teamcity[testCount count='8' flowId='1234'] ##teamcity[testSuiteStarted name='Tests/tests/Failure' locationHint='pest_qn://tests/.tests/Failure.php' flowId='1234'] ##teamcity[testCount count='8' flowId='1234'] ##teamcity[testStarted name='it can fail with comparison' locationHint='pest_qn://tests/.tests/Failure.php::it can fail with comparison' flowId='1234'] +##teamcity[testStarted name='it can fail with comparison' locationHint='pest_qn://tests/.tests/Failure.php::it can fail with comparison' flowId='1234'] +##teamcity[testFailed name='it can fail with comparison' message='Failed asserting that true matches expected false.' details='at tests/.tests/Failure.php:6' type='comparisonFailure' actual='true' expected='false' flowId='1234'] ##teamcity[testFailed name='it can fail with comparison' message='Failed asserting that true matches expected false.' details='at tests/.tests/Failure.php:6' type='comparisonFailure' actual='true' expected='false' flowId='1234'] ##teamcity[testFinished name='it can fail with comparison' duration='100000' flowId='1234'] +##teamcity[testFinished name='it can fail with comparison' duration='100000' flowId='1234'] +##teamcity[testStarted name='it can be ignored because of no assertions' locationHint='pest_qn://tests/.tests/Failure.php::it can be ignored because of no assertions' flowId='1234'] ##teamcity[testStarted name='it can be ignored because of no assertions' locationHint='pest_qn://tests/.tests/Failure.php::it can be ignored because of no assertions' flowId='1234'] ##teamcity[testIgnored name='it can be ignored because of no assertions' message='This test did not perform any assertions' details='' flowId='1234'] +##teamcity[testIgnored name='it can be ignored because of no assertions' message='This test did not perform any assertions' details='' flowId='1234'] +##teamcity[testFinished name='it can be ignored because of no assertions' duration='100000' flowId='1234'] ##teamcity[testFinished name='it can be ignored because of no assertions' duration='100000' flowId='1234'] ##teamcity[testStarted name='it can be ignored because it is skipped' locationHint='pest_qn://tests/.tests/Failure.php::it can be ignored because it is skipped' flowId='1234'] +##teamcity[testStarted name='it can be ignored because it is skipped' locationHint='pest_qn://tests/.tests/Failure.php::it can be ignored because it is skipped' flowId='1234'] +##teamcity[testIgnored name='it can be ignored because it is skipped' message='This test was ignored.' details='' flowId='1234'] ##teamcity[testIgnored name='it can be ignored because it is skipped' message='This test was ignored.' details='' flowId='1234'] ##teamcity[testFinished name='it can be ignored because it is skipped' duration='100000' flowId='1234'] +##teamcity[testFinished name='it can be ignored because it is skipped' duration='100000' flowId='1234'] +##teamcity[testStarted name='it can fail' locationHint='pest_qn://tests/.tests/Failure.php::it can fail' flowId='1234'] ##teamcity[testStarted name='it can fail' locationHint='pest_qn://tests/.tests/Failure.php::it can fail' flowId='1234'] ##teamcity[testFailed name='it can fail' message='oh noo' details='at tests/.tests/Failure.php:18' flowId='1234'] +##teamcity[testFailed name='it can fail' message='oh noo' details='at tests/.tests/Failure.php:18' flowId='1234'] +##teamcity[testFinished name='it can fail' duration='100000' flowId='1234'] ##teamcity[testFinished name='it can fail' duration='100000' flowId='1234'] ##teamcity[testStarted name='it throws exception' locationHint='pest_qn://tests/.tests/Failure.php::it throws exception' flowId='1234'] +##teamcity[testStarted name='it throws exception' locationHint='pest_qn://tests/.tests/Failure.php::it throws exception' flowId='1234'] +##teamcity[testFailed name='it throws exception' message='Exception: test error' details='at tests/.tests/Failure.php:22' flowId='1234'] ##teamcity[testFailed name='it throws exception' message='Exception: test error' details='at tests/.tests/Failure.php:22' flowId='1234'] ##teamcity[testFinished name='it throws exception' duration='100000' flowId='1234'] +##teamcity[testFinished name='it throws exception' duration='100000' flowId='1234'] +##teamcity[testStarted name='it is not done yet' locationHint='pest_qn://tests/.tests/Failure.php::it is not done yet' flowId='1234'] ##teamcity[testStarted name='it is not done yet' locationHint='pest_qn://tests/.tests/Failure.php::it is not done yet' flowId='1234'] ##teamcity[testFinished name='it is not done yet' duration='100000' flowId='1234'] +##teamcity[testFinished name='it is not done yet' duration='100000' flowId='1234'] +##teamcity[testStarted name='build this one.' locationHint='pest_qn://tests/.tests/Failure.php::build this one.' flowId='1234'] ##teamcity[testStarted name='build this one.' locationHint='pest_qn://tests/.tests/Failure.php::build this one.' flowId='1234'] ##teamcity[testFinished name='build this one.' duration='100000' flowId='1234'] +##teamcity[testFinished name='build this one.' duration='100000' flowId='1234'] +##teamcity[testStarted name='it is passing' locationHint='pest_qn://tests/.tests/Failure.php::it is passing' flowId='1234'] ##teamcity[testStarted name='it is passing' locationHint='pest_qn://tests/.tests/Failure.php::it is passing' flowId='1234'] ##teamcity[testFinished name='it is passing' duration='100000' flowId='1234'] +##teamcity[testFinished name='it is passing' duration='100000' flowId='1234'] +##teamcity[testSuiteFinished name='Tests/tests/Failure' flowId='1234'] ##teamcity[testSuiteFinished name='Tests/tests/Failure' flowId='1234'] Tests: 3 failed, 1 risky, 2 todos, 1 skipped, 1 passed (3 assertions) Duration: 1.00s + + Tests: 3 failed, 1 risky, 2 todos, 1 skipped, 1 passed (3 assertions) + Duration: 1.00s + diff --git a/tests/.snapshots/SuccessOnly.php.inc b/tests/.snapshots/SuccessOnly.php.inc index b940b7b6..ca616f71 100644 --- a/tests/.snapshots/SuccessOnly.php.inc +++ b/tests/.snapshots/SuccessOnly.php.inc @@ -1,19 +1,40 @@ + + ─ Running in TIA mode, however TIA as skipped as it needs Needs ext-pcov or Xdebug. +##teamcity[testSuiteStarted name='Tests/tests/SuccessOnly' locationHint='pest_qn://tests/.tests/SuccessOnly.php' flowId='1234'] +##teamcity[testCount count='4' flowId='1234'] ##teamcity[testSuiteStarted name='Tests/tests/SuccessOnly' locationHint='pest_qn://tests/.tests/SuccessOnly.php' flowId='1234'] ##teamcity[testCount count='4' flowId='1234'] ##teamcity[testStarted name='it can pass with comparison' locationHint='pest_qn://tests/.tests/SuccessOnly.php::it can pass with comparison' flowId='1234'] +##teamcity[testStarted name='it can pass with comparison' locationHint='pest_qn://tests/.tests/SuccessOnly.php::it can pass with comparison' flowId='1234'] +##teamcity[testFinished name='it can pass with comparison' duration='100000' flowId='1234'] ##teamcity[testFinished name='it can pass with comparison' duration='100000' flowId='1234'] ##teamcity[testStarted name='can also pass' locationHint='pest_qn://tests/.tests/SuccessOnly.php::can also pass' flowId='1234'] +##teamcity[testStarted name='can also pass' locationHint='pest_qn://tests/.tests/SuccessOnly.php::can also pass' flowId='1234'] +##teamcity[testFinished name='can also pass' duration='100000' flowId='1234'] ##teamcity[testFinished name='can also pass' duration='100000' flowId='1234'] ##teamcity[testSuiteStarted name='can pass with dataset' locationHint='pest_qn://tests/.tests/SuccessOnly.php::can pass with dataset' flowId='1234'] +##teamcity[testSuiteStarted name='can pass with dataset' locationHint='pest_qn://tests/.tests/SuccessOnly.php::can pass with dataset' flowId='1234'] +##teamcity[testStarted name='can pass with dataset with data set "(true)"' locationHint='pest_qn://tests/.tests/SuccessOnly.php::can pass with dataset with data set "(true)"' flowId='1234'] ##teamcity[testStarted name='can pass with dataset with data set "(true)"' locationHint='pest_qn://tests/.tests/SuccessOnly.php::can pass with dataset with data set "(true)"' flowId='1234'] ##teamcity[testFinished name='can pass with dataset with data set "(true)"' duration='100000' flowId='1234'] +##teamcity[testFinished name='can pass with dataset with data set "(true)"' duration='100000' flowId='1234'] +##teamcity[testSuiteFinished name='can pass with dataset' flowId='1234'] ##teamcity[testSuiteFinished name='can pass with dataset' flowId='1234'] ##teamcity[testSuiteStarted name='`block` → can pass with dataset in describe block' locationHint='pest_qn://tests/.tests/SuccessOnly.php::`block` → can pass with dataset in describe block' flowId='1234'] +##teamcity[testSuiteStarted name='`block` → can pass with dataset in describe block' locationHint='pest_qn://tests/.tests/SuccessOnly.php::`block` → can pass with dataset in describe block' flowId='1234'] +##teamcity[testStarted name='`block` → can pass with dataset in describe block with data set "(1)"' locationHint='pest_qn://tests/.tests/SuccessOnly.php::`block` → can pass with dataset in describe block with data set "(1)"' flowId='1234'] ##teamcity[testStarted name='`block` → can pass with dataset in describe block with data set "(1)"' locationHint='pest_qn://tests/.tests/SuccessOnly.php::`block` → can pass with dataset in describe block with data set "(1)"' flowId='1234'] ##teamcity[testFinished name='`block` → can pass with dataset in describe block with data set "(1)"' duration='100000' flowId='1234'] +##teamcity[testFinished name='`block` → can pass with dataset in describe block with data set "(1)"' duration='100000' flowId='1234'] ##teamcity[testSuiteFinished name='`block` → can pass with dataset in describe block' flowId='1234'] +##teamcity[testSuiteFinished name='`block` → can pass with dataset in describe block' flowId='1234'] +##teamcity[testSuiteFinished name='Tests/tests/SuccessOnly' flowId='1234'] ##teamcity[testSuiteFinished name='Tests/tests/SuccessOnly' flowId='1234'] Tests: 4 passed (4 assertions) Duration: 1.00s + + Tests: 4 passed (4 assertions) + Duration: 1.00s + diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index 547d190e..d7ab6609 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -1,4 +1,6 @@ + ─ Running in TIA mode, however TIA as skipped as it needs Needs ext-pcov or Xdebug. + PASS Tests\Arch ✓ preset → php → ignoring ['Pest\Expectation', 'debug_backtrace', 'var_export', …] ✓ preset → strict → ignoring ['Pest\Plugins\Tia\BaselineSync', 'usleep'] @@ -1716,6 +1718,43 @@ PASS Tests\Unit\Plugins\Retry ✓ it orders by defects and stop on defects if when --retry is used + PASS Tests\Unit\Plugins\Tia\ContentHash + ✓ of() → it returns false when file does not exist + ✓ of() → it hashes an existing file + ✓ PHP files → it produces the same hash regardless of whitespace differences + ✓ PHP files → it ignores single-line comments + ✓ PHP files → it ignores hash-style comments + ✓ PHP files → it ignores multi-line comments + ✓ PHP files → it ignores doc comments + ✓ PHP files → it detects code changes + ✓ PHP files → it preserves whitespace inside string literals + ✓ PHP files → it treats variable renames as a change + ✓ PHP files → it falls back to a raw hash for unparseable PHP + ✓ PHP files → it is case-insensitive on the file extension + ✓ Blade files → it strips blade comments + ✓ Blade files → it strips multi-line blade comments + ✓ Blade files → it collapses whitespace + ✓ Blade files → it detects content changes + ✓ Blade files → it keeps blade directives intact + ✓ Blade files → it does not use the PHP tokenizer for blade files + ✓ JavaScript-like files → it strips line comments + ✓ JavaScript-like files → it strips block comments on their own lines + ✓ JavaScript-like files → it collapses whitespace + ✓ JavaScript-like files → it detects code changes + ✓ JavaScript-like files → it does not strip inline trailing comments + ✓ JavaScript-like files → it applies the same rules to .ts files + ✓ JavaScript-like files → it applies the same rules to .tsx files + ✓ JavaScript-like files → it applies the same rules to .jsx files + ✓ JavaScript-like files → it applies the same rules to .vue files + ✓ JavaScript-like files → it applies the same rules to .svelte files + ✓ JavaScript-like files → it applies the same rules to .mjs, .cjs, and .mts files + ✓ unknown extensions → it hashes the raw content for unknown extensions + ✓ unknown extensions → it does not normalise whitespace for unknown extensions + ✓ unknown extensions → it does not strip comments for unknown extensions + ✓ unknown extensions → it hashes files with no extension as raw content + ✓ output format → it returns a 32-character hex xxh128 hash + ✓ output format → it returns a stable hash for empty content + PASS Tests\Unit\Preset ✓ preset invalid name ✓ preset → myFramework @@ -1901,4 +1940,4 @@ ✓ pass with dataset with ('my-datas-set-value') ✓ within describe → pass with dataset with ('my-datas-set-value') - Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 35 skipped, 1294 passed (2971 assertions) \ No newline at end of file + Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 35 skipped, 1329 passed (3010 assertions) \ No newline at end of file diff --git a/tests/Visual/Parallel.php b/tests/Visual/Parallel.php index 0d1f4d64..1055526b 100644 --- a/tests/Visual/Parallel.php +++ b/tests/Visual/Parallel.php @@ -16,6 +16,7 @@ $run = function () { test('parallel', function () use ($run) { $output = $run('--exclude-group=integration'); + $output = implode("\n", array_slice(explode("\n", $output), -10)); if (getenv('REBUILD_SNAPSHOTS')) { preg_match('/Tests:\s+(.+\(\d+ assertions\))/', $output, $matches); @@ -23,13 +24,13 @@ test('parallel', function () use ($run) { $file = file_get_contents(__FILE__); $file = preg_replace( '/\$expected = \'.*?\';/', - "\$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1278 passed (2920 assertions)';", + "\$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1313 passed (2959 assertions)';", $file, ); file_put_contents(__FILE__, $file); } - $expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1278 passed (2920 assertions)'; + $expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1313 passed (2959 assertions)'; expect($output) ->toContain("Tests: {$expected}")