Skip to content

Hash fixture passwords at minimum bcrypt cost - #285

Open
cattekin wants to merge 1 commit into
basecamp:mainfrom
cattekin:test-performance
Open

cattekin wants to merge 1 commit into
basecamp:mainfrom
cattekin:test-performance

Conversation

@cattekin

Copy link
Copy Markdown

Fixtures call BCrypt directly, bypassing Rails test configuration.

Switching to MIN_COST significantly reduces test run time:

before

Finished in 4.501719s, 90.4099 runs/s, 303.4396 assertions/s.
407 runs, 1366 assertions, 0 failures, 0 errors, 1 skips

after

Finished in 1.068829s, 380.7906 runs/s, 1278.0342 assertions/s.
407 runs, 1366 assertions, 0 failures, 0 errors, 1 skips

The fixture calls BCrypt directly, bypassing Rails' test configuration.
Copilot AI balanced review requested due to automatic review settings September 29, 2026 05:11

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approved

The focused change is valid, consistent with existing development setup, and introduces no unresolved issues.

Review effort: Balanced
Findings: None

What changed in this PR

Uses bcrypt’s minimum cost for fixture passwords, significantly speeding up test setup while preserving authentication behavior.

Changes:

  • Configures fixture password hashing with BCrypt::Engine::MIN_COST.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
test/​fixtures/​users.yml Reduces bcrypt cost for test fixture password generation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants