From c583ab92c7b50b39993416346ea50eb657db0f42 Mon Sep 17 00:00:00 2001 From: Greg Cobb Date: Mon, 26 Jan 2026 23:45:59 -0800 Subject: [PATCH] Add ./bin to path in .envrc - So that the spring-ified rspec binary (and other spring binstubs) run by default - This makes tests run faster by default --- .envrc | 2 ++ spec/README.md | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.envrc b/.envrc index 6b80a681cb..c75883c52b 100644 --- a/.envrc +++ b/.envrc @@ -8,3 +8,5 @@ if (( cores > 8 )); then export PARALLEL_TEST_PROCESSORS=8 fi + +PATH_add bin diff --git a/spec/README.md b/spec/README.md index f975b0c0e6..22291b5822 100644 --- a/spec/README.md +++ b/spec/README.md @@ -128,14 +128,15 @@ CC in a background process and then forks it every time you run tests. That means that everything loaded prior to the fork doesn't need to be re-loaded every time you run tests. This can speed up tests substantially. -To use spring, run `./bin/rspec` in place of `rspec`. Spring should -automatically watch and reload files, but you can manually stop it with -`./bin/spring stop`. It will automatically start again the next time you run -`./bin/rspec`. +To use Spring, run `./bin/rspec` in place of the default `rspec` binary. CC's +`.envrc` adds the `./bin`` directory to your PATH, so in most cases you can +just run `rspec`. Spring will automatically watch and reload files, but you can +manually stop it with `spring stop`. It will automatically start again +the next time you run `rspec`. Example performance improvement: ```sh -❯ multitime -n 10 bundle exec rspec spec/unit/actions/app_create_spec.rb +❯ multitime -n 10 bundle exec /path/to/default/rspec spec/unit/actions/app_create_spec.rb ... @@ -160,6 +161,8 @@ user 0.177 0.032 0.129 0.185 0.233 sys 0.103 0.014 0.078 0.107 0.126 ``` +If you do not want to use Spring, you can set the `DISABLE_SPRING` environment variable. + #### Spork (Legacy) Spork is an older implementation of the same "forking" strategy implemented by Spring.