Commit 25ba940
authored
fix(ci): make composer check:strict able to fail on tests (#16)
test:unit and test:all ended in
./vendor/bin/phpunit --colors=always || echo 'No PHP test suite in this repo ... skipping...'
so phpunit's exit status was discarded unconditionally. The message was
true today (this repo is a Python ExApp wrapper with no PHP test suite)
but the mechanism was not conditional on it: any real test failure, now
or after a test suite is added, would have been swallowed the same way.
Replaced with a guard on the actual precondition, so an absent suite is a
visible stated fact and a present-but-failing suite fails the gate:
if [ -f phpunit.xml ] || [ -f phpunit.xml.dist ]; then ./vendor/bin/phpunit --colors=always; else echo 'SKIPPED: no phpunit.xml ...'; fi
Positive control, measured on this tree in a PHP 8.3.32 container with a
freshly installed vendor/, injecting a phpunit.xml plus one deliberately
failing test:
old composer.json + failing test -> check:strict exit 0 (swallowed)
new composer.json + failing test -> check:strict exit 1, naming test:all
new composer.json, test removed -> check:strict exit 0, loud SKIPPED
Tooling only.1 parent a1e9206 commit 25ba940
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
0 commit comments