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,