From 9a4f1aa942b1d0a33d5753781a0113776560e115 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Mon, 14 Sep 2026 06:45:11 +0000 Subject: [PATCH] feat(xce-harness-component): add /xce-build harness, decouple from controller Add a harness) case to src/tools/xce-build.sh following the same three-part template (setup_build / meson compile / conditional meson test) already used by scheduler)/worker), building all 6 harness targets (xce_test plus its 5 test binaries) and running suite harness. Remove controller/xce_test from the controller) case's compile target list -- it no longer exists as a controller target. Add harness to the script's usage/component-list text. Verified both directions: `/xce-build harness` alone produces xce_test and all 5 test binaries (4/20/5/12/132 tests, 0 failures); `/xce-build controller` alone no longer produces controller/xce_test while controller_unit_test stays green at 1199 tests. Task 3.1 of xce-harness-component. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC --- .kiro/specs/xce-harness-component/design.md | 2 +- .kiro/specs/xce-harness-component/tasks.md | 2 +- src/tools/xce-build.sh | 13 +++++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.kiro/specs/xce-harness-component/design.md b/.kiro/specs/xce-harness-component/design.md index 4aae4a2b..0cb147d6 100644 --- a/.kiro/specs/xce-harness-component/design.md +++ b/.kiro/specs/xce-harness-component/design.md @@ -276,7 +276,7 @@ sequenceDiagram **Responsibilities & Constraints** - `controller)` case (`xce-build.sh:292-299`) drops `controller/xce_test` from its compile target list. -- New `harness)` case follows the identical three-part template already used by `scheduler)`/`worker)`: `setup_build`, an explicit `meson compile` target list (`harness/xce_test harness/harness_unit_test`), then a conditional `meson test --suite harness`. +- New `harness)` case follows the identical three-part template already used by `scheduler)`/`worker)`: `setup_build`, an explicit `meson compile` target list (all 6 harness targets: `xce_test`, `harness_unit_test`, and the four standalone test binaries), then a conditional `meson test --suite harness`. - `all)` requires no code change — it already compiles with no explicit target list, so it picks up the new `subdir('harness')` automatically. **Dependencies** diff --git a/.kiro/specs/xce-harness-component/tasks.md b/.kiro/specs/xce-harness-component/tasks.md index 8b2eb661..d2c548a1 100644 --- a/.kiro/specs/xce-harness-component/tasks.md +++ b/.kiro/specs/xce-harness-component/tasks.md @@ -33,7 +33,7 @@ - _Requirements: 1.4, 3.1, 3.2, 3.4_ - [ ] 3. Integration: decouple build orchestration, downstream workflows, and documentation -- [ ] 3.1 Add the harness build entry and decouple it from the controller build +- [x] 3.1 Add the harness build entry and decouple it from the controller build - In `src/tools/xce-build.sh`, drop `controller/xce_test` from the `controller)` case's compile target list; add a new `harness)` case following the identical three-part `setup_build` / `meson compile` / conditional `meson test --suite harness` template already used by `scheduler)`/`worker)` - Observable: `/xce-build harness` on a fresh build dir (no prior controller build) produces the `xce_test` binary and runs the `harness` suite; `/xce-build controller` alone does not produce `xce_test` - _Requirements: 2.1, 2.2, 2.3, 2.4_ diff --git a/src/tools/xce-build.sh b/src/tools/xce-build.sh index b2fe1845..d929d1e5 100755 --- a/src/tools/xce-build.sh +++ b/src/tools/xce-build.sh @@ -221,7 +221,7 @@ MESON_OPTS+=(-Dcommit_id="$commit_id" -Dbuild_time="$build_time" -Ddirty_fingerp usage() { echo "Usage: $0 [component] [profile|build_dir] [build_dir] [--incremental] [--jobs N]" - echo "Components: all (default), lib, controller, scheduler, worker, apiserver, xcecli, xceadmin" + echo "Components: all (default), lib, controller, harness, scheduler, worker, apiserver, xcecli, xceadmin" echo "Profiles: asan (default), debug (non-ASAN -O0 -g3, for gdb/cores), release" echo "--incremental: reconfigure the existing build dir in place instead of a full" echo " rm -rf + fresh setup -- preserves other already-built components in the same" @@ -292,12 +292,21 @@ case "$COMPONENT" in controller) setup_build echo "=== Building lib + controller + tests ===" - meson compile -C "$BUILD_DIR" "${MESON_COMPILE_JOB_OPTS[@]}" xce_controller controller_unit_test controller/xce_test + meson compile -C "$BUILD_DIR" "${MESON_COMPILE_JOB_OPTS[@]}" xce_controller controller_unit_test if [ "$RUN_TESTS" = 1 ]; then echo "=== Running controller tests ===" meson test -C "$BUILD_DIR" "${MESON_TEST_JOB_OPTS[@]}" --suite controller --print-errorlogs fi ;; + harness) + setup_build + echo "=== Building lib + harness + tests ===" + meson compile -C "$BUILD_DIR" "${MESON_COMPILE_JOB_OPTS[@]}" xce_test harness_unit_test resval_typeresolve_unit_test joblist_display_unit_test join_worker_args_unit_test listrow_json_unit_test + if [ "$RUN_TESTS" = 1 ]; then + echo "=== Running harness tests ===" + meson test -C "$BUILD_DIR" "${MESON_TEST_JOB_OPTS[@]}" --suite harness --print-errorlogs + fi + ;; scheduler) setup_build echo "=== Building lib + scheduler + tests ==="