Add CI tests for all new async control commands.
Scanned 5/31/2026
Install via CLI
openskills install tools-only/X-Skills# fn-13-pxj.5 Add CI tests for async control commands
## Description
Add CI tests for all new async control commands.
**IMPORTANT**: Tests must be jq-free. Use Python for JSON parsing to maintain Windows Git Bash compatibility.
### Implementation
**In `plugins/flow-next/scripts/ci_test.sh`:**
1. `test_status_command`:
```bash
test_status_command() {
$FLOWCTL status
[[ $? -eq 0 ]] && pass "status command" || fail "status command"
}
```
2. `test_status_json`:
```bash
test_status_json() {
output=$($FLOWCTL status --json)
# Use Python to validate JSON (not jq)
echo "$output" | python3 -c 'import json,sys; json.load(sys.stdin)' 2>/dev/null
[[ $? -eq 0 ]] && pass "status --json" || fail "status --json invalid JSON"
}
```
3. `test_ralph_pause_resume_commands`:
```bash
test_ralph_pause_resume_commands() {
# Create mock run directory
mkdir -p scripts/ralph/runs/test-run
echo "iteration: 1" > scripts/ralph/runs/test-run/progress.txt
# Test pause
$FLOWCTL ralph pause --run test-run
[[ -f scripts/ralph/runs/test-run/PAUSE ]] && pass "ralph pause" || fail "ralph pause"
# Test resume
$FLOWCTL ralph resume --run test-run
[[ ! -f scripts/ralph/runs/test-run/PAUSE ]] && pass "ralph resume" || fail "ralph resume"
# Test stop
$FLOWCTL ralph stop --run test-run
[[ -f scripts/ralph/runs/test-run/STOP ]] && pass "ralph stop" || fail "ralph stop"
# Cleanup
rm -rf scripts/ralph/runs/test-run
}
```
4. `test_task_reset`:
```bash
test_task_reset() {
# Create epic and task
epic=$($FLOWCTL epic create --title "Reset test" --json | python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')
task=$($FLOWCTL task create --epic $epic --title "Test task" --json | python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')
# Complete task
$FLOWCTL start $task
$FLOWCTL done $task
# Reset
$FLOWCTL task reset $task
status=$($FLOWCTL show $task --json | python3 -c 'import json,sys; print(json.load(sys.stdin)["status"])')
[[ "$status" == "todo" ]] && pass "task reset" || fail "task reset: status=$status"
# Cleanup: close epic to avoid polluting state
}
```
5. `test_task_reset_cascade`:
```bash
test_task_reset_cascade() {
# Create epic with dependent tasks (A <- B)
# Complete both
# Reset A with --cascade
# Verify both reset to todo
}
```
6. `test_task_reset_in_progress_error`:
```bash
test_task_reset_in_progress_error() {
# Create and start task (in_progress)
# Attempt reset, expect failure (exit code != 0)
}
```
### Key Patterns
- Use `python3 -c 'import json,sys; ...'` instead of `jq` for JSON parsing
- Use `python3 -c 'import json,sys; print(json.load(sys.stdin)["field"])'` to extract fields
- Follow existing pass()/fail() patterns
### Key Files
- `plugins/flow-next/scripts/ci_test.sh`
## Acceptance
- [ ] `test_status_command` passes
- [ ] `test_status_json` validates JSON output (using Python, not jq)
- [ ] `test_ralph_pause_resume_commands` tests pause/resume/stop
- [ ] `test_task_reset` tests basic reset flow
- [ ] `test_task_reset_cascade` tests cascade behavior
- [ ] `test_task_reset_in_progress_error` tests error on in_progress
- [ ] All tests registered in test runner
- [ ] `./ci_test.sh` passes with all new tests
- [ ] No jq dependency anywhere in tests
## Done summary
- Added 9 new CI tests for async control commands
- Tests: status, ralph pause/resume/stop, task reset (basic + in_progress error), epic add-dep/rm-dep
- All jq-free (Python JSON parsing for Windows Git Bash compatibility)
Why: Verify new async control commands work correctly
Verification: CI 40/40 (was 31/31, +9 new tests)
## Evidence
- Commits: e297f762e8c921c4c7bb228b564ca32ffa2e3aa0
- Tests: plugins/flow-next/scripts/ci_test.sh
- PRs:No comments yet. Be the first to comment!