update mission cancel
Some checks failed
Test / test (push) Has been cancelled

This commit is contained in:
2026-06-15 10:30:00 +07:00
parent 6cc51a35c4
commit 4b372100eb
13 changed files with 922 additions and 134 deletions

View File

@@ -126,10 +126,37 @@ if [[ "$RUNNER_STATE" == "running" ]]; then
assert_code "POST /api/mission_queue/continue" 200 "$TMP/cont.json" \
-X POST "$BASE/api/mission_queue/continue"
assert_json_true "runner not paused" "$TMP/cont.json" 'doc.get("state") != "paused"'
for _ in $(seq 1 15); do
curl -s "$BASE/api/mission_queue" -o "$TMP/runner_poll.json"
RUNNER_STATE="$(python3 -c "import json; print(json.load(open('$TMP/runner_poll.json')).get('runner',{}).get('state',''))")"
if [[ "$RUNNER_STATE" == "running" || "$RUNNER_STATE" == "paused" ]]; then
break
fi
sleep 0.2
done
if [[ "$RUNNER_STATE" == "running" || "$RUNNER_STATE" == "paused" ]]; then
assert_code "POST /api/mission_queue/cancel" 200 "$TMP/cancel.json" \
-X POST "$BASE/api/mission_queue/cancel"
for _ in $(seq 1 40); do
curl -s "$BASE/api/mission_queue" -o "$TMP/runner_poll.json"
RUNNER_STATE="$(python3 -c "import json; print(json.load(open('$TMP/runner_poll.json')).get('runner',{}).get('state',''))")"
if [[ "$RUNNER_STATE" == "idle" ]]; then
break
fi
sleep 0.15
done
assert_json_true "runner idle after cancel" "$TMP/runner_poll.json" \
'doc.get("runner",{}).get("state") == "idle"'
else
log_fail "runner not active for cancel test (skipped)"
fi
else
log_fail "runner never reached running (pause test skipped)"
fi
assert_code "POST /api/mission_queue/cancel idle" 400 "$TMP/cancel_idle.json" \
-X POST "$BASE/api/mission_queue/cancel"
# --- LiDAR CRUD ---
assert_code "POST /api/lidars" 201 "$TMP/lidar.json" \
-X POST "$BASE/api/lidars" \