Skip to content

Commit 202d900

Browse files
committed
test(e2e): authorize doctor install switch repairs
1 parent ef985ec commit 202d900

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

scripts/e2e/lib/doctor-install-switch/scenario.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ fi
5454
git_cli="$git_root/openclaw.mjs"
5555

5656
package_version="$(node -p "require(\"$npm_root/package.json\").version")"
57+
update_doctor_env="OPENCLAW_UPDATE_IN_PROGRESS=1"
58+
update_doctor_env+=" OPENCLAW_UPDATE_PARENT_SUPPORTS_DOCTOR_CONFIG_WRITE=1"
59+
update_doctor_env+=" OPENCLAW_UPDATE_PARENT_SUPPORTS_GATEWAY_RESTART=1"
60+
update_doctor_env+=" OPENCLAW_UPDATE_PARENT_ALLOWS_GATEWAY_SERVICE_REPAIR=1"
61+
update_doctor_env+=" OPENCLAW_UPDATE_PARENT_ALLOWS_GATEWAY_ACTIVATION=0"
5762
is_legacy_package_acceptance_compat() {
5863
[ "$(node scripts/e2e/lib/package-compat.mjs "$1")" = "1" ]
5964
}
@@ -162,14 +167,14 @@ run_flow \
162167
"npm-to-git" \
163168
"$npm_bin daemon install --force" \
164169
"$npm_entry" \
165-
"OPENCLAW_UPDATE_IN_PROGRESS=1 node $git_cli doctor --repair --force --yes --non-interactive" \
170+
"$update_doctor_env node $git_cli doctor --repair --force --yes --non-interactive" \
166171
"$git_entry"
167172

168173
run_flow \
169174
"git-to-npm" \
170175
"node $git_cli daemon install --force" \
171176
"$git_entry" \
172-
"OPENCLAW_UPDATE_IN_PROGRESS=1 $npm_bin doctor --repair --force --yes --non-interactive" \
177+
"$update_doctor_env $npm_bin doctor --repair --force --yes --non-interactive" \
173178
"$npm_entry"
174179

175180
run_proxy_env_flow() {
@@ -199,7 +204,12 @@ run_proxy_env_flow() {
199204
printf "%s\n" "Environment=HTTP_PROXY=http://stale-proxy.local:7890"
200205
printf "%s\n" "Environment=HTTPS_PROXY=https://stale-proxy.local:7890"
201206
} >>"$unit_path"
202-
if ! openclaw_e2e_maybe_timeout "$command_timeout" env OPENCLAW_UPDATE_IN_PROGRESS=1 \
207+
if ! openclaw_e2e_maybe_timeout "$command_timeout" env \
208+
OPENCLAW_UPDATE_IN_PROGRESS=1 \
209+
OPENCLAW_UPDATE_PARENT_SUPPORTS_DOCTOR_CONFIG_WRITE=1 \
210+
OPENCLAW_UPDATE_PARENT_SUPPORTS_GATEWAY_RESTART=1 \
211+
OPENCLAW_UPDATE_PARENT_ALLOWS_GATEWAY_SERVICE_REPAIR=1 \
212+
OPENCLAW_UPDATE_PARENT_ALLOWS_GATEWAY_ACTIVATION=0 \
203213
node "$git_cli" doctor --repair --force --yes --non-interactive >"$doctor_log" 2>&1; then
204214
openclaw_e2e_print_log "$doctor_log"
205215
exit 1

test/scripts/docker-build-helper.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4028,6 +4028,7 @@ output="$(cat "$sampler_log")"
40284028
expect(doctorLoginctlShim).toContain("Linger=yes");
40294029
expect(doctorSystemctlShim).toContain("ActiveState=inactive");
40304030
expect(doctorSystemctlShim).toContain('unit_path="$HOME/.config/systemd/user/${unit}"');
4031+
expect(doctorScenario).toContain("OPENCLAW_UPDATE_PARENT_ALLOWS_GATEWAY_SERVICE_REPAIR=1");
40314032
expect(readFileSync(PLUGINS_DOCKER_E2E_PATH, "utf8")).toContain(
40324033
"scripts/e2e/lib/plugins/sweep.sh",
40334034
);

0 commit comments

Comments
 (0)