Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Infection to run without a pre-existing Test Framework configuration file #1864

Open
thompsnm opened this issue May 16, 2023 · 0 comments

Comments

@thompsnm
Copy link
Contributor

Description

My team has implemented a binary that wraps around PHPUnit and configures / executes tests for us when we simply point it at a particular directory. I want to implement an Infection Test Framework extension that we would only use internally that executes tests via our binary. Since our binary dynamically creates a PHPUnit configuration file, there is no existing configuration file to point Infection to. However, when I try to run Infection I get the following error because it requires a configuration file exist:

In FileOrDirectoryNotFound.php line 71:

  The path "/home/nthompson/development/MyApp/modules/ExampleModule" does not contain any of the requested files: "PhpUnitTestRunner.xml", "PhpUnitTestRunner.yml", "PhpUnitTestRunner.xml.dist", "PhpUnitTe
  stRunner.yml.dist", "PhpUnitTestRunner.dist.xml", "PhpUnitTestRunner.dist.yml"

Workaround

If I create a fake, empty configuration file by running the following command then Infection works as expected:

touch modules/ExampleModule/PhpUnitTestRunner.yml

Ideal Solution

I would much prefer to be able to simply turn off the check for a pre-existing configuration file.

Related Context

I also submitted the bug Infection can't run custom Test Framework extensions because TestFrameworkTypes is hardcoded related to other issues I encountered while setting up my Test Framework extension. Whereas that bug will affect anyone trying to create a Test Framework extension, I realize this feature request may be more niche to my use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant