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

Defer loading capybara gems until system test is executing #52

Merged
merged 4 commits into from
May 24, 2024

Conversation

mattbrictson
Copy link
Owner

@mattbrictson mattbrictson commented Mar 31, 2024

In practice, system tests are run less often than other tests. This is because they are slow, and also because rails test skips system tests by default.

However, the default Gemfile in Rails apps loads capybara regardless, even when a system test isn't being run. This means that unit tests run slightly slower.

To facilitate TDD, I'd like tests to load as fast as possible. To help with that, this PR sets require: false for capybara-related gems in the Gemfile and then defers loading capybara until a system test is run.

@mattbrictson mattbrictson added the ✨ Feature Adds a new feature label Mar 31, 2024
@mattbrictson mattbrictson marked this pull request as ready for review May 24, 2024 21:53
@mattbrictson mattbrictson added the automerge Automatically merge PR once all required checks pass label May 24, 2024
@kodiakhq kodiakhq bot merged commit d78ca0f into main May 24, 2024
7 checks passed
@kodiakhq kodiakhq bot deleted the lazy-capybara branch May 24, 2024 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once all required checks pass ✨ Feature Adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant