Skip to content

Add Rails version matrix to CI#351

Open
OdenTakashi wants to merge 1 commit into
mainfrom
test/rails-version-matrix
Open

Add Rails version matrix to CI#351
OdenTakashi wants to merge 1 commit into
mainfrom
test/rails-version-matrix

Conversation

@OdenTakashi

@OdenTakashi OdenTakashi commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Extend integration CI to run against Rails 7.2, 8.0, and 8.1 across all database adapters.
Add Rails 8–specific expected-output templates only where schema annotation formatting differs (mainly datetime defaults), while keeping existing templates as the default fallback.

Problem

Integration tests were pinned to a single Rails version (~> 7.1.0), so regressions on newer Rails releases could go unnoticed. When running against Rails 8, some integration specs failed because Rails 8 changed how datetime default values appear in schema annotations (e.g. nanosecond precision and UTC suffix). Updating every template globally would add noise and break expectations for older Rails
versions.

Solution

• Add a rails dimension to the integration CI matrix and pass RAILS_VERSION through dummyapp setup and test execution.
• Make the dummyapp Gemfile respect RAILS_VERSION, and allow sqlite3 2.x when testing Rails 8.
• Teach SpecHelper::Aruba#model_template to prefer spec/templates/rails8// when running on Rails 8 and an override exists; otherwise fall back to the existing spec/templates//templates.
• Add Rails 8 overrides only for the specs that compare datetime output (12 files total), avoiding unnecessary duplication of the full template set.

Note

The spec/templates/rails8/ overrides exist solely because Rails 8 changed how datetime default values are rendered in schema comments. This comes from rails/rails#52371(rails/rails#52371), which updated TimeWithZone#inspect to use ISO 8601-style formatting (e.g. 2023-07-04 12:34:56...) instead of the RFC 822-style format used on Rails 7.2 and earlier (e.g. Tue, 04 Jul 2023 12:34:56...).

As long as we keep Rails 7.2 in the CI matrix, we need separate golden files for the specs that assert datetime defaults. If we drop Rails 7.2 support later, every tested Rails version would share the same output format, and we could remove the rails8/ directory and the version-specific template lookup in model_template — the matrix CI would still work with a single set of templates.

@OdenTakashi OdenTakashi force-pushed the test/rails-version-matrix branch 2 times, most recently from fbd18c6 to 1dfcd83 Compare June 26, 2026 05:19
@OdenTakashi OdenTakashi marked this pull request as ready for review June 26, 2026 05:25
@OdenTakashi OdenTakashi force-pushed the test/rails-version-matrix branch 2 times, most recently from aeb8eb4 to 30bb4dd Compare June 26, 2026 05:47
  for Rails 8

Run integration tests across Rails 7.1, 7.2, 8.0, and 8.1. Allow sqlite3 2.x in dummyapp for Rails 8, and keep Rails 8-specific datetime overrides in separate spec templates
@OdenTakashi OdenTakashi force-pushed the test/rails-version-matrix branch from 30bb4dd to 3214f02 Compare June 26, 2026 05:58
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.

1 participant