Match the exact TeamCity output flag (#2052)

Co-authored-by: haranishi <223786623+haranishi@users.noreply.github.com>
This commit is contained in:
Ikki Nishihara
2026-11-19 19:21:16 +09:00
committed by GitHub
parent b4fcb2091e
commit fcd408b895
3 changed files with 18 additions and 2 deletions
+1 -1
View File
@@ -121,7 +121,7 @@ use Symfony\Component\Console\Output\ConsoleOutput;
}
}
if (str_contains($value, '--teamcity')) {
if ($value === '--teamcity') {
unset($arguments[$key]);
$arguments[] = '--no-output';
unset($_SERVER['COLLISION_PRINTER']);
+3 -1
View File
@@ -2503,6 +2503,8 @@
WARN Tests\Visual\TeamCity
- visual snapshot of team city with ('Failure.php')
- visual snapshot of team city with ('SuccessOnly.php')
✓ preserves TeamCity text in a test filter with dataset "attached value"
✓ preserves TeamCity text in a test filter with dataset "separate value"
WARN Tests\Visual\Todo
- todos
@@ -2521,4 +2523,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, 38 skipped, 1829 passed (4146 assertions)
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 38 skipped, 1831 passed (4150 assertions)
+14
View File
@@ -46,3 +46,17 @@ test('visual snapshot of team city', function (string $testFile): void {
'Failure.php',
'SuccessOnly.php',
])->skip(! getenv('REBUILD_SNAPSHOTS') && getenv('EXCLUDE'));
test('preserves TeamCity text in a test filter', function (array $filterArguments): void {
$process = new Process(
[PHP_BINARY, 'bin/pest', '--colors=never', 'tests/Fixtures/Suites/SuccessOnly.php', ...$filterArguments],
dirname(__DIR__, 2),
['PARATEST' => '0', 'PAO_DISABLE' => '1'],
);
expect($process->run())->toBe(0)
->and($process->getOutput())->toContain('1 passed (1 assertions)');
})->with([
'attached value' => [['--filter=can pass with comparison|--teamcity']],
'separate value' => [['--filter', 'can pass with comparison|--teamcity']],
]);