Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Nov 14, 2012
Merged

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

merged 1 commit into from Nov 14, 2012

Conversation

trevorturk
Copy link
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
Member

👍

@guilleiguaran
Copy link
Member

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

Thanks 😄

@tomafro
Copy link
Contributor

tomafro commented Nov 14, 2012

Looks good to me.

@lazyatom
Copy link
Contributor

Also looks good to me. Hurray for faster tests!

@carlosantoniodasilva
Copy link
Member

That's what we do in devise as well 👍

@trevorturk
Copy link
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
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.

None yet

8 participants