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
14 test methods means that the test basically takes as long as 14 separate test classes with a single test method, except that it can't be run in parallel.
Try to group the test methods into 3-4 groups that belong to together, make separate test classes for them. That should speed up test bot, as it can run them in parallel.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#21 | diff_2822537_plugin_20.patch | 67.24 KB | miro_dietiker |
#19 | diff_2822537_plugin_19.patch | 50.76 KB | miro_dietiker |
#18 | diff_2822537_tests_18.patch | 34.86 KB | miro_dietiker |
#16 | diffplugintest_contains-2822537-16.patch | 17.1 KB | Ginovski |
#16 | interdiff-2822537-15-16.txt | 620 bytes | Ginovski |
Comments
Comment #2
miro_dietikerComment #3
miro_dietikerWe could also group the test methods as:
function testPlugins() {
doTestCommentPlugin();
doTestCorePlugin();
...
}
This removes most time = setup. And the tests are indeed pretty isolated and don't need a new environment.
BTW each method should contain a @see reference to its corresponding plugin class.
Comment #4
miro_dietikerPrio down, although still happy to see this cleanup happen.
Comment #5
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commentedAdded method and @see references to the plugins.
Comment #6
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commentedComment #8
miro_dietikerMoving the failing one into a separate test again.
Comment #10
miro_dietikerComment #12
miro_dietikerCommitting this temporary improvement.
Strange: I have lots of failing tests locally. Didn't figure out yet why.
Back to needs work to to apply the pattern to the other ones that failed.
Comment #13
johnchqueThe test will fail locally if you have the Visual Inline libraries installed.
Comment #14
miro_dietikerCreated issue to clean-up / fix test fails related to htmldiff: #2823903: Make tests pass when html diff library is present
Keeping this issue needs-work to further split the tests / reduce test methods in DiffPluginTest.
Comment #15
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commented1. Added new DiffEntityPluginTest with 3 methods extracted from DiffPluginTest
-testEntityReferencePlugin
-testFilePlugin
-testImagePlugin
2. Configured DiffPluginTest and removed default configs that weren't needed
Tests passed locally
Comment #16
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commentedSmall fix in the DiffPluginTest, added description and deleted extra line.
Comment #17
miro_dietikerThat's now 3 cases in newly created class.
@Berdir, did you intend this or a test class per plugin, or stay with the current approach and convert them to a doTestXYZ pattern because they don't necessarily need a full reinstall - except that they currently accidentally clash?
Comment #18
miro_dietikerShifted some stuff around. The PluginTest still needs division. But all other tests now use variables for all ID's and made the views configuration optional. Their runtime is much lower.
Comment #19
miro_dietikerAnd now with all the things separated.
Thought i would do more test classes - one per plugin - but that was not needed as the plugins can be tested with doXYZ approach easily.
Test run time down nicely. Just below 1m30 for me.
Comment #21
miro_dietikerRetryyyy..
Comment #24
miro_dietikerOh... Committed with declaring the base class abstract. Yippie! :-)