#57893·rails

CI templates inconsistent between config/ci.rb.tt and github/ci.yml.tt for system tests

Author: usutaniCreated Jun 27, 2026Updated Sep 25, 2026
Labelsstale

Steps to reproduce

The following reproduces on Rails 8.1.3 (where --skip-system-test is not yet the default). On Rails main (--skip-system-test is the default since PR #56272), the default case omits the system-test job entirely — but config/ci.rb remains commented out either way.

Case 1: default (rails new)

bash
rails new myapp_default
cd myapp_default

# config/ci.rb — commented out
grep "test:system" config/ci.rb
# => # step "Tests: System", "bin/rails test:system"

# .github/workflows/ci.yml — active job (inconsistent)
grep "test:system" .github/workflows/ci.yml
# => run: bin/rails db:test:prepare test:system

Case 2: with system tests enabled

bash
rails new myapp --no-skip-system-test
cd myapp

# config/ci.rb — still commented out despite explicit opt-in
grep "Tests: System" config/ci.rb
# => # step "Tests: System", "bin/rails test:system"

# .github/workflows/ci.yml — full active job
grep "test:system" .github/workflows/ci.yml
# => run: bin/rails db:test:prepare test:system

Expected behavior

Both CI templates should handle system tests consistently:

Scenario config/ci.rb.tt github/ci.yml.tt
Default (rails new) Commented out Commented out
--no-skip-system-test Uncommented Uncommented
--api Omitted Omitted

Actual behavior

The two templates use different strategies, creating inconsistency:

Scenario config/ci.rb.tt github/ci.yml.tt
Default (before #56272) Commented out Uncommented
Default (after #56272) Commented out Omitted
--no-skip-system-test Commented out Uncommented
--api Commented out Omitted

The inconsistency is in the template code itself, not just the generated output.

Root cause

  • config/ci.rb.tt always comments out the system test step with an "Optional" note, regardless of flags.
  • github/ci.yml.tt uses unless options[:api] || options[:skip_system_test], making its behavior depend on whether --skip-system-test is default or explicitly passed. When --no-skip-system-test is passed, it produces a full active job — but config/ci.rb.tt still has it commented out.

The two templates were never updated together when --skip-system-test became the default (PR #56272).

Proposed fix

  1. github/ci.yml.tt: Replace the flat guard with a nested structure:

    • Outer: unless options[:api] (skip entirely for API apps)
    • Inner: if options[:skip_system_test] == false → active job; else → commented-out version with instructions on how to enable
  2. config/ci.rb.tt: Add the same conditional logic. --api omits the step entirely (not just commented out); --no-skip-system-test produces an active step; default or --skip-system-test keeps it commented out as optional.

  3. railties/test/generators/app_generator_test.rb: Update existing tests and add coverage for all three scenarios (default, --no-skip-system-test, --api).

Related

  • #56853 — User reports failing CI on rails new (no test/system directory exists)
  • #56856 — Previous attempt to fix ci.yml.tt only (checks failed; missing --api handling and ci.rb changes)
  • #56539 — bin/ci fails due to unguarded system test step (fixed in #56541)
  • #56272 — Made --skip-system-test the default
  • #55743 — Don't generate system tests by default

System configuration

Rails version: main (8.2.0.alpha)

Ruby version: N/A