Repository navigation
Add a test harness and CI (Ruby 3.3-4.0 / Rails 8.0-8.1 / ActiveAdmin 3.2-3.5) - #6
Merged
Merged
Conversation
Fivell
force-pushed
the
feat/test-harness-and-ci
branch
from
October 1, 2026 11:25
a482e30 to
41f28fe
Compare
Fivell
force-pushed
the
feat/test-harness-and-ci
branch
from
October 1, 2026 11:32
41f28fe to
5b0087d
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.
This gem had no tests and no CI. This adds both, mirroring the harness already
in use in the sibling repo
activeadmin-plugins/active_admin_sidebar(sameshape of gem: an ActiveAdmin asset plugin).
The harness
The specs run against a generated Rails dummy app, never a committed one
(
spec/rails/rails-*is gitignored).Gemfile—gemspecplusrails/activeadminselected viaENV['RAILS']and
ENV['AA'](defaults 8.1.0 / 3.5.0), and a:testgroup with simplecov,rspec-rails, sqlite3, database_cleaner, capybara, cuprite and webrick.
Rakefile+tasks/test.rake—rake setuprunsrails new spec/rails/rails-#{Rails::VERSION::STRING} -m spec/support/rails_template.rb.spec/support/rails_template.rb— generatesAuthor/Postmodels withransackable_attributes, installs ActiveAdmin + Formtastic, and wires thisplugin into the dummy app's
app/assets/javascripts/active_admin.js:Without that invocation the jQuery plugin never runs and no spec could see
the UI. There is no SCSS to wire up — the plugin injects its own
<style>.spec/spec_helper.rb— boots the generated app and auto-runsrake setupwhen it is missing.
spec/support/capybara.rb— cuprite/headless Chrome driver, carried oververbatim including the comments documenting the real
Ferrum::ProcessTimeoutErrorflakes on GitHub runners.
spec/support/admin.rb— registers theAuthorresource per example.Three Rails 8.1 fixes the sibling repo did not need
stale_when_importmap_changesintoApplicationController, butimportmap-railsis not in this bundle (assetsare served through Sprockets), so loading the controller raises
NameError.The template strips the line.
generateshells out to
rails generate, which boots the app, and the generatedconfig/environments/test.rbcontainsconfig.eager_load = ENV["CI"].present?— so on a GitHub runner thecontroller is eager-loaded during generation and the template dies on its
very first model, before any
gsub_fileruns. LocallyCIis unset, thecontroller stays lazily autoloaded, and the ordering bug is invisible. This
is reproducible locally with
CI=true, which is how it was verified here.before_loadhooks — theones that mix
BatchActions/FiltersintoActiveAdmin::Resource— had notrun by the time a spec called
ActiveAdmin.register. Resources came out with@batch_actionsnil and the index page died inwrap_with_batch_action_form.spec_helper.rbnow forcesActiveAdmin.application.load!before any example registers a resource.Specs added —
spec/filters_visibility_spec.rb(5 examples,js: true)h3and the (initially hidden).filters-visibility-panelinside.panel_contents, titledVisibility:all checked, every
.filter_form_fieldvisible, button notactiveactiveto thebutton, leaving the other filters alone
comes back unchecked
activeclassNothing from the requested list had to be dropped. Drag-reordering and
isFilterFilledare not covered — the dummy app invokes the plugin withorderingat its defaultfalse, and HTML5 drag-and-drop is not usefullydrivable through CDP.
CI matrix
3.3,3.4,4.08.0.0,8.1.03.2.0,3.3.0,3.4.0,3.5.024 legs,
fail-fast: false, noexclude:rules.EOL dates (https://endoflife.date/ruby, https://endoflife.date/rails) justifying
the floor:
floor (security-only until 2027-03-31); 3.4 eol 2028-03-31, 4.0 eol 2029-03-31.
matrix. Rails 8.0 eol 2026-11-07, 8.1 eol 2027-10-10. Rails 8.2 is not
released (main is
8.2.0.alpha), so it is not added.passes the suite on both, so all four legs are kept and no exclusions are
needed. Verified by real
bundle install+rspecruns, not by readingdependency strings.
The coverage-badge and gh-pages deploy jobs from the sibling workflow are
not carried over: this repo has no
gh-pagesbranch, so the deploy jobwould be dead and the badge artifact it feeds would have nowhere to go.
gemspec
s.required_ruby_version = '>= 3.3's.add_dependency 'activeadmin', '>= 3.2', '< 4.0'(was unconstrained) —3.2 is the oldest version actually exercised, 4.0 is not released.
Verification
Real runs on this machine (rbenv 3.4.10 / 4.0.6, Chrome headless via cuprite),
plus the 24-leg CI run on this PR.
Resolution check across the whole Rails x ActiveAdmin product, Ruby 3.4.10:
Full suite on Ruby 3.4.10, freshly generated dummy app for every leg:
The required leg, start to finish:
Order independence confirmed with
--order rand:1and--order rand:42(5 examples, 0 failures each) — localStorage does not leak between examples.
Eager-loading path, i.e. the runner's configuration, reproduced locally:
Top leg of the matrix, install only, as required:
Ruby 4.0.6 also runs the suite green (
5 examples, 0 failureson Rails 8.1.0),beyond the install-only requirement.