Commit 110f89c
authored
ci: fix release-day flakes in upgrade test and snap test (#1645)
## Summary
Right after a release commit lands on main, the dev build's
`package.json` version equals npm latest. Two CI checks were hard-coded
to assert outputs that only happen when those versions differ, so they
fail on every release-day PR run.
**CLI E2E `Test upgrade (bash/pwsh/cmd)`** (ci.yml) — asserted
`UPDATED_VERSION != INITIAL_VERSION` after `vp upgrade --force`. When
dev == latest, the upgrade runs end-to-end but the version is unchanged.
- Fix: assert on the `current` install dir basename (`local-dev-<ts>/` →
`<version>/`) instead. The dir flip proves the download/extract/swap and
rollback flows ran. Node's `fs.realpathSync` resolves both Unix symlinks
and Windows junctions, so all three shells share the same helper.
**Snap test `command-upgrade-check`**
(`packages/cli/snap-tests-global/command-upgrade-check/`) — recorded the
"Update available" output of `vp upgrade --check`. When dev == latest,
the actual output is "Already up to date".
- Fix: query the `alpha` dist-tag instead. Alpha is always a different
version from latest (currently `0.1.21-alpha.7`), so the "Update
available" branch is always taken. Semver normalization masks the actual
version, so the snap body is unchanged.
## Failure examples
- Upgrade test:
https://github.com/voidzero-dev/vite-plus/actions/runs/26112690623/job/76915605617
- Snap test:
https://github.com/voidzero-dev/vite-plus/actions/runs/26148842387/job/76910949450
(also blocks #1635)
## Test plan
- [ ] CI passes on this PR.
- [ ] After next release, both checks still pass on the post-release-day
merge-to-main run.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: changes only affect CI assertions and snapshot test inputs,
not production code. Main risk is masking a real regression if install
directory swapping semantics change.
>
> **Overview**
> Makes the CI `vp upgrade` E2E checks resilient to release-day runs by
**asserting on the `.vite-plus/current` install directory target** (via
`fs.realpathSync`) instead of comparing CLI versions, across
bash/pwsh/cmd.
>
> Stabilizes the `command-upgrade-check` snapshot by running `vp upgrade
--check` against the `alpha` dist-tag so the *"Update available"* branch
is consistently exercised.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
e4556ae. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 12368da commit 110f89c
3 files changed
Lines changed: 53 additions & 51 deletions
File tree
- .github/workflows
- packages/cli/snap-tests-global/command-upgrade-check
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | | - | |
423 | | - | |
424 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
425 | 428 | | |
426 | 429 | | |
427 | | - | |
428 | | - | |
429 | | - | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
430 | 437 | | |
431 | 438 | | |
432 | 439 | | |
| |||
438 | 445 | | |
439 | 446 | | |
440 | 447 | | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
446 | 452 | | |
447 | 453 | | |
448 | 454 | | |
449 | | - | |
| 455 | + | |
450 | 456 | | |
451 | 457 | | |
452 | 458 | | |
453 | 459 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
459 | 464 | | |
460 | 465 | | |
461 | 466 | | |
| |||
467 | 472 | | |
468 | 473 | | |
469 | 474 | | |
470 | | - | |
471 | | - | |
472 | | - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
473 | 478 | | |
474 | 479 | | |
475 | | - | |
476 | | - | |
477 | | - | |
| 480 | + | |
| 481 | + | |
478 | 482 | | |
479 | 483 | | |
480 | 484 | | |
| |||
486 | 490 | | |
487 | 491 | | |
488 | 492 | | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
494 | 497 | | |
495 | 498 | | |
496 | 499 | | |
497 | | - | |
| 500 | + | |
498 | 501 | | |
499 | 502 | | |
500 | 503 | | |
501 | 504 | | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
507 | 509 | | |
508 | 510 | | |
509 | 511 | | |
510 | 512 | | |
511 | 513 | | |
512 | 514 | | |
513 | 515 | | |
514 | | - | |
515 | | - | |
516 | | - | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
517 | 519 | | |
518 | 520 | | |
519 | 521 | | |
| |||
525 | 527 | | |
526 | 528 | | |
527 | 529 | | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
533 | 534 | | |
534 | 535 | | |
535 | 536 | | |
536 | | - | |
| 537 | + | |
537 | 538 | | |
538 | 539 | | |
539 | 540 | | |
540 | 541 | | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
0 commit comments