Skip to content

InstallCommand::determineTestEnforcement() times out when listing tests #512

@decnorton

Description

@decnorton

Boost Version

2.0.5

Laravel Version

12.44.0

Agent/IDE Name & Version

No response

PHP Version

8.4

System Info

macOS Sequoia Apple M3 Max, Laravel Herd

Description

We have roughly 16,000 PHPUnit tests in our project, and we've run into this issue each time we've tried to add Boost to the project (first around 3 months ago, and most recently today).

When running boost:install, the install determines if tests are present in the project by calling php artisan test --list-tests using the Symfony Process component. It has the default timeout of 60 seconds applied, and it hits this timeout each time we try.

If I run the command manually in the terminal it completes in 1 second. Increasing the Process timeout has no effect, it seems as if it's hanging indefinitely.

If I change determineTestEnforcement() to instead call phpunit directly, it succeeds:

$process = new Process([PHP_BINARY, 'vendor/phpunit/phpunit/phpunit', '--list-tests'], base_path());

There are couple of options to address this:

  • Detect Pest or PHPUnit and call the binary directly. Boost already detects whenever the Pest or PHPUnit packages are installed.
  • Add a prompt to ask the user manually if they want to include testing guidelines.

Steps To Reproduce

Honestly I'm not sure; there could be something specific to our codebase that is modifying the output of php artisan test --list-tests in a way that affects the process component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions