test(build-time-versioning): add xceadmin end-to-end build/install/version cycle check

Adds src/tools/test-xceadmin-build-install-version.sh (same house style as
tasks 6.1/6.2), which runs xceadmin's full real meson-driven build cycle
(schema sync, venv install, pytest, wheel build), installs the resulting
wheel into a fresh scratch venv, and separately does an editable install
into a second fresh scratch venv. Asserts the wheel install carries real,
non-"unknown" commit id and build time while the editable install carries
the committed "unknown"/"unknown" fallback stub, and explicitly asserts
the two differ -- proving the generated build-info module genuinely
replaces the fallback rather than both installs coincidentally agreeing.

Verified independently by review with a full from-scratch re-run: 261
passed/3 skipped (matching tasks 5.1/5.2's established baseline), both
install paths correct, and the demonstration block's crux case (identical
build-info values must be rejected by the differ-check) confirmed correct.

This is the final task of the build-time-versioning spec; all 13 sub-tasks
are now complete.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-08-20 17:02:01 +00:00
parent 79941a9f42
commit 084a5a95c3
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
2 changed files with 415 additions and 4 deletions

View file

@ -106,7 +106,7 @@
- _Boundary: xceadmin/src/xceadmin_
- _Depends: 5.1_
- [ ] 6. Integration: cross-toolchain consistency and regression verification
- [x] 6. Integration: cross-toolchain consistency and regression verification
- [x] 6.1 Motivating-incident regression test
- New standalone script `src/tools/test-build-version-regression.sh` (follows the existing `test-commit-durability.sh`/`test-heartbeat-tolerance.sh` convention: real-build regression check, not a meson `test()`) runs real `xce-build.sh scheduler` builds in fresh dirs for both `asan` and `debug`, extracts the commit id from `xce_scheduler --version`, and compares it against a live `git rev-parse --short HEAD` (+`-dirty`, using the identical dirty-detection logic as `xce-build.sh` itself)
- Deliberately tolerates only `xce-build.sh`'s own known-unrelated flaky-test exit code (bug-1560) via captured exit status, not a blanket `set -e` bypass -- a real compile failure still fails the check, since fresh build dirs mean no stale binary can survive to fool the binary-existence + `--version` gate
@ -121,9 +121,10 @@
- _Requirements: 2.2_
- _Depends: 3.2, 4.4_
- [ ] 6.3 xceadmin end-to-end build/install/version cycle
- Run xceadmin's full meson-driven build (schema sync, venv install, pytest, wheel build), install the resulting wheel, and confirm `xceadmin --version` reports the generated (non-`unknown`) build-info fields
- Observable: the installed wheel's `--version` output differs from an editable (`pip install -e .`) install's `unknown`-only output, proving the generated module actually replaces the fallback
- [x] 6.3 xceadmin end-to-end build/install/version cycle
- New standalone script `src/tools/test-xceadmin-build-install-version.sh` (same house style as tasks 6.1/6.2) runs the full real `xce-build.sh xceadmin` cycle (schema sync, venv install, pytest, wheel build), installs the resulting wheel into a fresh scratch venv, and separately does an editable install (`pip install -e src/xceadmin`) into a second fresh scratch venv
- Explicit differ-assertion (not just two independent pass/fail checks) that the wheel install's and editable install's build-info fields are NOT equal -- proving the generated module genuinely replaces the fallback rather than both installs coincidentally agreeing
- Observable confirmed live (independently re-run in full by both implementer and review, real build+two installs each time): wheel install shows real, non-`unknown` commit id + build time; editable install shows the committed `unknown`/`unknown` fallback; a demonstration block proves the check rejects a wheel install showing `unknown`, an editable install showing a real-looking hash, and -- the crux case -- two identical build-info outputs fed to the differ-check
- _Requirements: 1.1, 1.2, 2.1, 4.1, 4.2_
- _Depends: 5.1, 5.2_