PasswordPolicyTestCase was being used as a base test class with helper functions by being extended by PasswordPolicyConstraintsTestCase() and PasswordPolicyConditionsTestCase() but that leads to extra calls to testCreatePolicy() and testLoadPolicy().
By creating a PasswordPolicyTestBase() that only does setUp() and helper functions I was able to reduce the simpletest run time by 1 minute from 2 minute and 40 seconds.
Attached patch does this. I think PasswordPolicyConstraintsTestCase could be further sped up by running each constraint in a single test function, so I'll try that out next.
| Comment | File | Size | Author |
|---|---|---|---|
| password_policy-faster-tests.patch | 12.66 KB | coltrane |
Comments
Comment #1
coltraneComment #2
erikwebb commentedI worry about putting all of the constraints in one test. I'd rather have them split, so that we can see individual failures easier.
Comment #3
erikwebb commentedWe'll address that later. This is fixed for now.
http://drupalcode.org/project/password_policy.git/commit/47a9461
Comment #4
erikwebb commentedComment #5
coltraneRe #2, that's fair, I won't work towards that then.