Skip to content

Commit 279f745

Browse files
committed
Fix reporting of redirect test failures in junit
These were being reported under the wrong name ... which means that they don't show up as failures on azure :(
1 parent eef8522 commit 279f745

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

run-tests.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -2037,6 +2037,7 @@ function run_test($php, $file, $env)
20372037
if (is_array($IN_REDIRECT)) {
20382038
$tested = $IN_REDIRECT['prefix'] . ' ' . trim($section_text['TEST']);
20392039
$tested_file = $tmp_relative_file;
2040+
$shortname = str_replace(TEST_PHP_SRCDIR . '/', '', $tested_file);
20402041
}
20412042

20422043
// unlink old test results
@@ -2722,7 +2723,8 @@ function run_test($php, $file, $env)
27222723
// write .diff
27232724
$diff = generate_diff($wanted, $wanted_re, $output);
27242725
if (is_array($IN_REDIRECT)) {
2725-
$diff = "# original source file: $shortname\n" . $diff;
2726+
$orig_shortname = str_replace(TEST_PHP_SRCDIR . '/', '', $file);
2727+
$diff = "# original source file: $orig_shortname\n" . $diff;
27262728
}
27272729
show_file_block('diff', $diff);
27282730
if (strpos($log_format, 'D') !== false && file_put_contents($diff_filename, $diff, FILE_BINARY) === false) {
@@ -2769,7 +2771,7 @@ function run_test($php, $file, $env)
27692771

27702772
$diff = empty($diff) ? '' : preg_replace('/\e/', '<esc>', $diff);
27712773

2772-
junit_mark_test_as($restype, str_replace(TEST_PHP_SRCDIR . '/', '', $tested_file), $tested, null, $info, $diff);
2774+
junit_mark_test_as($restype, $shortname, $tested, null, $info, $diff);
27732775

27742776
return $restype[0] . 'ED';
27752777
}

0 commit comments

Comments
 (0)