build(xceadmin): run the live E2E tests against this build's xce_controller

The three live E2E tests (test_e2e_live_push, test_e2e_live_ha_push x2)
skipped with 'no xce_controller binary found': they run from the build
dir's repo mirror, where controller discovery only finds a sibling
xce.build/build.release/build.dbg controller dir that happens to exist
when pytest starts, and nothing ordered the controller link before the
xceadmin target. The xceadmin custom_target now depends on the
controller and passes its path, which meson-build.sh exports as
XCE_CONTROLLER_BIN (a caller's value wins; left unset in the Nix
package sandbox so nix build keeps skipping them). xceadmin: 373 passed,
none skipped.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-09 06:41:09 +00:00
parent 7d3c305bd6
commit a64d0846c7
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
2 changed files with 18 additions and 0 deletions

View file

@ -26,6 +26,8 @@ GIT_COMMIT="$6" # build-time-versioning task 5.1: get_option('commit_id'),
# resolved by xce-build.sh (task 2.1) -- empty if meson was
# invoked without -Dcommit_id= (e.g. a bare `meson setup`)
BUILD_TIME="$7" # build-time-versioning task 5.1: get_option('build_time'), same as above
CONTROLLER_BIN="${9:-}" # the xce_controller this build links (meson.build
# `depends: [controller]`), for the live E2E tests
DIRTY_FINGERPRINT="$8" # dirty-content-fingerprint task 5.1: get_option('dirty_fingerprint'),
# resolved by xce-build.sh (task 2.1) / flake.nix (task 2.2) -- empty if
# meson was invoked without -Ddirty_fingerprint= or the tree is clean
@ -156,6 +158,16 @@ echo "=== xceadmin (meson): running tests ==="
# (resolve_binary_candidates in _live_e2e_common.py) override discovery
# entirely, and this build's own freshly pip-installed binary is exactly
# what the live E2E tests should exercise.
# XCE_CONTROLLER_BIN gets the controller this same build linked (passed in
# by meson.build, which also depends on it), so the live E2E tests find it
# under any build dir name; a value already set by the caller wins. Inside
# the Nix package-build sandbox (HOME=/homeless-shelter) it is left unset,
# as before, so those tests keep skipping there instead of deploying a
# controller cluster during `nix build`.
if [ -z "${XCE_CONTROLLER_BIN:-}" ] && [ -n "$CONTROLLER_BIN" ] \
&& [ "${HOME:-}" != "/homeless-shelter" ]; then
export XCE_CONTROLLER_BIN="$CONTROLLER_BIN"
fi
XCEADMIN_BIN="$VENV_DIR/bin/xceadmin" "$VENV_DIR/bin/python" -m pytest "$WORK_DIR/tests" -v
# Build an installable wheel from the SAME schema-synced $WORK_DIR the pinned

View file

@ -58,7 +58,13 @@ xceadmin_stamp = custom_target('xceadmin',
# dirty_fingerprint), not the original feature's commit_id/build_time
# convention.
get_option('dirty_fingerprint'),
# The live E2E tests (tests/test_e2e_live_*.py) deploy and drive a real
# xce_controller. Passing its path, and depending on the target, makes
# sure the binary exists before pytest runs -- under a parallel build or
# a lone `meson compile xceadmin` -- whatever the build dir is named.
controller.full_path(),
],
depends: [controller],
build_by_default: true,
build_always_stale: true,
console: true,