Skip to content

Remove the gs: not found workaround from Site Health tests #21

Description

@accolette

Description

The Site Health feature tests currently contain workarounds for the gs: not found error emitted by WordPress Core when Ghostscript is not installed.

For example:

# Ignore "gs: not found" error,
# triggered by https://github.com/WordPress/wordpress-develop/blob/8c374a5adb9bee9333a013a575b3aa0e828085be/src/wp-admin/includes/class-wp-debug-data.php#L746
When I try `wp site-health check --fields=check,type,status --format=csv`

Similar comments are present for wp site-health status and wp site-health list-info-sections, as well as in other Site Health scenarios.

These workarounds were introduced by @swissspidy in commit 24144a7 to accommodate the output generated by WordPress Core.

WordPress Core issue

The underlying issue has been reported in WordPress Core:

WP_Debug_Data::get_wp_media() currently runs:

exec( 'gs --version' );

When Ghostscript is not installed, the shell writes gs: not found to STDERR.

The proposed Core fix checks whether gs is available before executing it:

command -v gs >/dev/null && gs --version

This prevents the shell error from being emitted when Ghostscript is not installed.

The PR is not merged yet.

Proposed change

If the WordPress Core fix is merged, should the gs: not found workarounds in features/site-health.feature be removed?

The intention would be to remove the obsolete comments while keeping the existing test assertions unchanged.

We would not add an assertion requiring gs: not found to be absent from STDERR, since the test suite supports older WordPress versions where the original Core behavior may still be present.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    command:site-healthRelated to 'site-health' commandenhancementNew feature or requestquestionFurther information is requestedscope:testingRelated to testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions