Skip to content

Commit 4c9b9af

Browse files
authored
Merge pull request #25 from iMattPro/experimental-3.3.x
Option to skip functional tests
2 parents 475d963 + 12dc87e commit 4c9b9af

2 files changed

Lines changed: 46 additions & 18 deletions

File tree

.github/workflows/tests.yml

Lines changed: 42 additions & 18 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

@@ -538,11 +558,8 @@ jobs:
538558
- ${{ startsWith(inputs.PRIMARY_PHP_VERSION, '7') && '7.4' || inputs.PRIMARY_PHP_VERSION }}
539559
db:
540560
- postgres
541-
type:
542-
- unit
543-
- functional
544561

545-
name: PHP ${{ matrix.php }} - Windows - ${{ matrix.type }}
562+
name: PHP ${{ matrix.php }} - Windows
546563

547564
steps:
548565
- name: Prepare git for Windows
@@ -650,19 +667,26 @@ jobs:
650667

651668
- name: Setup PHPUnit files
652669
run: |
653-
if (-not (Test-Path "phpBB\ext\$env:EXTNAME\.github")) {
654-
mkdir "phpBB\ext\$env:EXTNAME\.github"
655-
}
656-
Copy-Item ".github\phpunit*" -Destination "phpBB\ext\$env:EXTNAME\.github" -Force
670+
if (-not (Test-Path "phpBB\ext\$env:EXTNAME\.github")) {
671+
mkdir "phpBB\ext\$env:EXTNAME\.github"
672+
}
673+
Copy-Item ".github\phpunit*" -Destination "phpBB\ext\$env:EXTNAME\.github" -Force
657674
working-directory: .\phpBB3
658675

659676
- name: Run unit tests
660-
if: ${{ matrix.type == 'unit' }}
661-
run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$env:EXTNAME/.github/phpunit-psql-windows-github.xml --bootstrap ./tests/bootstrap.php --verbose --stop-on-error --exclude-group functional
662-
working-directory: .\phpBB3
677+
run: |
678+
$args = @(
679+
"--configuration", "phpBB/ext/$env:EXTNAME/.github/phpunit-psql-windows-github.xml",
680+
"--bootstrap", "./tests/bootstrap.php",
681+
"--verbose",
682+
"--stop-on-error"
683+
)
684+
685+
if ($env:FUNCTIONAL_TESTS -eq "0") {
686+
$args += "--exclude-group"
687+
$args += "functional"
688+
}
663689
664-
- name: Run functional tests
665-
if: ${{ matrix.type == 'functional' }}
666-
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
690+
phpBB/vendor/bin/phpunit @args
667691
working-directory: .\phpBB3
668692
# 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)