Skip to content

Stop skipping ImageMagick tests in CI - #92

Merged
flavorjones merged 1 commit into
masterfrom
card-578-identify-fallback
Oct 1, 2026
Merged

flavorjones merged 1 commit into
masterfrom
card-578-identify-fallback

Conversation

@flavorjones

Copy link
Copy Markdown
Member

Motivation

The activestorage CI job installs Ubuntu's imagemagick package (ci.yml#L116), which is ImageMagick 6 and has no magick command. The test helpers shell out to magick identify to read back the images a cell writes, and skip when it prints nothing (test_helper.rb#L54-L55). So CI skipped 24 tests in the server suite and 9 in the client, all of which run on ImageMagick 7.

test_the_policy_does_refuse_a_magick_that_reads_it also passed vacuously in CI: system returned nil for the missing magick, and refute nil passes.

Details

Each test class's IDENTIFY is magick identify when magick -version succeeds and identify otherwise. The identify and brightness helpers, magick_installed?, magick_thread_resource and the policy premise test all use it.

Copilot AI balanced review requested due to automatic review settings October 1, 2026 20:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The policy premise test can still pass vacuously when neither ImageMagick command is installed.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds ImageMagick 6 compatibility so Active Storage image tests run in Ubuntu CI instead of skipping.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Changes:

  • Selects magick identify or standalone identify based on availability.
  • Applies the selected command to image inspection and policy tests.
File Description
activestorage-hotcell-server/​test/​test_helper.rb Adds compatible image identification.
activestorage-hotcell-server/​test/​previewers_test.rb Uses compatible identification for brightness checks.
activestorage-hotcell-server/​test/​magick_environment_test.rb Updates environment and resource tests.
activestorage-hotcell-client/​test/​test_helper.rb Adds compatible client-suite image identification.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread activestorage-hotcell-server/test/magick_environment_test.rb
CI's `activestorage` job installs Ubuntu's `imagemagick` package, which
is ImageMagick 6 and has no `magick` command. Every activestorage test
that shelled out to `magick` skipped there: 24 in the server suite and 9
in the client.

Call `identify` when `magick` is missing.
@flavorjones
flavorjones force-pushed the card-578-identify-fallback branch from d75c289 to d3df7ac Compare October 1, 2026 21:01
@flavorjones
flavorjones merged commit f161894 into master Oct 1, 2026
16 checks passed
@flavorjones
flavorjones deleted the card-578-identify-fallback branch October 1, 2026 21:33
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.

2 participants