Cleanup user share at end of testAddShareAccepted#35668
Conversation
|
We still get out-of-memory PHPunit erros unrelated to this PR. I will restart CI to (hopefully) get a good run. |
3b9e1fb to
f4dd956
Compare
Codecov Report
@@ Coverage Diff @@
## master #35668 +/- ##
============================================
- Coverage 64.93% 64.85% -0.08%
Complexity 18777 18777
============================================
Files 1222 1222
Lines 70901 70901
Branches 1289 1289
============================================
- Hits 46037 45982 -55
- Misses 24486 24541 +55
Partials 378 378
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #35668 +/- ##
=======================================
Coverage 48.9% 48.9%
=======================================
Files 109 109
Lines 10569 10569
Branches 1289 1289
=======================================
Hits 5169 5169
Misses 5022 5022
Partials 378 378
Continue to review full report at Codecov.
|
karakayasemi
left a comment
There was a problem hiding this comment.
LGTM, looks like we are also creating new mount entries in this class and not removing them after test method.
Should we consider to merge all tidy up steps in a tearDown method?
|
I quickly tried making a teardown method. But Maybe after this fix, somebody could look into refactoring and making a teardown method. |
f4dd956 to
3fd0cec
Compare
|
Backport |
|
Note: PR #35312 that introduced |
3fd0cec to
fac0a83
Compare
fac0a83 to
956c850
Compare
|
No codecov result. |
Description
PR #35666 demonstrates that
apps/files_sharing/tests/External/ManagerTest.phptestAddShareAcceptedis leaving behind a share entry. That is causing the potential for later unit tests to fail.OCA\Files_Sharing\Tests\Command\CleanupRemoteStoragesTest::testCleanuphas been failing intermittently. The unit tests in apps are loaded and executed not necessarily in sctrict alphabetical order. The fail happens whenCommand/CleanupRemoteStoragesTesthappens to run afterExternal/ManagerTest.php. Note: PR #35665 suggests making the unit test loading order deterministic, to help avoid the "random" nature of issues like this in the future.apps/files_sharing/tests/External/ManagerTest.phptestAddShareAcceptedwas added by PR #35312 which was merged a few weeks ago. The intermittent problem has been around "for a while" - and I guess has been around for a few weeks.This PR explicitly removes the share created during
testAddShareAcceptedRelated Issue
#35658
Motivation and Context
Do not leave after-effects at the end of "unit" tests.
Note: lots of these "unit" tests are not really "unit" tests. They are integration tests - they do not mock the known universe, they do real stuff in a real database and have to be careful to clean up the environment so as not to mess up later tests. But that is words, the tests need to happen somewhere.
How Has This Been Tested?
Types of changes
Checklist:
Open tasks: