Skip to content

Mark the scenarios that need Ghostscript - #273

Merged
schlessera merged 1 commit into
mainfrom
tests/require-ghostscript
Nov 2, 2026
Merged

schlessera merged 1 commit into
mainfrom
tests/require-ghostscript

Conversation

@schlessera

@schlessera schlessera commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Imagick renders PDF previews through Ghostscript. These seven scenarios fail where Ghostscript isn't installed, so they now carry @require-bin-gs, which wp-cli-tests 5.4.0 already supports. Where gs is missing, the test run skips them instead of failing.

This prepares wp-cli/.github to install Ghostscript only for packages with such scenarios. The GitHub runner images no longer ship it, so every Linux Behat job in every package currently spends 15–30 s installing it. media-command is the only package whose tests need it.

How the tagged scenarios were chosen

I ran the full matrix without Ghostscript against that .github branch (run). Exactly these seven scenarios failed on every leg. Regenerating PDFs when thumbnails disabled… passes without Ghostscript, so it stays untagged. With the tags in place (run), all Linux and Windows legs pass.

Notes

  • On Windows the Ghostscript binary is gswin64c, not gs, so these scenarios are skipped there.
  • The macOS leg fails on main every night with these same seven scenarios, even though Ghostscript is installed there. This PR doesn't change that.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated PDF-related test scenarios to include Ghostscript as a required prerequisite alongside WordPress 4.7.3 and Imagick.

Imagick renders PDF previews through Ghostscript, so these seven scenarios fail
where it isn't installed. Tagging them lets the test run skip them there, and
lets the shared workflow install Ghostscript only for packages that need it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schlessera
schlessera requested a review from a team as a code owner November 2, 2026 09:27
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8c378f52-8e33-4583-9154-70485d9c9ed2
Commits

Reviewing files that changed from the base of the PR and between 132f9ee and 5e1e744.

Files selected for processing: 1
  • features/media-regenerate.feature

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Seven PDF-related scenarios in the media regeneration feature now require the Ghostscript binary, in addition to WordPress 4.7.3 and Imagick.

Changes: PDF regeneration scenario requirements

Layer / File(s) Summary
Ghostscript requirements for PDF scenarios
features/media-regenerate.feature
Seven PDF-related scenarios add a requirement for the Ghostscript binary.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Possibly related PRs

  • wp-cli/media-command#270: Updates the wp-cli-tests development dependency constraint to a version that supports the @require-bin-gs tag.

Suggested reviewers: swissspidy

Merge Risk: Minimal · up to 5e1e7

This localized change is mergeable with normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding markers to scenarios that require Ghostscript.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@schlessera
schlessera merged commit 7f0caa9 into main Nov 2, 2026
58 checks passed
@schlessera
schlessera deleted the tests/require-ghostscript branch November 2, 2026 10:07
@schlessera schlessera added this to the 3.1.2 milestone Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-pr command:media Related to 'media' command scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant