[v4.7] Fix a few test environment issues - #6538
Merged
Merged
Conversation
(cherry picked from commit 58ddcfb)
…tainer Three unrelated test-environment fixes that were blocking a local run. On Rails versions where `config.action_mailer.preview_paths` returns a frozen array, appending to it with `<<` raises FrozenError, so the dummy app builds a new array and assigns it instead. `fast_sqlite` is required for its side effect: it patches SQLite3::Database#initialize to set `PRAGMA synchronous = OFF` and `journal_mode = MEMORY`, which drops fsync and keeps the rollback journal in memory. That is unsafe for real data and fine for a suite that recreates its database; locally it took 500 inserts from ~105ms to ~7ms. The gem is declared `require: false` and only when DB is sqlite, hence the `rescue LoadError` guard. Note that it is a plain monkey patch on `#initialize`, so it takes effect whenever it is loaded; the placement at the top of the file is for visibility next to the other requires, not a load-order requirement. The dev container was still building on Ruby 3.1, which is below the `>= 3.2.0` in solidus_core.gemspec, so `bundle install` could not resolve inside it. Bump it to 3.4.6 to match the version the suite is developed against. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit 2b1297f)
When a floating element (tooltips/overlays) intercepts the click, scroll the target into view and dispatch the click via JS to keep specs stable. (cherry picked from commit 2d82d99)
All twelve `activestorage` matrix jobs were failing with an opaque
`undefined method 'new' for nil`, raised where ActiveStorage resolves
`ImageProcessing.const_get(ActiveStorage.variant_processor.to_s.camelize)`.
The constant was nil because libvips was never installed.
`awalsh128/cache-apt-pkgs-action@v1` was reporting a cache hit and then
restoring nothing:
Cache hit for: cache-apt-pkgs_c6a33a4bc2050d519bb8c70e7705bd4e
Restoring 0 packages from cache...
The same key had restored 79 packages on previously green runs, so the
cache entry had gone bad. Because the action still exits successfully, a
poisoned entry is indistinguishable from a working one until the specs
fail for a seemingly unrelated reason.
Bumping the action's `version` input would mint a fresh key and restore
green, but it re-arms the same trap. Install the package directly
instead, matching what solidus_installer.yml already does, and run
`vips --version` so a bad install fails at this step rather than deep in
the suite.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 019551b)
With libvips actually installing again, every Rails 8.0 and 8.1 job
failed at load time, before a single example ran:
libvips's unfuzzed operations are not safe to use with untrusted
content, and Active Storage cannot disable them. Disabling them
requires libvips 8.13 or later and ruby-vips 2.2.1 or later.
ActiveStorage 8.1 raises this from active_storage/vips.rb while its
engine is being required, so the whole suite dies in `rake test_app`
regardless of which specs would have run. Rails 7.2 has no such check,
which is why only the 8.x rows were affected.
ubuntu-22.04 ships libvips 8.12.1, one version below the floor.
ubuntu-24.04 ships 8.15, and is already what install_dummy_app.yml and
solidus_installer.yml use.
The poisoned apt cache had been masking this: with no libvips present,
ruby-vips never loaded and the version check never ran.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit fc0ab3c)
apt pulls libvips-doc and nip2, a GUI image editor, as recommendations of libvips-dev. ruby-vips binds libvips.so through FFI at runtime rather than compiling against it, so none of that is needed and the download drops from 67.4MB to 47.0MB. libvips-tools has to be named explicitly, since it is only recommended by libvips-dev but provides the `vips` binary the verification step runs. Worth being honest about the payoff: across six jobs each, the step averaged 33.6s before and 29.0s after, but individual samples ranged from 21s to 48s. Mirror throughput dominates, so the ~5s is real but small against the noise. `apt-get update` stays. Skipping it and only refreshing on failure looked tempting, but the runner's apt index is stale often enough to 404 on a transitive dependency mid-install. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit 002f384)
6 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v4.7 #6538 +/- ##
==========================================
+ Coverage 92.03% 92.15% +0.12%
==========================================
Files 991 991
Lines 20268 20273 +5
==========================================
+ Hits 18653 18682 +29
+ Misses 1615 1591 -24 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mamhoff
approved these changes
Aug 17, 2026
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.
Backport
This will backport the following commits from
maintov4.7:Questions ?
Please refer to the Backport tool documentation