wp-launchpad / launchpad

Launchpad is a framework for WordPress plugin that allows you to create a modern PHP plugin in no time.
https://wp-launchpad.gitbook.io/launchpad/
GNU General Public License v2.0
22 stars 0 forks source link

CI crashes without scripts dependencies #15

Open nicomollet opened 5 months ago

nicomollet commented 5 months ago

Describe the bug

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

See CI job

To Reproduce Steps to reproduce the behavior:

  1. Create a CI with install dependencies - name: Install dependencies run: composer install --prefer-dist --no-interaction --no-scripts
  2. 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.

CI needs to be changed to:

      - name: Install dependencies
        run: composer install --prefer-dist --no-interaction

Backlog Grooming (for WP Media dev team use only)