Skip to content

Commit 00bfff8

Browse files
authored
Merge pull request #26 from phpbb-extensions/3.3.x
Merge 3.3.x into master
2 parents d2b3f07 + 4c9b9af commit 00bfff8

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:
@@ -281,9 +286,16 @@ jobs:
281286
run: |
282287
if [ $COVERAGE == '1' ]
283288
then
284-
phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php --coverage-clover build/logs/clover.xml
289+
phpBB/vendor/bin/phpunit \
290+
--configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml \
291+
--bootstrap ./tests/bootstrap.php \
292+
--coverage-clover build/logs/clover.xml \
293+
$([[ "$FUNCTIONAL_TESTS" == "0" ]] && echo "--exclude-group functional")
285294
else
286-
phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php
295+
phpBB/vendor/bin/phpunit \
296+
--configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml \
297+
--bootstrap ./tests/bootstrap.php \
298+
$([[ "$FUNCTIONAL_TESTS" == "0" ]] && echo "--exclude-group functional")
287299
fi
288300
working-directory: ./phpBB3
289301

@@ -411,7 +423,11 @@ jobs:
411423
- name: Run unit tests
412424
env:
413425
DB: ${{steps.database-type.outputs.db}}
414-
run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php
426+
run: |
427+
phpBB/vendor/bin/phpunit \
428+
--configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml \
429+
--bootstrap ./tests/bootstrap.php \
430+
$([[ "$FUNCTIONAL_TESTS" == "0" ]] && echo "--exclude-group functional")
415431
working-directory: ./phpBB3
416432
# END PostgreSQL Job
417433

@@ -529,7 +545,11 @@ jobs:
529545
- name: Run unit tests
530546
env:
531547
DB: ${{steps.database-type.outputs.db}}
532-
run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php
548+
run: |
549+
phpBB/vendor/bin/phpunit \
550+
--configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml \
551+
--bootstrap ./tests/bootstrap.php \
552+
$([[ "$FUNCTIONAL_TESTS" == "0" ]] && echo "--exclude-group functional")
533553
working-directory: ./phpBB3
534554
# END Other Tests Job
535555

@@ -543,11 +563,8 @@ jobs:
543563
- ${{ startsWith(inputs.PRIMARY_PHP_VERSION, '7') && '7.4' || inputs.PRIMARY_PHP_VERSION }}
544564
db:
545565
- postgres
546-
type:
547-
- unit
548-
- functional
549566

550-
name: PHP ${{ matrix.php }} - Windows - ${{ matrix.type }}
567+
name: PHP ${{ matrix.php }} - Windows
551568

552569
steps:
553570
- name: Prepare git for Windows
@@ -657,19 +674,26 @@ jobs:
657674

658675
- name: Setup PHPUnit files
659676
run: |
660-
if (-not (Test-Path "phpBB\ext\$env:EXTNAME\.github")) {
661-
mkdir "phpBB\ext\$env:EXTNAME\.github"
662-
}
663-
Copy-Item ".github\phpunit*" -Destination "phpBB\ext\$env:EXTNAME\.github" -Force
677+
if (-not (Test-Path "phpBB\ext\$env:EXTNAME\.github")) {
678+
mkdir "phpBB\ext\$env:EXTNAME\.github"
679+
}
680+
Copy-Item ".github\phpunit*" -Destination "phpBB\ext\$env:EXTNAME\.github" -Force
664681
working-directory: .\phpBB3
665682

666683
- name: Run unit tests
667-
if: ${{ matrix.type == 'unit' }}
668-
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
669-
working-directory: .\phpBB3
684+
run: |
685+
$args = @(
686+
"--configuration", "phpBB/ext/$env:EXTNAME/.github/phpunit-psql-windows-github.xml",
687+
"--bootstrap", "./tests/bootstrap.php",
688+
"--verbose",
689+
"--stop-on-error"
690+
)
691+
692+
if ($env:FUNCTIONAL_TESTS -eq "0") {
693+
$args += "--exclude-group"
694+
$args += "functional"
695+
}
670696
671-
- name: Run functional tests
672-
if: ${{ matrix.type == 'functional' }}
673-
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
697+
phpBB/vendor/bin/phpunit @args
674698
working-directory: .\phpBB3
675699
# 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)