Skip to content

Tests: Allow the checksum warning when replacing a development build - #360

Open
swissspidy wants to merge 1 commit into
mainfrom
claude/wordpress-core-testing-automation-yrlybg
Open

swissspidy wants to merge 1 commit into
mainfrom
claude/wordpress-core-testing-automation-yrlybg

Conversation

@swissspidy

@swissspidy swissspidy commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Running this suite against a WordPress core build (WP_CLI_TEST_CORE_ZIP, see Core Trac #64103) fails 24 scenarios with the same error:

$ wp core download --version=5.4 --force
...
Success: WordPress downloaded.

Warning: Could not retrieve WordPress core checksums; skipping checksum-based cleanup. Files listed in $_old_files were still cleaned up.

The command unexpectedly produced STDERR output.

These scenarios start from Given a WP install and then replace it with an older release, or update it in place. The cleanup compares checksums of the old and new versions. A development build such as 7.2-alpha-63166 has no published checksums, so core-command warns and When I run fails on STDERR. The command still exits 0 and does the cleanup.

The 25 affected steps now use When I try followed by Then the return code should be 0, the same approach as the existing "May produce warnings if checksums cannot be retrieved" steps in core-update.feature. All STDOUT assertions are unchanged. Against a stable release nothing changes: there is no warning.

This is a test-only change; core-command's behaviour is unchanged. Version-pinning the setup instead (Given a WP 6.9 install) was ruled out because it ties the scenarios to a release's PHP requirements and doesn't work for Given a WP multisite install.

I checked that all edited feature files parse with Behat's Gherkin parser; I couldn't run the suite locally.


Generated by Claude Code

Summary by CodeRabbit

  • Tests
    • Updated WordPress core download, version, and update scenarios to account for possible checksum warnings, including when replacing development builds.
    • These checks now distinguish warnings from command failures by verifying successful completion, while retaining existing checks for output, files, cache behavior, and updates.

Many scenarios start from `Given a WP install` and then replace it with an
older release, or update it in place. Core-command then cleans up files by
comparing checksums of the old and new versions. When the installed version
is a development build (for example when testing against a WordPress core
build), there are no published checksums for it, so the command prints a
warning and `When I run` fails on STDERR.

These steps now use `When I try` and check the return code instead,
following the existing "May produce warnings if checksums cannot be
retrieved" steps in core-update.feature. Their STDOUT assertions are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CE81GsxUY597AdaMP1NXzk
@swissspidy
swissspidy requested a review from a team as a code owner November 27, 2026 17:12
Copilot AI balanced review requested due to automatic review settings November 27, 2026 17:12
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Feature scenarios now use try for WordPress downloads or updates that may produce checksum warnings. The changed scenarios assert a return code of 0, with existing output and other assertions retained where noted.

Changes: Core command feature scenarios

Layer / File(s) Summary
Check and version download scenarios
features/core-check-update-db.feature, features/core-check-update.feature, features/core-version.feature
The scenarios use try for downloads and assert a return code of 0. The core-check scenario also retains its nonempty-stdout assertion.
Database-update scenarios
features/core-update-db.feature
Single-site, multisite, dry-run, and multinetwork scenarios use try for WordPress downloads and assert a return code of 0.
Core-update scenarios
features/core-update.feature
Scenarios use try for downloads or updates and add return-code checks. Existing output, file, cache, and update assertions are retained where noted.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested labels: scope:testing

Suggested reviewers: schlessera, danielbachhuber, ernilambar

Merge Risk: Minimal · up to 41ec8

This is a test-only change that tolerates the checksum warning on development builds while still requiring commands to exit successfully. It has no production impact, and merge risk is minimal.

Architecture risk: Low · up to 41ec8

The change affects 1 source area.

Changed areas: features

Review details

Systems and components

  • observed — 5 changed files mapped to features.

Before / after behavior

  • observed — Modified behavior in features/core-check-update-db.feature: The WordPress 5.4 download step changes from run to try, adds a comment about possible checksum-retrieval warnings, and asserts a return code of 0.
  • observed — Modified behavior in features/core-check-update-db.feature: The WordPress 6.6 download step changes from run to try, adds a comment about possible checksum-retrieval warnings, and asserts a return code of 0.
  • observed — Modified behavior in features/core-check-update.feature: The scenario replaces run with try for the WordPress 5.8 download, adds a comment noting a possible checksum warning, and asserts return code 0 as well as nonempty stdout.
  • observed — Modified behavior in features/core-update-db.feature: The single-site update scenario now runs the WordPress download command with And I try and requires return code 0, replacing the unchecked And I run step. A comment notes that checksum retrieval may warn for the replaced version.
Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: tests now accept the checksum warning that appears when a development build is replaced. The raw summary shows the feature files switching to try with a return-code …
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: Title check

Explanation

The title names the main change: tests now accept the checksum warning that appears when a development build is replaced. The raw summary shows the feature files switching to try with a return-code 0 assertion and comments about checksum warnings for development builds, which matches the title. The title is specific and concise, and it fits the PR objectives, which describe the same test-only change.

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
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: cf787937-c551-4ca7-bb3e-f53f0cf2c219
Commits

Reviewing files that changed from the base of the PR and between 9a5eaf6 and 41ec81c.

Files selected for processing: 5

  • features/core-check-update-db.feature
  • features/core-check-update.feature
  • features/core-update-db.feature
  • features/core-update.feature
  • features/core-version.feature

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@codecov

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

Labels

automated-pr command:core-download Related to 'core download' command command:core-update Related to 'core update' command scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants