Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeception4: GroupManager reports missing test file

I upgraded Codeception to v4 (according to THIS) and then Symfony to v5 (according to THIS). Now, when I try to run tests I get an error about missing test file:

root@blabla: vendor/bin/codecept run

In GroupManager.php line 129:

GroupManager: File or directory /var/www/html/tests/unit/SomeFileCest.php does not exist

This file does NOT exist in current branch. It exists in another branch of the project, but current should not know anything about this file!

This problem happens no matter which branch I switch to. So somehow Codeception remembers, that one branch has additional test and demands that test in other branches. Looks like some sort of cache.

If I switch to the branch WITH the missing file, everything looks OK (I do get an error, but because of the old framework expected).

Error appears if I do vendor/bin/codecept run or vendor/bin/codecept run tests/functional for example (note that the missing test is a unit test).

I tried deleting /var and /vendor and running composer install/update. I also tried removing the branch completely and pulling from remote, but no joy.

Anybody has any idea why this would happen and how to fix this?

like image 711
callmebob Avatar asked Jan 06 '20 09:01

callmebob


1 Answers

EDIT: After some simple testing it looks like it's related to old references in tests/_support/failed (as @Naktibalda mentioned in his/her comment).


I still don't fully understand what happened, but this can be fixed by running:

vendor/bin/codecept clean

From Codeception help:

clean Recursively cleans log and generated code

I will try to investigate further to understand why this happens, but for now this is what I have.

I hope this helps someone avoid the frustrations I went through ;)

like image 100
callmebob Avatar answered Sep 23 '22 01:09

callmebob