From a64d0846c70012c0fb5d82671fbfa945207a7e76 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Fri, 9 Oct 2026 06:41:09 +0000 Subject: [PATCH] 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) --- src/xceadmin/meson-build.sh | 12 ++++++++++++ src/xceadmin/meson.build | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/src/xceadmin/meson-build.sh b/src/xceadmin/meson-build.sh index 999b6371..2f423d73 100755 --- a/src/xceadmin/meson-build.sh +++ b/src/xceadmin/meson-build.sh @@ -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 diff --git a/src/xceadmin/meson.build b/src/xceadmin/meson.build index 0ec3e1bd..906e7c4d 100644 --- a/src/xceadmin/meson.build +++ b/src/xceadmin/meson.build @@ -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,