Skip to content

CI: test rabl in freshly generated Rails 7.2, Rails 8.1 and Sinatra apps; remove fixtures/ - #811

Merged
nesquena merged 1 commit into
masterfrom
claude/ci-rails-apps
Nov 1, 2026
Merged

nesquena merged 1 commit into
masterfrom
claude/ci-rails-apps

Conversation

@nesquena

@nesquena nesquena commented Nov 1, 2026

Copy link
Copy Markdown
Owner

The checked-in fixtures/ apps (Rails 2 to 6, Rails 5 API, Sinatra and Padrino 0.10.7) and test/integration no longer install, and CI doesn't run them.

Change

  • A new apps job in .github/workflows/ci.yml for Rails 7.2 (Ruby 3.1), Rails 8.1 (Ruby 3.4) and Sinatra (Ruby 3.4). Its actions are pinned to the same SHAs as release.yml, and it runs with contents: read.

  • test/apps/build_and_test.sh generates the app (rails new --minimal, or an empty Sinatra app), copies in test/apps/shared plus the app's own files, adds rabl from the checkout with path:, and runs the app's tests.

  • Ported behaviours:

    • collections with extends, custom attribute names, child (and nested), glue, conditional child and node, object =>, partials with and without locals, app and Rails view helpers;
    • escape_all_output, Rabl.render with a view-context scope;
    • HTML views and a layout rendering rabl;
    • a custom MIME type, XML, an ActionController::API controller;
    • caching, including cache_all_output.

    Sinatra gets everything except HTML, MIME, XML and API.

  • Removed:

    • fixtures/ and test/integration/;
    • test/silence.rb;
    • the Rakefile test:clean, test:setup, test:fixtures and test:full tasks;
    • rack-test from the Gemfile.

    The gem's file list is unchanged, and rake test still runs test/*_test.rb.

  • Dropped deliberately:

    • The Rails 2–6.0 and Padrino 0.10.7 apps: unsupported versions that don't install. A generated Padrino app could follow.
    • The hard-coded md5 cache-key assertions: they were stale, and they only detected changes. A behaviour check replaces them: rows are updated, and the cached response must still be served.
    • The exact time-format assertions: times are compared to the second.

Verification

  • Locally, generated fresh from the committed tree:
    • Rails 8.1.4: 12 runs, 0 failures; also with seeds 1–3 and with frozen string literals.
    • Rails 7.2.4 on Ruby 3.1: 12 runs, 0 failures.
    • Sinatra 4.2.1: 8 runs, 0 failures.
  • The tests bite: with rabl's lib mutated (caching off, cache_all_output off, the railtie's API-rendering include removed, the source format forced to JSON, escaping removed), the matching app tests fail. Unmutated, all pass.
  • Unit suite: lib is unchanged, and it still passes 541/0.

Not verified

  • The job on GitHub Actions itself; this PR's run is the first.
  • Ruby 3.4 locally (CI uses it; I ran 3.3).

Conflicts with the ActiveSupport-floor PR in Gemfile only.


Generated by Claude Code

…in CI

The checked-in fixture apps (Rails 2 to 6, Rails 5 API, Sinatra and Padrino
0.10 under fixtures/, with their tests in test/integration) were never run
by CI and no longer install. A new "apps" job in ci.yml now generates each
app with `rails new --minimal` (or a plain Sinatra app), adds rabl from the
checkout, copies in the shared models, views and tests from test/apps, and
runs them: test/apps/build_and_test.sh does the same locally.

The tests cover what the fixture tests did on Rails 6: collections with
extends, child, glue, conditional nodes and children, partials of objects
and collections, locals, root names, app and view helpers, escape_all_output,
Rabl.render with a view scope, ERB views rendering rabl, a custom MIME type,
XML, an ActionController::API controller, template caching and
cache_all_output. Cached output is checked by behaviour (a second request
is served from the cache) instead of hard-coded digests.

The Rakefile's fixture tasks, test/silence.rb (used only by the fixtures),
the unused rack-test dependency and the fixtures' .gitignore entry go too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCpeuxhYEgymbSMcsBXyZd
@nesquena
nesquena merged commit 1097c81 into master Nov 1, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants