Drop system tests: adopt Rails 8 endpoint-first testing philosophy #63

Closed
opened 2026-06-03 03:37:40 +00:00 by ldraney · 0 comments
Owner

Type

Feature

Lineage

  • Board: board-landscaping-assistant
  • Story: ci-optimization

Repo

ldraney/landscaping-assistant

User Story

As a developer, I want the CI pipeline to pass reliably without browser-based system tests, so that PRs merge without flaky Chromium timeouts on a resource-constrained worker.

Context

System tests (Capybara + Cuprite + headless Chromium) break the CI pipeline. Chromium fails to produce a websocket URL within timeout during reset! calls between tests. Every pipeline since PR #54 introduced system tests has failed. The 7 system tests verify Stimulus controller wiring (CSS class toggles, DOM element visibility) — thin JS glue, not business logic.

Rails 8 no longer generates system tests by default. The official guide says: "System tests should be reserved for critical user paths. For most features, integration tests provide a better balance." In a Hotwire app, the server IS the frontend — request specs verify endpoint responses, which is the app's responsibility. Whether Turbo applies those responses correctly is the framework's responsibility.

File Targets

  • Gemfile — remove cuprite gem
  • Gemfile.lock — regenerate without cuprite/ferrum
  • .woodpecker.yaml — remove chromium install, CHROMIUM_PATH, FERRUM_PROCESS_TIMEOUT
  • spec/system/ — delete directory (3 files, 7 examples)
  • spec/support/system_test_config.rb — delete Cuprite driver config
  • docs/testing-strategy.md — rewrite with endpoint-first philosophy

Acceptance Criteria

  • 82 remaining specs pass (19 model + 63 request)
  • No Chromium/browser dependencies in CI
  • Pipeline completes without browser-related timeouts
  • docs/testing-strategy.md documents the endpoint-first philosophy with rationale and mermaid diagrams

Test Expectations

  • 82 remaining specs pass (19 model + 63 request)
  • No Chromium/browser dependencies in CI
  • Pipeline completes in under 5 minutes (no browser startup overhead)

Constraints

  • Keep capybara gem (used by request spec infrastructure)
  • Do not add new test dependencies
  • Document the philosophy change in docs/

Checklist

  • Remove cuprite gem and regenerate lockfile
  • Delete spec/system/ and spec/support/system_test_config.rb
  • Remove Chromium from CI pipeline
  • Rewrite testing-strategy.md with mermaid diagrams
  • Verify pipeline passes
  • PR #54: Added system test infrastructure (being reversed)
  • PR #59: Bumped Cuprite timeouts (insufficient)
  • PR #61: Added FERRUM_PROCESS_TIMEOUT env var (insufficient)
  • Issue #60: Bundle caching (related CI improvement)
### Type Feature ### Lineage - Board: board-landscaping-assistant - Story: ci-optimization ### Repo ldraney/landscaping-assistant ### User Story As a developer, I want the CI pipeline to pass reliably without browser-based system tests, so that PRs merge without flaky Chromium timeouts on a resource-constrained worker. ### Context System tests (Capybara + Cuprite + headless Chromium) break the CI pipeline. Chromium fails to produce a websocket URL within timeout during `reset!` calls between tests. Every pipeline since PR #54 introduced system tests has failed. The 7 system tests verify Stimulus controller wiring (CSS class toggles, DOM element visibility) — thin JS glue, not business logic. Rails 8 no longer generates system tests by default. The official guide says: "System tests should be reserved for critical user paths. For most features, integration tests provide a better balance." In a Hotwire app, the server IS the frontend — request specs verify endpoint responses, which is the app's responsibility. Whether Turbo applies those responses correctly is the framework's responsibility. ### File Targets - `Gemfile` — remove `cuprite` gem - `Gemfile.lock` — regenerate without cuprite/ferrum - `.woodpecker.yaml` — remove chromium install, CHROMIUM_PATH, FERRUM_PROCESS_TIMEOUT - `spec/system/` — delete directory (3 files, 7 examples) - `spec/support/system_test_config.rb` — delete Cuprite driver config - `docs/testing-strategy.md` — rewrite with endpoint-first philosophy ### Acceptance Criteria - 82 remaining specs pass (19 model + 63 request) - No Chromium/browser dependencies in CI - Pipeline completes without browser-related timeouts - `docs/testing-strategy.md` documents the endpoint-first philosophy with rationale and mermaid diagrams ### Test Expectations - 82 remaining specs pass (19 model + 63 request) - No Chromium/browser dependencies in CI - Pipeline completes in under 5 minutes (no browser startup overhead) ### Constraints - Keep `capybara` gem (used by request spec infrastructure) - Do not add new test dependencies - Document the philosophy change in docs/ ### Checklist - [ ] Remove cuprite gem and regenerate lockfile - [ ] Delete spec/system/ and spec/support/system_test_config.rb - [ ] Remove Chromium from CI pipeline - [ ] Rewrite testing-strategy.md with mermaid diagrams - [ ] Verify pipeline passes ### Related - PR #54: Added system test infrastructure (being reversed) - PR #59: Bumped Cuprite timeouts (insufficient) - PR #61: Added FERRUM_PROCESS_TIMEOUT env var (insufficient) - Issue #60: Bundle caching (related CI improvement)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/landscaping-assistant#63
No description provided.