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.

CommentFileSizeAuthor
password_policy-faster-tests.patch12.66 KBcoltrane

Comments

coltrane’s picture

Status: Active » Needs review
erikwebb’s picture

I worry about putting all of the constraints in one test. I'd rather have them split, so that we can see individual failures easier.

erikwebb’s picture

We'll address that later. This is fixed for now.

http://drupalcode.org/project/password_policy.git/commit/47a9461

erikwebb’s picture

Status: Needs review » Fixed
coltrane’s picture

Re #2, that's fair, I won't work towards that then.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.