Skip to content

Commit da83dac

Browse files
endolinbotclaude
andcommitted
test(driver): update path references for scripts/driver/ (#3)
The driver.sh moved from roles/driver/ to scripts/driver/ in 564372a; update the four test scripts and the mock-garden harness that reference it. Simplify mock-garden.sh's copy logic now that the source path is unambiguous (the old logic carried fallback branches for the move-in-flight state). Update .github/workflows/driver-tests.yml so its shellcheck stanza lints the scripts/-side artifacts (driver, daemon wrappers, stub watcher) and the bash-syntax pass walks scripts/ and skills/ rather than roles/ and skills/. Local run of tests/driver/run.sh: 4 suites pass, 0 fail. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e320bc6 commit da83dac

6 files changed

Lines changed: 25 additions & 26 deletions

File tree

.github/workflows/driver-tests.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,22 @@ jobs:
4242
git config --global user.name "ci-bot"
4343
git config --global user.email "ci-bot@example.invalid"
4444
45-
- name: shellcheck (driver + cleaner + per-test scripts)
46-
# Lint the in-PR bash artifacts. Scope is the driver, the cleaner
45+
- name: shellcheck (driver + daemons + watcher stub + cleaner + per-test scripts)
46+
# Lint the in-PR bash artifacts. Scope is the driver, the daemon
47+
# management wrappers, the stub feed watcher, the cleaner
4748
# skeleton, the gardener-inbox error reporter, and the driver
4849
# tests harness. Pre-existing scripts outside this scope have
4950
# known issues unrelated to this PR; widening the lint surface
5051
# is a separate effort.
5152
run: |
5253
shellcheck -S warning \
53-
roles/driver/driver.sh \
54+
scripts/driver/driver.sh \
55+
scripts/daemons/start.sh \
56+
scripts/daemons/stop.sh \
57+
scripts/daemons/status.sh \
58+
scripts/daemons/logs.sh \
59+
scripts/daemons/config.sh.example \
60+
scripts/watcher/endo-but-for-bots/watcher.sh \
5461
skills/cleaner/cleaner.sh \
5562
skills/cleaner/test-cleaner.sh \
5663
skills/gardener-inbox-error-reporting/report-error.sh \
@@ -61,8 +68,8 @@ jobs:
6168
tests/driver/test_loop_capture_and_self_improve.sh \
6269
tests/driver/test_trap_fires_on_error.sh
6370
64-
- name: bash -n (syntax check, all role and skill main scripts)
65-
# Syntactic check on every shell script under roles/ and skills/.
71+
- name: bash -n (syntax check, all scripts/ and skill main scripts)
72+
# Syntactic check on every shell script under scripts/ and skills/.
6673
# `bash -n` is purely lexical so it is safe to run on the broader
6774
# set, unlike shellcheck which surfaces warnings the surrounding
6875
# scripts have not addressed yet.
@@ -74,7 +81,7 @@ jobs:
7481
echo "::error file=$f::bash -n failed"
7582
fail=1
7683
fi
77-
done < <(find roles skills -mindepth 2 -maxdepth 3 -type f -name '*.sh' | sort)
84+
done < <(find scripts skills -mindepth 2 -maxdepth 4 -type f -name '*.sh' | sort)
7885
if [ "$fail" -ne 0 ]; then
7986
exit 1
8087
fi

tests/driver/lib/mock-garden.sh

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,12 @@ mock_garden_setup() {
2727

2828
mkdir -p "$MOCK_GARDEN_ROOT" "$MOCK_STUBS" "$MOCK_BIN" "$MOCK_LOGS"
2929

30-
# 1. Copy roles/driver/ and the skills the driver invokes into the
30+
# 1. Copy scripts/driver/ and the skills the driver invokes into the
3131
# mock garden. We do not copy the entire real garden; that would
3232
# drag in the journal as a git submodule. The mock harness needs
3333
# only the artifacts the driver references at runtime.
34-
cp -r "$REAL_GARDEN_ROOT/roles/driver" "$MOCK_GARDEN_ROOT/" 2>/dev/null || \
35-
cp -r "$REAL_GARDEN_ROOT/roles/driver" "$MOCK_GARDEN_ROOT/roles-driver-tmp"
36-
# The mkdir+cp pattern handles the case where roles/driver did not
37-
# yet exist (first-run); the test fails fast if so. We unify here:
38-
mkdir -p "$MOCK_GARDEN_ROOT/roles"
39-
if [ -d "$MOCK_GARDEN_ROOT/roles-driver-tmp" ]; then
40-
mv "$MOCK_GARDEN_ROOT/roles-driver-tmp" "$MOCK_GARDEN_ROOT/roles/driver"
41-
elif [ -d "$MOCK_GARDEN_ROOT/driver" ]; then
42-
mv "$MOCK_GARDEN_ROOT/driver" "$MOCK_GARDEN_ROOT/roles/driver"
43-
fi
34+
mkdir -p "$MOCK_GARDEN_ROOT/scripts"
35+
cp -r "$REAL_GARDEN_ROOT/scripts/driver" "$MOCK_GARDEN_ROOT/scripts/"
4436

4537
# Copy the skills the driver invokes.
4638
mkdir -p "$MOCK_GARDEN_ROOT/skills"
@@ -127,7 +119,7 @@ mock_garden_clear_pr_json() {
127119
mock_garden_run_driver() {
128120
local lane=$1
129121
shift
130-
bash "$MOCK_GARDEN_ROOT/roles/driver/driver.sh" "$lane" "$@"
122+
bash "$MOCK_GARDEN_ROOT/scripts/driver/driver.sh" "$lane" "$@"
131123
}
132124

133125
mock_garden_teardown() {

tests/driver/test_design_only_happy_path.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ chmod +x "$stub_un_draft_file"
6161
export UN_DRAFT_STUB="$stub_un_draft_file"
6262

6363
run_driver() {
64-
bash "$MOCK_GARDEN_ROOT/roles/driver/driver.sh" 1
64+
bash "$MOCK_GARDEN_ROOT/scripts/driver/driver.sh" 1
6565
}
6666

6767
read_state_field() {

tests/driver/test_loop_capture_and_self_improve.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export SELF_IMPROVE_CLAUDE_STUB="$stub_self_improve"
6767

6868
# --- run the driver -------------------------------------------------------
6969
set +e
70-
bash "$MOCK_GARDEN_ROOT/roles/driver/driver.sh" 1 >/dev/null 2>&1
70+
bash "$MOCK_GARDEN_ROOT/scripts/driver/driver.sh" 1 >/dev/null 2>&1
7171
rc=$?
7272
set -e
7373

@@ -124,7 +124,7 @@ section_count_before=$(grep -c '^## tick at' "$improvements_file" 2>/dev/null ||
124124

125125
mock_garden_set_pr_json '{"state":"OPEN","isDraft":true,"reviews":[]}'
126126
set +e
127-
bash "$MOCK_GARDEN_ROOT/roles/driver/driver.sh" 1 >/dev/null 2>&1
127+
bash "$MOCK_GARDEN_ROOT/scripts/driver/driver.sh" 1 >/dev/null 2>&1
128128
rc2=$?
129129
set -e
130130

@@ -161,7 +161,7 @@ mock_garden_set_pr_json '{"state":"OPEN","isDraft":true,"reviews":[]}'
161161
: > "$MOCK_LOGS/claude.log"
162162

163163
set +e
164-
bash "$MOCK_GARDEN_ROOT/roles/driver/driver.sh" 1 >/dev/null 2>&1
164+
bash "$MOCK_GARDEN_ROOT/scripts/driver/driver.sh" 1 >/dev/null 2>&1
165165
rc3=$?
166166
set -e
167167

tests/driver/test_skeleton.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ echo "=== test_skeleton ==="
3030
mock_garden_setup
3131

3232
set +e
33-
output=$(bash "$MOCK_GARDEN_ROOT/roles/driver/driver.sh" 2>&1)
33+
output=$(bash "$MOCK_GARDEN_ROOT/scripts/driver/driver.sh" 2>&1)
3434
rc=$?
3535
set -e
3636
run_assert mock_garden_assert_eq "no-lane rc is 64" 64 "$rc"
3737
run_assert mock_garden_assert_contains "no-lane stderr mentions usage" "usage:" "$output"
3838

3939
# --- 2. usage error: non-integer lane ------------------------------------
4040
set +e
41-
output=$(bash "$MOCK_GARDEN_ROOT/roles/driver/driver.sh" notalane 2>&1)
41+
output=$(bash "$MOCK_GARDEN_ROOT/scripts/driver/driver.sh" notalane 2>&1)
4242
rc=$?
4343
set -e
4444
run_assert mock_garden_assert_eq "non-integer lane rc is 64" 64 "$rc"
@@ -62,7 +62,7 @@ chmod +x "$POST_JOB_STUB"
6262

6363
# Run oneshot. Without DRIVER_PR set, the driver will try to post a
6464
# build-design-only job to advance from initial.
65-
DRIVER_ONESHOT=1 bash "$MOCK_GARDEN_ROOT/roles/driver/driver.sh" 1 >/dev/null 2>&1
65+
DRIVER_ONESHOT=1 bash "$MOCK_GARDEN_ROOT/scripts/driver/driver.sh" 1 >/dev/null 2>&1
6666
rc=$?
6767

6868
state_file="$MOCK_GARDEN_JOURNAL/drivers/mock-host/1.md"

tests/driver/test_trap_fires_on_error.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ bootstrap.
6161
EOF
6262

6363
set +e
64-
bash "$MOCK_GARDEN_ROOT/roles/driver/driver.sh" 1 >/dev/null 2>&1
64+
bash "$MOCK_GARDEN_ROOT/scripts/driver/driver.sh" 1 >/dev/null 2>&1
6565
rc=$?
6666
set -e
6767

0 commit comments

Comments
 (0)