Uh oh!
There was an error while loading. Please reload this page.
Fix risky test without assertion - #32761
Conversation
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
nickvergessen
commented
Jun 8, 2022
@PVince81 you added tests/lib/Encryption/UtilTest.php last week, but it doesn't work: Can you have a look? |
PVince81
commented
Jun 8, 2022
hmm, they worked for me locally but I had files_external enabled. probably because we're using a class from an app that might not be enabled during test run, or only during specific order I'll see if I can trigger enabling of the app in setUp, otherwise will need to do it in the test setups |
Because we have more tests now that require classes from this app. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
PVince81
commented
Jun 8, 2022
I didn't find code in core where the app would be enabled through tests, so I added it to "enable_apps.php": 6df0a79 turns out other apps like "encryption" is there too let's see if the tests pass now on CI... they passed locally again for me until I disabled files_external |
PVince81
commented
Jun 8, 2022
looks like enabling files_external makes it worse as now tests are trying to run, I'll revert it for now. will need another more targetted solution that doesn't require including the class |
This reverts commit 6df0a79.
Don't rely on files_external being enabled and mock all the classes from it. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
PVince81
commented
Jun 8, 2022
here we go, all mocked: de93d17 not sure how long this PR will live, we might want to cherry pick some fixes into separate PRs ? |
Uh oh!
There was an error while loading. Please reload this page.
| ->willReturn($storages); | ||
| $this->overwriteService(GlobalStoragesService::class, $storagesServiceMock); | ||
| $this->overwriteService('OCA\\Files_External\\Service\\GlobalStoragesService', $storagesServiceMock); |
There was a problem hiding this comment.
Why for core class you went from string to ::class and for files-external classes you go the other way around?
There was a problem hiding this comment.
Because core classes are fine. This class might not be loaded as the test is in core and the app is not force enabled nor default enabled
Before: