-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
[Bug]: 0 Mutations for 0 Files created #1313
Comments
Yeah, same deal for me! I've tried to run it on at least two different test suites and it always reports 0 mutations. I haven't dug deeper, but would like to know why it is like this? Also running Windows with Herd. |
@schonhoff & @adevade I just started playing with Mutation Testing myself and ran into the exact same issue. Windows 10 & Herd. After some toying around though, here's what I found to actually get any results - You need to specify a path to the directory or file you want to test. Like so:
You cannot run any of the other available options. There is a optional parameter to pass a class instead of a path, but it yields the same empty results. Non-Working Example C:\Users\unisy\Herd\paws-out>.\vendor\bin\pest --mutate --parallel --class=App\Models
.....................................................................
Tests: 69 passed (86 assertions)
Duration: 4.86s
Parallel: 8 processes
Mutating application files...
0 Mutations for 0 Files created
Mutations: 0 tested
Score: 0.00%
Duration: 0.00s
Parallel: 8 processes
INFO No mutations created. Working Example C:\Users\unisy\Herd\paws-out>.\vendor\bin\pest --mutate --parallel --path=App\Models
.....................................................................
Tests: 69 passed (86 assertions)
Duration: 4.89s
Parallel: 8 processes
Mutating application files...
35 Mutations for 3 Files created
..................-----............
------------------------------------------------------------------------------------------------------------------------------------------------
UNCOVERED C:\Users\unisy\Herd\paws-out\app\Models\User.php > Line 25: RemoveArrayItem - ID: da586a3cffe63063
------------------------------------------------------------------------------------------------------------------------------------------------
UNCOVERED C:\Users\unisy\Herd\paws-out\app\Models\User.php > Line 26: RemoveArrayItem - ID: 07695e7f735bb13d
------------------------------------------------------------------------------------------------------------------------------------------------
UNCOVERED C:\Users\unisy\Herd\paws-out\app\Models\User.php > Line 27: RemoveArrayItem - ID: 9782a18c0a0f8762
------------------------------------------------------------------------------------------------------------------------------------------------
UNCOVERED C:\Users\unisy\Herd\paws-out\app\Models\User.php > Line 36: RemoveArrayItem - ID: 13a8405aad2eea49
------------------------------------------------------------------------------------------------------------------------------------------------
UNCOVERED C:\Users\unisy\Herd\paws-out\app\Models\User.php > Line 37: RemoveArrayItem - ID: 1f18c3373ffe0049
Mutations: 5 uncovered, 30 tested
Score: 85.71%
Duration: 0.49s
Parallel: 8 processes To be honest, passing a path is not the worst option in the world. In the example I have above, it will perform mutations on any models that I have added the |
What Happened
Hello,
I tried out the mutation plugin for pest but every time I tried it, it tells me that 0 Mutations for 0 Files were created.
I tried it with the new PHPStorm version, too. But it looks like the same result:
Hopefully someone has a guess why it won't work for me and my colleges at work.
How to Reproduce
You can use my sample repo and just run
./vendor/bin/pest --mutate
.I added the example mentioned in the mutation site on pestphp to the example repo (https://pestphp.com/docs/mutation-testing) and tried it. It is the same result in the demo as in my main repo.
Sample Repository
https://github.com/schonhoff/mutate-fail-example
Pest Version
3.5.1
PHP Version
8.3.13
Operation System
Windows
Notes
I'm using Laravel Herd on Windows.
Here is my config:
php.ini
The text was updated successfully, but these errors were encountered: