enable windows tests

This commit is contained in:
Fabio Ivona
2023-01-15 10:41:49 +01:00
parent 6982b02d48
commit 94cef989d3
6 changed files with 18 additions and 13 deletions

View File

@ -1,4 +1,4 @@
##teamcity[testSuiteStarted name='Tests\tests\Failure' locationHint='file://tests/.tests/Failure.php' flowId='1234']
##teamcity[testSuiteStarted name='Tests/tests/Failure' locationHint='file://tests/.tests/Failure.php' 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 src/Mixins/Expectation.php:312|nat src/Support/ExpectationPipeline.php:75|nat src/Support/ExpectationPipeline.php:79|nat src/Expectation.php:300|nat tests/.tests/Failure.php:6|nat src/Factories/TestCaseMethodFactory.php:106|nat src/Concerns/Testable.php:262|nat src/Support/ExceptionTrace.php:28|nat src/Concerns/Testable.php:262|nat src/Concerns/Testable.php:217|nat src/Kernel.php:79' type='comparisonFailure' actual='true' expected='false' flowId='1234']
##teamcity[testFinished name='it can fail with comparison' duration='100000' flowId='1234']
@ -17,7 +17,7 @@
##teamcity[testStarted name='build this one.' locationHint='pest_qn://tests/.tests/Failure.php::build this one.' flowId='1234']
##teamcity[testIgnored name='build this one.' message='This test was ignored.' details='' flowId='1234']
##teamcity[testFinished name='build this one.' duration='100000' flowId='1234']
##teamcity[testSuiteFinished name='Tests\tests\Failure' flowId='1234']
##teamcity[testSuiteFinished name='Tests/tests/Failure' flowId='1234']
Tests: 2 failed, 1 risky, 2 todos, 1 skipped (2 assertions)
Duration: 1.00s

View File

@ -1,9 +1,9 @@
##teamcity[testSuiteStarted name='Tests\tests\SuccessOnly' locationHint='file://tests/.tests/SuccessOnly.php' flowId='1234']
##teamcity[testSuiteStarted name='Tests/tests/SuccessOnly' locationHint='file://tests/.tests/SuccessOnly.php' 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[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[testSuiteFinished name='Tests\tests\SuccessOnly' flowId='1234']
##teamcity[testSuiteFinished name='Tests/tests/SuccessOnly' flowId='1234']
Tests: 2 passed (2 assertions)
Duration: 1.00s

View File

@ -1,5 +1,12 @@
<?php
function normalize_windows_os_output(string $text): string
{
$text = str_replace('\r', '', $text);
return str_replace('\\', '/', $text);
}
test('visual snapshot of team city', function (string $testFile) {
$testsPath = dirname(__DIR__)."/.tests/$testFile";
@ -28,13 +35,9 @@ test('visual snapshot of team city', function (string $testFile) {
};
if (getenv('REBUILD_SNAPSHOTS')) {
$outputContent = explode("\n", $output());
file_put_contents($snapshot, implode("\n", $outputContent));
file_put_contents($snapshot, normalize_windows_os_output($output()));
} elseif (! getenv('EXCLUDE')) {
$output = explode("\n", $output());
expect(implode("\n", $output))->toEqual(file_get_contents($snapshot));
expect(normalize_windows_os_output($output()))->toEqual(file_get_contents($snapshot));
}
})->with([
'Failure.php',