In a CI, the tests won't pass if scripts are excluded from dependencies on composer install.
See full error:
Run composer run-tests
> "vendor/bin/phpunit" --testsuite unit --colors=always --configuration tests/Unit/phpunit.xml.dist
PHPUnit 9.6.19 by Sebastian Bergmann and contributors.
Runtime: PHP 7.4.33
Configuration: tests/Unit/phpunit.xml.dist
No tests executed!
> "vendor/bin/phpunit" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --exclude-group AdminOnly
Installing...
Running as single site... To run multisite, use -c tests/phpunit/multisite.xml
Warning: PHP Warning: fopen(/home/runner/work/wp-rocket-changelog/wp-rocket-changelog/vendor-prefixed/wp-launchpad/core/inc/boot.php): failed to open stream: No such file or directory in /home/runner/work/wp-rocket-changelog/wp-rocket-changelog/vendor/antecedent/patchwork/src/CodeManipulation/Stream.php on line 151
;\Patchwork\CodeManipulation\Stream::reinstateWrapper();
Warning: PHP Warning: require(/home/runner/work/wp-rocket-changelog/wp-rocket-changelog/vendor-prefixed/wp-launchpad/core/inc/boot.php): failed to open stream: "Patchwork\CodeManipulation\Stream::stream_open" call failed in /home/runner/work/wp-rocket-changelog/wp-rocket-changelog/wprocketchangelog.php on line 16
Error: PHP Fatal error: require(): Failed opening required '/home/runner/work/wp-rocket-changelog/wp-rocket-changelog/vendor-prefixed/wp-launchpad/core/inc/boot.php' (include_path='.:/usr/share/php') in /home/runner/work/wp-rocket-changelog/wp-rocket-changelog/wprocketchangelog.php on line 16
Warning: fopen(/home/runner/work/wp-rocket-changelog/wp-rocket-changelog/vendor-prefixed/wp-launchpad/core/inc/boot.php): failed to open stream: No such file or directory in /home/runner/work/wp-rocket-changelog/wp-rocket-changelog/vendor/antecedent/patchwork/src/CodeManipulation/Stream.php on line 151
Create a CI with install dependencies - name: Install dependencies run: composer install --prefer-dist --no-interaction --no-scripts
See the tests fail with failed to open stream: No such file or directory in /home/runner/work/wp-rocket-changelog/wp-rocket-changelog/vendor/antecedent/patchwork/src/CodeManipulation/Stream.php on line 151
Expected behavior
Tests (run composer run-tests) should pass.
Describe the bug
In a CI, the tests won't pass if scripts are excluded from dependencies on composer install.
See full error:
See CI job
To Reproduce Steps to reproduce the behavior:
- name: Install dependencies run: composer install --prefer-dist --no-interaction --no-scripts
failed to open stream: No such file or directory in /home/runner/work/wp-rocket-changelog/wp-rocket-changelog/vendor/antecedent/patchwork/src/CodeManipulation/Stream.php on line 151
Expected behavior Tests (run
composer run-tests
) should pass.CI needs to be changed to:
Backlog Grooming (for WP Media dev team use only)