Skip to content

[v4.7] Fix a few test environment issues - #6538

Merged
mamhoff merged 6 commits into
v4.7from
backport/v4.7/pr-6532
Aug 17, 2026
Merged

[v4.7] Fix a few test environment issues#6538
mamhoff merged 6 commits into
v4.7from
backport/v4.7/pr-6532

Conversation

@solidus-bot

@solidus-bot solidus-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

Backport

This will backport the following commits from main to v4.7:

Questions ?

Please refer to the Backport tool documentation

elia and others added 6 commits August 17, 2026 06:40
…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)
@solidus-bot
solidus-bot Bot requested a review from a team as a code owner August 17, 2026 06:40
@solidus-bot solidus-bot Bot added changelog:solidus_core Changes to the solidus_core gem changelog:solidus_admin labels Aug 17, 2026
@solidus-bot solidus-bot Bot mentioned this pull request Aug 17, 2026
6 tasks
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.15%. Comparing base (e5e879b) to head (8d5d073).
⚠️ Report is 1 commits behind head on v4.7.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mamhoff
mamhoff merged commit d66f33f into v4.7 Aug 17, 2026
41 checks passed
@mamhoff
mamhoff deleted the backport/v4.7/pr-6532 branch August 17, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants