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.
See #2862508: Convert system functional tests to phpunit
See #2735005: Convert all Simpletest web tests to BrowserTestBase (or UnitTestBase/KernelTestBase)
Scope:
Everything in /core/modules/system/src/Tests/Module
Comment | File | Size | Author |
---|---|---|---|
#17 | 2930072-12.patch | 4.68 KB | Lendude |
#12 | 2930072-12.patch | 4.68 KB | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedvaplas created an issue. See original summary.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #7
dawehnerThank you @vaplas for trying to tackle this beast :) So far the changes look minimal, but it all depends whether the tests are actually passing or not.
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks for the review, @dawehner!
When I started the conversion, I forgot to delete a couple of unsuccessful experiment modules from the contrib 'modules' folder (without config schemes and help hooks). And
InstallUninstallTest
works with fails. Therefore, something is definitely checkes :)Although it seems strange to me that InstallUninstallTest checkes all the modules, not only in core folder.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedRandom failure with apc memory.
Comment #11
Lendude@vaplas++
Couldn't this just be
$this->assertEqual(!empty($checkbox[0]->getAttribute('disabled')), $i % 2, $dependencies[$i]);
? Then there is no need to change the xpath.Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commented@Lendude, thanks for nice point! This helps not only to halve the change in the code (:p, I love such statistics), but perhaps even more compatible. Because it keeps checking the attribute value, not the number of items (as in my previous version). Done.
Comment #13
dawehnerWow I cannot believe that this just works :) I fear we should have a couple of more test runs to prove this doesn't fail more often than right now :( Any idea how we should tackle this ideally?
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedYes, I have already tried to make more test runs
In both case
'Build timed out'
after 124 runs. I suspect that with simpletest when the test runs, there is a leak of resources that lead to the crash of CI:https://dispatcher.drupalci.org/job/drupal_patches/40289/console
1 hour between last test and time out. But maybe the problem is in the environment. So, let's check by 100 runs.
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedPhpunit version works more slower, but stability (at least more stable than simpletest version).
Okay. Then why did #6 fail first? Because not only InstallUninstallTest (simpletest) is a generator of such fails. #2926309: Random fail due to APCu not being able to allocate memory
So, if we convert this into a phpunit version, we can reduce the frequency of these fails.
Comment #17
Lendude@vaplas so looks like #6 was just a fluke right?
So then this looks all good and nice minimal changes!
Just re-upping the patch from #12 to make clear which patch is RTBC.
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commentedYes, it is similar to the fact that InstallUninstallTest-simpletest, like and rest tests, exhausts some resources of CI very quickly. Perhaps InstallUninstallTest-phpunit also eating these resources, but to a lesser extent. Therefore, it works more steadily (#14).
Unfortunately, we have not yet figured out exactly the root of all evils. But it seems, that #17 is definitely not a step back :)
Comment #19
catchCommitted/pushed to 8.5.x and cherry-picked to 8.4.x. Thanks!