Skip to content

Commit 0028c24

Browse files
authored
Add --[no-]progress option to run-tests.php (php#9255)
Previously, adding the -g argument would disable progress, even locally. Now it needs to be disabled explicitly.
1 parent 0fc9fd9 commit 0028c24

File tree

8 files changed

+28
-14
lines changed

8 files changed

+28
-14
lines changed

Diff for: .cirrus.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ task:
2525
tests_script:
2626
- export SKIP_IO_CAPTURE_TESTS=1
2727
- export CI_NO_IPV6=1
28-
- 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
28+
- 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

Diff for: .github/actions/test-linux/action.yml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ runs:
2525
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
2626
-j$(/usr/bin/nproc) \
2727
-g FAIL,BORK,LEAK,XLEAK \
28+
--no-progress \
2829
--offline \
2930
--show-diff \
3031
--show-slow 1000 \

Diff for: .github/actions/test-macos/action.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ runs:
1818
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
1919
-j$(sysctl -n hw.ncpu) \
2020
-g FAIL,BORK,LEAK,XLEAK \
21+
--no-progress \
2122
--offline \
2223
--show-diff \
2324
--show-slow 1000 \

Diff for: appveyor/test_task.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ mkdir c:\tests_tmp
136136
set TEST_PHP_JUNIT=c:\junit.out.xml
137137

138138
cd "%APPVEYOR_BUILD_FOLDER%"
139-
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%"
139+
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%"
140140

141141
set EXIT_CODE=%errorlevel%
142142

Diff for: azure/libmysqlclient_test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ steps:
3535
rm -rf junit.xml | true
3636
sapi/cli/php run-tests.php -P -q \
3737
-g FAIL,BORK,LEAK,XLEAK \
38+
--no-progress \
3839
--offline --show-diff --show-slow 1000 --set-timeout 120 \
3940
ext/pdo_mysql
4041
displayName: 'Test ${{ parameters.configurationName }}'

Diff for: azure/test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ steps:
1919
sapi/cli/php run-tests.php -P -q \
2020
-j$(/usr/bin/nproc) \
2121
-g FAIL,BORK,LEAK,XLEAK \
22+
--no-progress \
2223
--offline \
2324
--show-diff \
2425
--show-slow 1000 \

Diff for: run-tests.php

+21-12
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ function show_usage(): void
127127
--color
128128
--no-color Do/Don't colorize the result type in the test result.
129129
130+
--progress
131+
--no-progress Do/Don't show the current progress.
132+
130133
--repeat [n]
131134
Run the tests multiple times in the same process and check the
132135
output of the last execution (CLI SAPI only).
@@ -159,7 +162,7 @@ function main(): void
159162
$temp_source, $temp_target, $test_cnt, $test_dirs,
160163
$test_files, $test_idx, $test_list, $test_results, $testfile,
161164
$user_tests, $valgrind, $sum_results, $shuffle, $file_cache, $num_repeats,
162-
$bless;
165+
$bless, $show_progress;
163166
// Parallel testing
164167
global $workers, $workerID;
165168
global $context_line_count;
@@ -360,6 +363,7 @@ function main(): void
360363
$workers = null;
361364
$context_line_count = 3;
362365
$num_repeats = 1;
366+
$show_progress = true;
363367

364368
$cfgtypes = ['show', 'keep'];
365369
$cfgfiles = ['skip', 'php', 'clean', 'out', 'diff', 'exp', 'mem'];
@@ -600,6 +604,12 @@ function main(): void
600604
$repeat = true;
601605
}
602606
break;
607+
case '--progress':
608+
$show_progress = true;
609+
break;
610+
case '--no-progress':
611+
$show_progress = false;
612+
break;
603613
case '--version':
604614
echo '$Id$' . "\n";
605615
exit(1);
@@ -1331,7 +1341,7 @@ function run_all_tests(array $test_files, array $env, $redir_tested = null): voi
13311341
*/
13321342
function run_all_tests_parallel(array $test_files, array $env, $redir_tested): void
13331343
{
1334-
global $workers, $test_idx, $test_cnt, $test_results, $failed_tests_file, $result_tests_file, $PHP_FAILED_TESTS, $shuffle, $SHOW_ONLY_GROUPS, $valgrind;
1344+
global $workers, $test_idx, $test_cnt, $test_results, $failed_tests_file, $result_tests_file, $PHP_FAILED_TESTS, $shuffle, $SHOW_ONLY_GROUPS, $valgrind, $show_progress;
13351345

13361346
global $junit;
13371347

@@ -1578,13 +1588,13 @@ function run_all_tests_parallel(array $test_files, array $env, $redir_tested): v
15781588
}
15791589
$test_idx++;
15801590

1581-
if (!$SHOW_ONLY_GROUPS) {
1591+
if ($show_progress) {
15821592
clear_show_test();
15831593
}
15841594

15851595
echo $resultText;
15861596

1587-
if (!$SHOW_ONLY_GROUPS) {
1597+
if ($show_progress) {
15881598
show_test($test_idx, count($workerProcs) . "/$workers concurrent test workers running");
15891599
}
15901600

@@ -1634,7 +1644,7 @@ function run_all_tests_parallel(array $test_files, array $env, $redir_tested): v
16341644
}
16351645
}
16361646

1637-
if (!$SHOW_ONLY_GROUPS) {
1647+
if ($show_progress) {
16381648
clear_show_test();
16391649
}
16401650

@@ -3223,22 +3233,22 @@ function show_summary(): void
32233233

32243234
function show_redirect_start(string $tests, string $tested, string $tested_file): void
32253235
{
3226-
global $SHOW_ONLY_GROUPS;
3236+
global $SHOW_ONLY_GROUPS, $show_progress;
32273237

32283238
if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) {
32293239
echo "REDIRECT $tests ($tested [$tested_file]) begin\n";
3230-
} else {
3240+
} elseif ($show_progress) {
32313241
clear_show_test();
32323242
}
32333243
}
32343244

32353245
function show_redirect_ends(string $tests, string $tested, string $tested_file): void
32363246
{
3237-
global $SHOW_ONLY_GROUPS;
3247+
global $SHOW_ONLY_GROUPS, $show_progress;
32383248

32393249
if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) {
32403250
echo "REDIRECT $tests ($tested [$tested_file]) done\n";
3241-
} else {
3251+
} elseif ($show_progress) {
32423252
clear_show_test();
32433253
}
32443254
}
@@ -3280,7 +3290,7 @@ function show_result(
32803290
string $extra = '',
32813291
?array $temp_filenames = null
32823292
): void {
3283-
global $SHOW_ONLY_GROUPS, $colorize;
3293+
global $SHOW_ONLY_GROUPS, $colorize, $show_progress;
32843294

32853295
if (!$SHOW_ONLY_GROUPS || in_array($result, $SHOW_ONLY_GROUPS)) {
32863296
if ($colorize) {
@@ -3302,10 +3312,9 @@ function show_result(
33023312
} else {
33033313
echo "$result $tested [$tested_file] $extra\n";
33043314
}
3305-
} elseif (!$SHOW_ONLY_GROUPS) {
3315+
} elseif ($show_progress) {
33063316
clear_show_test();
33073317
}
3308-
33093318
}
33103319

33113320
class BorkageException extends Exception

Diff for: travis/test.sh

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

0 commit comments

Comments
 (0)