Problem/Motivation
This test installs the entity schema for every entity in entity_test module, and then checks if they need updates, in a lot of methods that otherwise have nothing to do with that module. We can save some time by avoiding entity_test module and also selectively installing all entity schemas only when necessary.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3615585
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 #3
catchNot sure how much this does, but to really optimize it a lot more we'd need to split entity_test into multiple modules probably so that there's less entity types in the system at any one time or completely remove the dependency on entity_test in this test.
Comment #4
smustgrave commentedNot sure how to measure but seems to be passing, minus the almost consistent JS failures now.
Comment #5
mstrelan commentedFound some more optimisations.
For reference, here are the test times from one run on my machine:
main: 143.2s
MR (d37bcab4): 82.2s
additional optimisations: 42.8s
Comment #6
catchThat sounds worth doing. I was wondering about opening an issue top split entity_test module up so it's closer to a module per entity type or something but that seemed like a lot of work. This might achieve the same thing.
Comment #7
mstrelan commentedOK I pushed my changes. I was a little concerned about the words "Multiple Types" in the class name
EntityDefinitionUpdateMultipleTypesTestbut then found it was only after splitting in #3492944: Split up EntityDefinitionUpdateTest. Are we losing coverage here or is this fine?Also note a few minor assertion changes. We can roll those functions back if needed.
Comment #8
catchIt's only called multiple types because it explicitly relies on a handful of different entity types. The implicit extra entity types I really don't think we are losing anything except wasted time and CPU running the test.