Skip to content

Commit 54e4f4d

Browse files
committed
Add option to skip functional tests
fix
1 parent 475d963 commit 54e4f4d

2 files changed

Lines changed: 29 additions & 5 deletions

File tree

.github/workflows/tests.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ on:
4646
required: false
4747
type: string
4848
default: '1'
49+
RUN_FUNCTIONAL_TESTS:
50+
required: false
51+
type: string
52+
default: '1'
4953
RUN_NPM_INSTALL:
5054
required: false
5155
type: string
@@ -73,6 +77,7 @@ env:
7377
IMAGE_ICC: ${{ inputs.IMAGE_ICC == '1' && '1' || '0' }}
7478
EPV: ${{ inputs.EPV == '1' && '1' || '0' }}
7579
EXECUTABLE_FILES: ${{ inputs.EXECUTABLE_FILES == '1' && '1' || '0' }}
80+
FUNCTIONAL_TESTS: ${{ inputs.RUN_FUNCTIONAL_TESTS == '1' && '1' || '0' }}
7681
PHPBB_BRANCH: ${{ inputs.PHPBB_BRANCH }}
7782

7883
jobs:
@@ -279,9 +284,16 @@ jobs:
279284
run: |
280285
if [ $COVERAGE == '1' ]
281286
then
282-
phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php --coverage-clover build/logs/clover.xml
287+
phpBB/vendor/bin/phpunit \
288+
--configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml \
289+
--bootstrap ./tests/bootstrap.php \
290+
--coverage-clover build/logs/clover.xml \
291+
$([[ "$FUNCTIONAL_TESTS" == "0" ]] && echo "--exclude-group functional")
283292
else
284-
phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php
293+
phpBB/vendor/bin/phpunit \
294+
--configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml \
295+
--bootstrap ./tests/bootstrap.php \
296+
$([[ "$FUNCTIONAL_TESTS" == "0" ]] && echo "--exclude-group functional")
285297
fi
286298
working-directory: ./phpBB3
287299

@@ -407,7 +419,11 @@ jobs:
407419
- name: Run unit tests
408420
env:
409421
DB: ${{steps.database-type.outputs.db}}
410-
run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php
422+
run: |
423+
phpBB/vendor/bin/phpunit \
424+
--configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml \
425+
--bootstrap ./tests/bootstrap.php \
426+
$([[ "$FUNCTIONAL_TESTS" == "0" ]] && echo "--exclude-group functional")
411427
working-directory: ./phpBB3
412428
# END PostgreSQL Job
413429

@@ -524,7 +540,11 @@ jobs:
524540
- name: Run unit tests
525541
env:
526542
DB: ${{steps.database-type.outputs.db}}
527-
run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php
543+
run: |
544+
phpBB/vendor/bin/phpunit \
545+
--configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml \
546+
--bootstrap ./tests/bootstrap.php \
547+
$([[ "$FUNCTIONAL_TESTS" == "0" ]] && echo "--exclude-group functional")
528548
working-directory: ./phpBB3
529549
# END Other Tests Job
530550

@@ -662,7 +682,7 @@ jobs:
662682
working-directory: .\phpBB3
663683

664684
- name: Run functional tests
665-
if: ${{ matrix.type == 'functional' }}
685+
if: ${{ matrix.type == 'functional' && env.FUNCTIONAL_TESTS == '1' }}
666686
run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$env:EXTNAME/.github/phpunit-psql-windows-github.xml --bootstrap ./tests/bootstrap.php --verbose --stop-on-error --group functional
667687
working-directory: .\phpBB3
668688
# END IIS & PostgreSQL on Windows Tests Job

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ call-tests:
124124
# Default: 1
125125
RUN_WINDOWS_JOBS: 1
126126
127+
# Run functional tests if you have them? 1 (yes) or 0 (no)
128+
# Default: 1
129+
RUN_FUNCTIONAL_TESTS: 1
130+
127131
# Install NPM dependencies (if your extension relies on them)? 1 (yes) or 0 (no)
128132
# Default: 0
129133
RUN_NPM_INSTALL: 0

0 commit comments

Comments
 (0)