# |
Jun 14th 2018, 12:55 |
spriz |
whenever I add method number 2, that method will pass |
# |
Jun 14th 2018, 12:54 |
spriz |
if i comment all the methods, and enable them one by one, they all fail |
# |
Jun 14th 2018, 12:51 |
lorenzo |
tray removing one by one until you find which it is |
# |
Jun 14th 2018, 12:50 |
lorenzo |
there must be one test in that file that is making the others fail |
# |
Jun 14th 2018, 12:48 |
spriz |
they pass - they dont fail. |
# |
Jun 14th 2018, 12:48 |
spriz |
as long as I put a method in the top of the file with assertTrue(true) all the other tests fail |
# |
Jun 14th 2018, 12:46 |
lorenzo |
what about that test you had to move that makes it fail? |
# |
Jun 14th 2018, 12:43 |
spriz |
also if it just contains `$this->assertTrue(true);` :) |
# |
Jun 14th 2018, 12:41 |
spriz |
:,'( If I add `public function testDummyMethod(){$this->get('/login');}` as the top test in the file, my suite passes…. |
# |
Jun 14th 2018, 12:41 |
spriz |
deleted it in my .env file and everything :thinking_face: |
# |
Jun 14th 2018, 12:40 |
spriz |
So - even if I put the same details in the ‘default’ and ‘test’ keys in `app.php` it does use the now non-stated default connection |
# |
Jun 14th 2018, 12:36 |
spriz |
the stateless-ness :) <3 |
# |
Jun 14th 2018, 12:36 |
spriz |
if I move them around, the add fails, and index passes |
# |
Jun 14th 2018, 12:35 |
spriz |
motherf…. :) It’s the first test in that file that fails |
# |
Jun 14th 2018, 12:35 |
spriz |
gimme a sec, I confused myself now |
# |
Jun 14th 2018, 12:35 |
lorenzo |
? |
# |
Jun 14th 2018, 12:35 |
spriz |
the index method was the problem |
# |
Jun 14th 2018, 12:35 |
spriz |
now wait |
# |
Jun 14th 2018, 12:35 |
spriz |
woah,woa |
# |
Jun 14th 2018, 12:34 |
spriz |
the add method is the probvlem |
# |
Jun 14th 2018, 12:34 |
lorenzo |
oh, if you filter only on that test it also fails? |
# |
Jun 14th 2018, 12:33 |
spriz |
like so `vendor/bin/phpunit --debug plugins/Admin/tests/TestCase/Controller/FeatureGroupsControllerTest.php --filter=testAdd` right ? |
# |
Jun 14th 2018, 12:33 |
spriz |
Yurp |
# |
Jun 14th 2018, 12:33 |
lorenzo |
@spriz if you only run that file, does it also fail? |
# |
Jun 14th 2018, 12:33 |
lorenzo |
so it must be another test changing the aliasing somehow |
# |
Jun 14th 2018, 12:32 |
lorenzo |
this is pro tip, btw: in your test bootstrap, delete the default connection Using `ConnectionManager::drop()` that will expose problem earlier and also prevent tragic accidents |
# |
Jun 14th 2018, 12:32 |
spriz |
I guess that’s completely isolated |
# |
Jun 14th 2018, 12:32 |
spriz |
at least using `vendor/bin/phpunit src/to/file --filter=testAdd |
# |
Jun 14th 2018, 12:31 |
spriz |
only the failing one - the other passing ones does pass if they’re ran isolated |
# |
Jun 14th 2018, 12:31 |
lorenzo |
if you tun that test alone, does it fail too? |
# |
Jun 14th 2018, 12:30 |
spriz |
worst part is: this is the controller action that fails: `public function index(){return $this->Crud->execute();}` :,) :,) |
# |
Jun 14th 2018, 12:30 |
spriz |
if I put that debug in the AppController it spits our right number for the other test methods |
# |
Jun 14th 2018, 12:29 |
spriz |
testing same controller |
# |
Jun 14th 2018, 12:29 |
spriz |
not the other tests in same file |
# |
Jun 14th 2018, 12:29 |
spriz |
oh - the worst part is btw that’s it’s only seem to be for one test |
# |
Jun 14th 2018, 12:27 |
spriz |
what actually breaks is that the controller goes crazy on a `->firstOrFail()` since it cannot find the specified id (which is in our fixtures only) |
# |
Jun 14th 2018, 12:26 |
spriz |
only thing calling alias is the migrations plugin in a trait, which we’re not running though |
# |
Jun 14th 2018, 12:26 |
spriz |
if I do a `debug($this->Users->find()->count())` in the Controller it’s testing I get the number of users in my dev env rather than from fixtures |
# |
Jun 14th 2018, 12:25 |
lorenzo |
how do you know it is using the default? |
# |
Jun 14th 2018, 12:25 |
lorenzo |
is something else calling alias again? |
# |
Jun 14th 2018, 12:25 |
lorenzo |
do you have a test connection declared? |