Repository navigation
Commit b890ae0
committed
Tests: mock the Version Check API where a minor update must be on offer
Three scenarios install WordPress, downgrade core to an older release and
then expect wordpress.org to offer an in-branch (minor) update for it:
* core-check-update.feature "Check for update via Version Check API"
* core-update.feature "Update to the latest minor release"
* core-update.feature "Update WordPress locale when using --minor"
Whether that offer is returned at all is decided per site: the Version
Check API buckets sites by the URL sent in the `wp_install` request header
and only serves the in-branch `autoupdate` offers to some of them. Every
test site is installed at the same URL, so all jobs share one bucket, and
the bucketing is reshuffled with every WordPress release. After the
WordPress 7.1 release that bucket stopped receiving the offers, leaving
`wp core check-update` with only the major update to report and
`wp core update --minor` with nothing to update to, and all Behat jobs
failed on exactly these three scenarios.
Mock the version-check response in those scenarios so they no longer
depend on which bucket the test site lands in. The offered packages are
real, so the updates are still performed against real archives, and the
expected versions are now fixed instead of tracking whatever wordpress.org
currently considers the latest release of a branch.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011sevK5u2P9Egf2Vae5QRu61 parent 52041f6 commit b890ae0
2 files changed
Lines changed: 47 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
8 | 17 | | |
9 | 18 | | |
10 | 19 | | |
11 | 20 | | |
12 | 21 | | |
13 | | - | |
14 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
15 | 28 | | |
16 | 29 | | |
17 | 30 | | |
| |||
20 | 33 | | |
21 | 34 | | |
22 | 35 | | |
23 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
24 | 41 | | |
25 | 42 | | |
26 | 43 | | |
| |||
29 | 46 | | |
30 | 47 | | |
31 | 48 | | |
32 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
33 | 54 | | |
34 | 55 | | |
35 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
103 | 113 | | |
104 | 114 | | |
105 | 115 | | |
| |||
111 | 121 | | |
112 | 122 | | |
113 | 123 | | |
114 | | - | |
| 124 | + | |
115 | 125 | | |
116 | 126 | | |
117 | 127 | | |
| |||
128 | 138 | | |
129 | 139 | | |
130 | 140 | | |
131 | | - | |
| 141 | + | |
132 | 142 | | |
133 | 143 | | |
134 | 144 | | |
| |||
547 | 557 | | |
548 | 558 | | |
549 | 559 | | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
550 | 570 | | |
551 | 571 | | |
552 | 572 | | |
| |||
0 commit comments