Faster tests, no need to bcrypt in integration tests

RESOLVED FIXED in 2.4

Status

Webtools
Elmo
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: peterbe, Assigned: peterbe)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
With bcrypt as the hasher storing our users' passwords:

    Ran 170 tests in 27.822s

With MD5...:

    Ran 170 tests in 14.478s

I ran some profiling on the test suite and django_sha2's hasher.py is the most guilty one.

We don't need secure passwords in tests. Besides, we don't really care much about passwords because our real users are stored with unusable passwords anyway (using LDAP instead)
(Assignee)

Comment 1

6 years ago
Created attachment 676367 [details] [diff] [review]
works wonderfully

I'm applying this same technique on all my other projects.
Attachment #676367 - Flags: review?(l10n)
(Assignee)

Comment 2

6 years ago
An alternative is to leave in settings/local.py-dist, but commented out, this setting so individual developers who are confident with what they do can switch this on for faster tests. 
30 seconds it's much to wait for for jenkins.

Comment 3

6 years ago
Comment on attachment 676367 [details] [diff] [review]
works wonderfully

Review of attachment 676367 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me, r=me.
Attachment #676367 - Flags: review?(l10n) → review+
(Assignee)

Updated

6 years ago
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED

Updated

6 years ago
Target Milestone: --- → 2.4

Updated

6 years ago
Assignee: nobody → peterbe
You need to log in before you can comment on or make changes to this bug.