Problem/Motivation
\Drupal\Tests\rest\Functional\EntityResource\XmlEntityNormalizationQuirksTrait skips both testPatch and testPost but this occurs after installing Drupal. This can cost 15 seconds of compute time per skipped test... see page 169 of https://git.drupalcode.org/project/drupal/-/pipelines/227006/test_report...
Steps to reproduce
Run ./vendor/bin/phpunit core/modules/comment/tests/src/Functional/Rest/CommentXmlBasicAuthTest.php --filter testPostDxWithoutCriticalBaseFields
Proposed resolution
Use attributes to add methods run before a test to mark it skipped if we are skipping based on name.
Running ./vendor/bin/phpunit core/modules/comment/tests/src/Functional/Rest/CommentXmlBasicAuthTest.php --filter testPostDxWithoutCriticalBaseFields before takes Time: 00:08.349, Memory: 10.00 MB and after takes Time: 00:00.463, Memory: 10.00 MB
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
N/a
Issue fork drupal-3462264
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
alexpottComment #4
alexpottBetter title...
Comment #5
catchThis looks great, do we want to do the other REST tests that skip on the XML format?
Looks like at least these:
I think we can also use the same pattern in:
and similar too, probably better in its own issue though.
Comment #6
alexpottComment #7
alexpottThe MR takes us to only 7 functional test methods being skipped that actually take longer than 0.00 seconds! Down from over hundred...
I think this is ready for review.
Comment #9
alexpottAdded an MR to backport this to 10.x using the annotation for before instead of the attribute.
Comment #10
longwaveBoth MRs look great to me.
Comment #16
catchHard to see what the impact on pipeline wall times is going to be due to variation between test runs, but even if it only takes 10 seconds to install Drupal, ~100 less installs is 1000 seconds less test time. There are also some specific tests (like file upload ones) which have been some of the most individually long running tests that this should help with too.
Committed/pushed the respective MRs to 11.x/11.0.x/10.4.x, 10.3.x, thanks!
Comment #19
wim leers👏