From afdc50cfd0b651cd750503c26f809bbdf3aefed6 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Fri, 26 Jun 2026 19:39:14 +0800 Subject: [PATCH] test: keep layered flutter tests aligned with repo --- scripts/ci/run_layered_tests.sh | 19 ++++++++++++------- .../gateway_runtime_bridge_skills_test.dart | 3 +++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/scripts/ci/run_layered_tests.sh b/scripts/ci/run_layered_tests.sh index 32b0928a..3a54ee3e 100755 --- a/scripts/ci/run_layered_tests.sh +++ b/scripts/ci/run_layered_tests.sh @@ -9,7 +9,18 @@ run_flutter_base() { } run_flutter_unit_widget() { - flutter test test/widgets test/features test/runtime test/app test/theme test/web + local test_dirs=() + local candidate + for candidate in test/widgets test/features test/runtime test/app test/theme test/web; do + if [[ -d "$candidate" ]] && find "$candidate" -name '*_test.dart' | grep -q .; then + test_dirs+=("$candidate") + fi + done + if [[ "${#test_dirs[@]}" -eq 0 ]]; then + echo "[skip] no unit/widget tests found" + return + fi + flutter test "${test_dirs[@]}" } run_flutter_golden_if_present() { @@ -36,16 +47,11 @@ run_patrol_if_present() { fi } -run_go_unit() { - (cd go/go_core && go test ./...) -} - case "$LAYER" in pr) run_flutter_base run_flutter_unit_widget run_flutter_golden_if_present - run_go_unit ;; e2e) run_flutter_base @@ -58,7 +64,6 @@ case "$LAYER" in run_flutter_golden_if_present run_flutter_integration_if_present run_patrol_if_present - run_go_unit ;; *) echo "Usage: $0 [pr|e2e|all]" diff --git a/test/runtime/gateway_runtime_bridge_skills_test.dart b/test/runtime/gateway_runtime_bridge_skills_test.dart index 84bfd2d4..9d5f2285 100644 --- a/test/runtime/gateway_runtime_bridge_skills_test.dart +++ b/test/runtime/gateway_runtime_bridge_skills_test.dart @@ -10,6 +10,9 @@ import 'package:xworkmate/runtime/runtime_models.dart'; import 'package:xworkmate/runtime/secure_config_store.dart'; void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + HttpOverrides.global = null; + test( 'SkillsController loads OpenClaw skills through bridge request without legacy gateway connect', () async {