.vbw-planning/milestones/aia-ssl-fix/02-test-performance/PLAN-02.md
Two quick wins that reduce test wall-clock time: (1) eliminate 95MB of debug log IO by setting test log level to :warn (saves 5-15s), and (2) ensure integration tests are organized under test/integration/ so developers can exclude the 31s of subprocess-spawning tests during iterative development using --exclude-pattern.
@ test/dummy/config/environments/test.rb -- currently has no explicit log_level (defaults to :debug)@ test/integration/host_install_flow_test.rb -- slow integration test (subprocess spawning, ~15s)@ test/integration/release_packaging_test.rb -- slow integration test (gem build + subprocess, ~15s)@ test/integration/engine_mounting_test.rb -- fast integration test (route checks)@ test/integration/navigation_test.rb -- empty placeholder test@ test/test_helper.rb -- contains DEFAULT_TEST_EXCLUDE but does NOT need modificationRationale: The research found 95MB of :debug log output during tests. Setting :warn eliminates this IO without losing any test coverage. Integration tests already live under test/integration/ -- we just need to verify the exclude pattern works and document it.
In test/dummy/config/environments/test.rb, add after the config.cache_store = :null_store line:
# Reduce log IO in tests -- :debug generates ~95MB of output.
config.log_level = :warn
This is a single-line addition. The research confirmed this saves 5-15s per run by eliminating disk IO for debug/info log messages.
Confirm all 4 integration test files are properly under test/integration/:
test/integration/host_install_flow_test.rb (slow -- subprocess spawning)test/integration/release_packaging_test.rb (slow -- gem build)test/integration/engine_mounting_test.rb (fast -- route assertions)test/integration/navigation_test.rb (empty placeholder)No file moves needed -- they are already in the correct location. The --exclude-pattern flag works with glob patterns on the file path.
Create lib/tasks/test_fast.rake with a convenience task:
# frozen_string_literal: true
namespace :test do
desc "Run tests excluding slow integration tests"
task fast: :environment do
$stdout.puts "Running tests excluding integration/ directory..."
system(
"bin/rails", "test",
"--exclude-pattern", "**/integration/**",
exception: true
)
end
end
This provides bin/rails test:fast as a developer convenience that excludes the integration directory.
Run verification:
# Full suite (all tests including integration)
bin/rails test
# Fast mode (excluding integration)
bin/rails test --exclude-pattern="**/integration/**"
# Lint modified files
bin/rubocop test/dummy/config/environments/test.rb lib/tasks/test_fast.rake
Verify the fast mode excludes the integration tests and completes significantly faster.
| Action | Path |
|---|---|
| MODIFY | test/dummy/config/environments/test.rb |
| CREATE | lib/tasks/test_fast.rake |
# Full suite passes
bin/rails test
# Exclude pattern works (fewer tests, no integration)
bin/rails test --exclude-pattern="**/integration/**"
# Lint
bin/rubocop test/dummy/config/environments/test.rb lib/tasks/test_fast.rake
grep "log_level" test/dummy/config/environments/test.rb shows :warnbin/rails test runs all 1031+ tests (no regressions)bin/rails test --exclude-pattern="**/integration/**" runs successfully with fewer testslib/tasks/test_fast.rake exists and is syntactically valid