Skip to content

Use BCrypt's MIN_COST in the test environment for speedier tests#8216

Merged
rafaelfranca merged 1 commit intorails:masterfrom
trevorturk:master
Nov 14, 2012
Merged

Use BCrypt's MIN_COST in the test environment for speedier tests#8216
rafaelfranca merged 1 commit intorails:masterfrom
trevorturk:master

Conversation

@trevorturk
Copy link
Copy Markdown
Contributor

I came across this blog post:

http://collectiveidea.com/blog/archives/2012/11/12/tests-oddly-slow-might-be-bcrypt/

...which suggests putting the following into a your test_helper:

BCrypt::Engine::DEFAULT_COST = 1

...for a speedier test suite.

I tested this out on a few apps, found a noticeable speedup, and worked with @jeremy on this pull request after reviewing the feedback on this existing pull request: #285

@steveklabnik
Copy link
Copy Markdown
Member

👍

@guilleiguaran
Copy link
Copy Markdown
Member

I'm :+1000: on this, can you add an entry on CHANGELOG please?

Thanks 😄

@tomafro
Copy link
Copy Markdown
Contributor

tomafro commented Nov 14, 2012

Looks good to me.

@lazyatom
Copy link
Copy Markdown
Contributor

Also looks good to me. Hurray for faster tests!

@carlosantoniodasilva
Copy link
Copy Markdown
Member

That's what we do in devise as well 👍

@trevorturk
Copy link
Copy Markdown
Contributor Author

I force-pushed an update to include the CHANGELOG entry. Let me know if you guys would like any other changes. Thanks!

rafaelfranca added a commit that referenced this pull request Nov 14, 2012
Use BCrypt's MIN_COST in the test environment for speedier tests
@rafaelfranca rafaelfranca merged commit 77edb7c into rails:master Nov 14, 2012
@rafaelfranca
Copy link
Copy Markdown
Member

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants