Add --[no-]progress option to run-tests.php (#9255)

Previously, adding the -g argument would disable progress, even locally.
Now it needs to be disabled explicitly.
This commit is contained in:
Ilija Tovilo 2022-08-11 20:58:15 +02:00 committed by GitHub
parent 0fc9fd9fd6
commit 0028c242f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 28 additions and 14 deletions

View file

@ -25,4 +25,4 @@ task:
tests_script:
- export SKIP_IO_CAPTURE_TESTS=1
- export CI_NO_IPV6=1
- sapi/cli/php run-tests.php -P -q -j2 -g FAIL,BORK,LEAK,XLEAK --offline --show-diff --show-slow 1000 --set-timeout 120 -d zend_extension=opcache.so
- sapi/cli/php run-tests.php -P -q -j2 -g FAIL,BORK,LEAK,XLEAK --no-progress --offline --show-diff --show-slow 1000 --set-timeout 120 -d zend_extension=opcache.so

View file

@ -25,6 +25,7 @@ runs:
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
-j$(/usr/bin/nproc) \
-g FAIL,BORK,LEAK,XLEAK \
--no-progress \
--offline \
--show-diff \
--show-slow 1000 \

View file

@ -18,6 +18,7 @@ runs:
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
-j$(sysctl -n hw.ncpu) \
-g FAIL,BORK,LEAK,XLEAK \
--no-progress \
--offline \
--show-diff \
--show-slow 1000 \

View file

@ -136,7 +136,7 @@ mkdir c:\tests_tmp
set TEST_PHP_JUNIT=c:\junit.out.xml
cd "%APPVEYOR_BUILD_FOLDER%"
nmake test TESTS="%OPCACHE_OPTS% -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp --bless %PARALLEL%"
nmake test TESTS="%OPCACHE_OPTS% -g FAIL,BORK,LEAK,XLEAK --no-progress -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp --bless %PARALLEL%"
set EXIT_CODE=%errorlevel%

View file

@ -35,6 +35,7 @@ steps:
rm -rf junit.xml | true
sapi/cli/php run-tests.php -P -q \
-g FAIL,BORK,LEAK,XLEAK \
--no-progress \
--offline --show-diff --show-slow 1000 --set-timeout 120 \
ext/pdo_mysql
displayName: 'Test ${{ parameters.configurationName }}'

View file

@ -19,6 +19,7 @@ steps:
sapi/cli/php run-tests.php -P -q \
-j$(/usr/bin/nproc) \
-g FAIL,BORK,LEAK,XLEAK \
--no-progress \
--offline \
--show-diff \
--show-slow 1000 \

View file

@ -127,6 +127,9 @@ Options:
--color
--no-color Do/Don't colorize the result type in the test result.
--progress
--no-progress Do/Don't show the current progress.
--repeat [n]
Run the tests multiple times in the same process and check the
output of the last execution (CLI SAPI only).
@ -159,7 +162,7 @@ function main(): void
$temp_source, $temp_target, $test_cnt, $test_dirs,
$test_files, $test_idx, $test_list, $test_results, $testfile,
$user_tests, $valgrind, $sum_results, $shuffle, $file_cache, $num_repeats,
$bless;
$bless, $show_progress;
// Parallel testing
global $workers, $workerID;
global $context_line_count;
@ -360,6 +363,7 @@ function main(): void
$workers = null;
$context_line_count = 3;
$num_repeats = 1;
$show_progress = true;
$cfgtypes = ['show', 'keep'];
$cfgfiles = ['skip', 'php', 'clean', 'out', 'diff', 'exp', 'mem'];
@ -600,6 +604,12 @@ function main(): void
$repeat = true;
}
break;
case '--progress':
$show_progress = true;
break;
case '--no-progress':
$show_progress = false;
break;
case '--version':
echo '$Id$' . "\n";
exit(1);
@ -1331,7 +1341,7 @@ function run_all_tests(array $test_files, array $env, $redir_tested = null): voi
*/
function run_all_tests_parallel(array $test_files, array $env, $redir_tested): void
{
global $workers, $test_idx, $test_cnt, $test_results, $failed_tests_file, $result_tests_file, $PHP_FAILED_TESTS, $shuffle, $SHOW_ONLY_GROUPS, $valgrind;
global $workers, $test_idx, $test_cnt, $test_results, $failed_tests_file, $result_tests_file, $PHP_FAILED_TESTS, $shuffle, $SHOW_ONLY_GROUPS, $valgrind, $show_progress;
global $junit;
@ -1578,13 +1588,13 @@ escape:
}
$test_idx++;
if (!$SHOW_ONLY_GROUPS) {
if ($show_progress) {
clear_show_test();
}
echo $resultText;
if (!$SHOW_ONLY_GROUPS) {
if ($show_progress) {
show_test($test_idx, count($workerProcs) . "/$workers concurrent test workers running");
}
@ -1634,7 +1644,7 @@ escape:
}
}
if (!$SHOW_ONLY_GROUPS) {
if ($show_progress) {
clear_show_test();
}
@ -3223,22 +3233,22 @@ function show_summary(): void
function show_redirect_start(string $tests, string $tested, string $tested_file): void
{
global $SHOW_ONLY_GROUPS;
global $SHOW_ONLY_GROUPS, $show_progress;
if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) {
echo "REDIRECT $tests ($tested [$tested_file]) begin\n";
} else {
} elseif ($show_progress) {
clear_show_test();
}
}
function show_redirect_ends(string $tests, string $tested, string $tested_file): void
{
global $SHOW_ONLY_GROUPS;
global $SHOW_ONLY_GROUPS, $show_progress;
if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) {
echo "REDIRECT $tests ($tested [$tested_file]) done\n";
} else {
} elseif ($show_progress) {
clear_show_test();
}
}
@ -3280,7 +3290,7 @@ function show_result(
string $extra = '',
?array $temp_filenames = null
): void {
global $SHOW_ONLY_GROUPS, $colorize;
global $SHOW_ONLY_GROUPS, $colorize, $show_progress;
if (!$SHOW_ONLY_GROUPS || in_array($result, $SHOW_ONLY_GROUPS)) {
if ($colorize) {
@ -3302,10 +3312,9 @@ function show_result(
} else {
echo "$result $tested [$tested_file] $extra\n";
}
} elseif (!$SHOW_ONLY_GROUPS) {
} elseif ($show_progress) {
clear_show_test();
}
}
class BorkageException extends Exception

View file

@ -7,6 +7,7 @@ if [ -z "$ARM64" ]; then export JOBS=$(nproc); else export JOBS=16; fi
export SKIP_IO_CAPTURE_TESTS=1
./sapi/cli/php run-tests.php -P \
-g "FAIL,BORK,LEAK" --offline --show-diff --show-slow 1000 \
--no-progress \
--set-timeout 120 -j$JOBS \
-d extension=`pwd`/modules/zend_test.so \
-d zend_extension=`pwd`/modules/opcache.so \