Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
While working on: #2605664: [Needs change record updates] Align TestDiscovery and bootstrap.php's non-permissive loading of PSR-4 namespaces for traits
MissingDependentModuleUnitTest
kept failing while I was running the simpletest group with the phpunit binary.
But it never failed when I ran run-tests.sh.
Turns out it has the wrong namespace declaration, so run-tests.sh ignored it.
Proposed resolution
Change the namespace.
Deal with the failing test.
Remaining tasks
Have run-tests.sh/TestDiscovery throw an exception when tests don't conform, in order to prevent false positives.
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#10 | convert-2722731-7.patch | 720 bytes | neclimdul |
#4 | 2721355-4.patch | 534 bytes | alexpott |
#4 | 2721355-4.test-only.patch | 724 bytes | alexpott |
#2 | 2721355_2.patch | 453 bytes | Mile23 |
Comments
Comment #2
Mile23Simple change of namespace.
Unfortunately this leads to a failing test, which I'm not sure how to fix, so the testbot should fail.
Comment #3
Mile23Right, so the testbot *still* didn't find it, even though run-tests.sh finds it for group simpletest.
Comment #4
alexpottSo the whole point is that the test is supposed to not be discovered because of the @dependencies annotation.
Comment #6
neclimdulWell... that's not going to work in phpunit.
Maybe the real fix is this should be moved back to simpletest since its testing its discovery.
Comment #7
neclimdulYou know what, I'll follow up with that separately. This is fine.
Comment #8
alexpott@neclimdul actually I think your real fix is the right fix :)
Comment #9
neclimdulthis one? #2722731: Mark MissingDependentModuleUnitTest as incomplete
Comment #10
neclimdulThis had the original patch actually so actually we can solve it here. I meant to solve a different issue in the other issue as a follow but we can solve it all here.
Filed a follow up for actual phpunit module dependency support since KTB doesn't link to one in its TODO and I couldn't find one. #2728579: Explicitly skip @requires module in PHPUnit Kernel and Browser tests
Comment #11
Mile23I don't see where
MissingDependentModuleUnitTest
ran on the testbot, which is apparently the goal, so therefore yay!Unfortunately that also means we can't see whether it was actually rejected or just didn't run due to some other error. The solution from the other issue is actually a better one in terms of testing, where we can see a skipped test.
So it's not a great test, but at least we solved the namespace problem.
Comment #12
neclimdulRight, simpletest doesn't have the same "skipped" idea. There is an issue to implement that or an "expected failure" or both but I doubt there is much momentum behind it at this point so this is fine.
Comment #14
Mile23The fact that
Drupal\migrate_drupal_ui\Tests\d6\MigrateUpgrade6Test
can ruin the status of so many issues makes me never want to migrate my old D6 site. :-)Comment #15
neclimdul90% sure its a bug in sqlite libraries or filesystem issues.
Comment #18
catchCommitted/pushed to 8.2.x and cherry-picked to 8.1.x. Thanks!