Skip to content

Commit 3f5ab6e

Browse files
committed
WIP add "--limit-skipped-exts"
1 parent 3ff69d7 commit 3f5ab6e

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

.github/actions/test-linux/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Test
22
inputs:
3+
limitSkippedExts:
4+
default: ''
5+
required: false
36
testArtifacts:
47
default: null
58
required: false
@@ -31,6 +34,7 @@ runs:
3134
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
3235
-j$(/usr/bin/nproc) \
3336
-g FAIL,BORK,LEAK,XLEAK \
37+
--limit-skipped-exts '${{ inputs.limitSkippedExts }}' \
3438
--no-progress \
3539
--offline \
3640
--show-diff \

.github/actions/test-macos/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Test
22
inputs:
3+
limitSkippedExts:
4+
default: ''
5+
required: false
36
testArtifacts:
47
default: null
58
required: false
@@ -18,6 +21,7 @@ runs:
1821
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
1922
-j$(sysctl -n hw.ncpu) \
2023
-g FAIL,BORK,LEAK,XLEAK \
24+
--limit-skipped-exts '${{ inputs.limitSkippedExts }}' \
2125
--no-progress \
2226
--offline \
2327
--show-diff \

.github/workflows/push.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ jobs:
5656
- name: Test
5757
uses: ./.github/actions/test-linux
5858
with:
59+
limitSkippedExts: a, b, c
5960
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}
6061
- name: Test Tracing JIT
6162
uses: ./.github/actions/test-linux
6263
with:
64+
limitSkippedExts: a, b, c
6365
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
6466
runTestsParameters: >-
6567
-d zend_extension=opcache.so
@@ -87,10 +89,12 @@ jobs:
8789
- name: Test
8890
uses: ./.github/actions/test-macos
8991
with:
92+
limitSkippedExts: a, b, c
9093
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}
9194
- name: Test Tracing JIT
9295
uses: ./.github/actions/test-macos
9396
with:
97+
limitSkippedExts: a, b, c
9498
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
9599
runTestsParameters: >-
96100
-d zend_extension=opcache.so

run-tests.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ function show_usage(): void
120120
--show-slow <n>
121121
Show all tests that took longer than <n> milliseconds to run.
122122
123+
--limit-skipped-exts "<ext>, <ext>, ..."
124+
If set, and one or more skipped ext is not listed, it will fail the tests.
125+
123126
--no-clean Do not execute clean section if any.
124127
125128
--color
@@ -354,6 +357,7 @@ function main(): void
354357
}
355358
$selected_tests = false;
356359
$slow_min_ms = INF;
360+
$limit_skipped_exts = false;
357361
$preload = false;
358362
$file_cache = null;
359363
$shuffle = false;
@@ -552,6 +556,9 @@ function main(): void
552556
}
553557
$slow_min_ms = intval($slow_min_ms, 10);
554558
break;
559+
case '--limit-skipped-exts':
560+
$limit_skipped_exts = array_filter(array_map('trim', explode(',', $argv[++$i] ?? '')));
561+
break;
555562
case '--temp-source':
556563
$temp_source = $argv[++$i];
557564
break;
@@ -649,6 +656,14 @@ function main(): void
649656
}
650657
}
651658

659+
if ($limit_skipped_exts !== false) {
660+
$exts_skipped_diff = array_diff($exts_skipped, $limit_skipped_exts);
661+
if (count($exts_skipped_diff) > 0) {
662+
echo 'The following extensions are not allowed to be skipped: ' . implode(', ', $exts_skipped_diff) . "\n";
663+
exit(1);
664+
}
665+
}
666+
652667
if ($selected_tests && count($test_files) === 0) {
653668
echo "No tests found.\n";
654669
return;

0 commit comments

Comments
 (0)