Skip to content

t840: make wu_duplicate_site action test fail on WP_Error#847

Merged
superdav42 merged 1 commit intomainfrom
feature/auto-20260414-092807
Apr 14, 2026
Merged

t840: make wu_duplicate_site action test fail on WP_Error#847
superdav42 merged 1 commit intomainfrom
feature/auto-20260414-092807

Conversation

@superdav42
Copy link
Copy Markdown
Collaborator

Summary

Tightens the assertion path in test_wu_duplicate_site_action_includes_from_site_id so the test fails immediately when Site_Duplicator::duplicate_site() returns a WP_Error, rather than silently skipping all assertions and producing a false positive.

Before: if duplication failed, the if ( ! is_wp_error($result)) block was skipped entirely — the test passed with zero assertions.

After: if duplication fails, $this->fail() is called with the error message, making the failure visible and ensuring the remaining assertions always run on success.

Changes

  • tests/WP_Ultimo/Helpers/Site_Duplicator_Test.php: Replace silent-skip pattern with fail-fast $this->fail() check; unconditionally run payload assertions.

Runtime Testing

Risk level: Low — test file only, no production code changed.
Verification: self-assessed — the logic change is structurally equivalent; the only behaviour difference is that a previously-hidden failure path now surfaces.

Resolves #840


aidevops.sh v3.8.24 plugin for OpenCode v1.4.3 with claude-sonnet-4-6 spent 2m and 5,190 tokens on this as a headless worker.

@superdav42
Copy link
Copy Markdown
Collaborator Author

Merge Summary

Issue: #840 — quality-debt: tests/WP_Ultimo/Helpers/Site_Duplicator_Test.php — PR #825 review feedback (medium)

Change: Tightened assertion path in test_wu_duplicate_site_action_includes_from_site_id. Replaced silent-skip pattern (if ( ! is_wp_error($result))) with fail-fast approach: the test now calls $this->fail() with the error message when site duplication returns WP_Error, ensuring assertion coverage is never silently skipped.

File changed: tests/WP_Ultimo/Helpers/Site_Duplicator_Test.php (line 606–616)

Testing: Low-risk test-only change. Self-assessed. No production code modified.


aidevops.sh v3.8.24 plugin for OpenCode v1.4.3 with claude-sonnet-4-6 spent 2m on this as a headless worker. Overall, 10s since this issue was created.

@github-actions
Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 14, 2026

Warning

Rate limit exceeded

@superdav42 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 33 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 53 minutes and 33 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 568a50cc-ccef-4079-ab65-2be2edb90d7e

📥 Commits

Reviewing files that changed from the base of the PR and between 1e6d704 and d52a2bc.

📒 Files selected for processing (1)
  • tests/WP_Ultimo/Helpers/Site_Duplicator_Test.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/auto-20260414-092807

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

Comment @coderabbitai help to get the list of available commands and usage tips.

…ilently skipping assertions

Previously, if Site_Duplicator::duplicate_site() returned WP_Error, the test
would silently pass with zero assertions, creating a false positive. Now the
test calls $this->fail() with the error message, making failures visible.

Resolves #840
@superdav42 superdav42 force-pushed the feature/auto-20260414-092807 branch from 84e51c4 to d52a2bc Compare April 14, 2026 15:36
@superdav42 superdav42 merged commit 002b9f9 into main Apr 14, 2026
5 of 7 checks passed
@superdav42
Copy link
Copy Markdown
Collaborator Author

Merge Summary

Issue: #840 — quality-debt: tests/WP_Ultimo/Helpers/Site_Duplicator_Test.php — PR #825 review feedback (medium)

Change: Tightened assertion path in test_wu_duplicate_site_action_includes_from_site_id. Replaced silent-skip pattern (if ( ! is_wp_error($result))) with fail-fast approach: the test now calls $this->fail() with the error message when site duplication returns WP_Error, ensuring assertion coverage is never silently skipped.

File changed: tests/WP_Ultimo/Helpers/Site_Duplicator_Test.php (line 606–616)

Testing: Low-risk test-only change. Self-assessed. No production code modified.


aidevops.sh v3.8.24 plugin for OpenCode v1.4.3 with claude-sonnet-4-6 spent 2m on this as a headless worker. Overall, 10s since this issue was created.


Merged via PR #847 to main.
Merged by deterministic merge pass (pulse-wrapper.sh).

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 14, 2026

Performance Test Results

Performance test results for c274d8c are in 🛎️!

Note: the numbers in parentheses show the difference to the previous (baseline) test run. Differences below 2% or 0.5 in absolute values are not shown.

URL: /

Run DB Queries Memory Before Template Template WP Total LCP TTFB LCP - TTFB
0 40 (-1 / -3% ) 37.78 MB 866.50 ms (+48.50 ms / +6% ) 155.00 ms (-34.00 ms / -22% ) 1059.00 ms 1996.00 ms 1898.30 ms 87.50 ms (-3.40 ms / -4% )
1 56 49.02 MB 924.50 ms 144.00 ms (-5.00 ms / -3% ) 1067.00 ms 2044.00 ms 1963.05 ms 81.55 ms

@github-actions
Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quality-debt: tests/WP_Ultimo/Helpers/Site_Duplicator_Test.php — PR #825 review feedback (medium)

1 participant