Add Postgres + MySQL CI matrix#57
Merged
Merged
Conversation
This was referenced May 6, 2026
Adds a test_db job covering rails_8.1 against postgresql and mysql2 with service containers, plus the infrastructure to make the dummy app's adapter configurable via FIXTURE_KIT_DB. - Bundler groups for pg and mysql2; appraisal lockfiles regenerated - spec/dummy/config/database.yml is ENV-driven (FIXTURE_KIT_DB and friends), defaults stay sqlite - ensure_test_databases_exist! creates the PG/MySQL databases on first run via a separate connection class so the main ActiveRecord::Base connection is established cleanly later - drop_table calls use force: :cascade to handle PG's FK dependencies - spec/dummy gets its own bundle install in CI with BUNDLE_GEMFILE unset (the parent matrix's gemfile path doesn't resolve from inside spec/dummy) - ActiveRecordCoder coverage tests the upsert_all path via a helper that omits :unique_by on MySQL/Trilogy (those adapters reject it) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
be65794 to
f0cb021
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
test_dbCI job coveringrails_8.1againstpostgresqlandmysql2, with the surrounding infrastructure to support running the suite against any of the three adapters.What's new
Gemfile/Appraisals: bundler groups forpgandmysql2. Lockfiles regenerated.spec/dummy/config/database.yml: ENV-driven viaFIXTURE_KIT_DB(and_HOST/_USERNAME/_PASSWORDfor CI). Defaults stay sqlite.spec/support/dummy_rails_helper.rb:ensure_test_databases_exist!creates the PG/MySQL databases on first run via a separateTestDatabaseBootstrapclass so the mainActiveRecord::Baseconnection is established cleanly later.drop_tablecalls useforce: :cascadefor PG FK dependencies..github/workflows/ci.yml: newtest_dbjob with PG + MySQL service containers.spec/dummygets its ownbundle installin CI withBUNDLE_GEMFILEunset.upsert_allexercise now omits:unique_byon MySQL/Trilogy (those adapters reject it).Why this PR has so much code
Adding "support PG/MySQL in CI" is a small workflow change in spirit but cascades through gem groups, lockfiles, schema bootstrap, and a few cross-adapter incompatibilities in existing specs. Splitting any of these out makes the CI add unrunnable on its own.
Stack
Stacked on #56.
Test plan
🤖 Generated with Claude Code