mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-28 08:02:13 +00:00
fix(e2e): time out telegram package installs
This commit is contained in:
@@ -223,6 +223,7 @@ run_logged() {
|
||||
echo "Running package Telegram live Docker E2E ($PACKAGE_LABEL)..."
|
||||
run_logged docker_e2e_docker_run_cmd run --rm \
|
||||
-e COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
|
||||
-e OPENCLAW_E2E_NPM_INSTALL_TIMEOUT="${OPENCLAW_E2E_NPM_INSTALL_TIMEOUT:-600s}" \
|
||||
-e OPENCLAW_NPM_TELEGRAM_INSTALL_SOURCE="$package_install_source" \
|
||||
-e OPENCLAW_NPM_TELEGRAM_PACKAGE_LABEL="$PACKAGE_LABEL" \
|
||||
${package_mount_args[@]+"${package_mount_args[@]}"} \
|
||||
@@ -237,7 +238,16 @@ export PATH="$NPM_CONFIG_PREFIX/bin:$PATH"
|
||||
install_source="${OPENCLAW_NPM_TELEGRAM_INSTALL_SOURCE:?missing OPENCLAW_NPM_TELEGRAM_INSTALL_SOURCE}"
|
||||
package_label="${OPENCLAW_NPM_TELEGRAM_PACKAGE_LABEL:-$install_source}"
|
||||
echo "Installing ${package_label} from ${install_source}..."
|
||||
npm install -g "$install_source" --no-fund --no-audit
|
||||
|
||||
npm_install_timeout="${OPENCLAW_E2E_NPM_INSTALL_TIMEOUT:-600s}"
|
||||
if [ -z "$npm_install_timeout" ] || [ "$npm_install_timeout" = "0" ]; then
|
||||
npm install -g "$install_source" --no-fund --no-audit
|
||||
elif command -v timeout >/dev/null 2>&1; then
|
||||
timeout --foreground --kill-after=30s "$npm_install_timeout" npm install -g "$install_source" --no-fund --no-audit
|
||||
else
|
||||
echo "timeout command not found; running package install without OPENCLAW_E2E_NPM_INSTALL_TIMEOUT" >&2
|
||||
npm install -g "$install_source" --no-fund --no-audit
|
||||
fi
|
||||
|
||||
command -v openclaw
|
||||
openclaw --version
|
||||
|
||||
@@ -207,6 +207,7 @@ docker_env=(
|
||||
-e OPENCLAW_NPM_TELEGRAM_WARM_SAMPLES="${OPENCLAW_NPM_TELEGRAM_WARM_SAMPLES:-20}"
|
||||
-e OPENCLAW_NPM_TELEGRAM_SAMPLE_TIMEOUT_MS="${OPENCLAW_NPM_TELEGRAM_SAMPLE_TIMEOUT_MS:-30000}"
|
||||
-e OPENCLAW_NPM_TELEGRAM_MAX_FAILURES="${OPENCLAW_NPM_TELEGRAM_MAX_FAILURES:-${OPENCLAW_NPM_TELEGRAM_WARM_SAMPLES:-20}}"
|
||||
-e OPENCLAW_E2E_NPM_INSTALL_TIMEOUT="${OPENCLAW_E2E_NPM_INSTALL_TIMEOUT:-600s}"
|
||||
)
|
||||
|
||||
forward_env_if_set() {
|
||||
@@ -262,7 +263,15 @@ export PATH="$NPM_CONFIG_PREFIX/bin:$PATH"
|
||||
install_source="${OPENCLAW_NPM_TELEGRAM_INSTALL_SOURCE:?missing OPENCLAW_NPM_TELEGRAM_INSTALL_SOURCE}"
|
||||
package_label="${OPENCLAW_NPM_TELEGRAM_PACKAGE_LABEL:-$install_source}"
|
||||
|
||||
npm install -g "$install_source" --no-fund --no-audit
|
||||
npm_install_timeout="${OPENCLAW_E2E_NPM_INSTALL_TIMEOUT:-600s}"
|
||||
if [ -z "$npm_install_timeout" ] || [ "$npm_install_timeout" = "0" ]; then
|
||||
npm install -g "$install_source" --no-fund --no-audit
|
||||
elif command -v timeout >/dev/null 2>&1; then
|
||||
timeout --foreground --kill-after=30s "$npm_install_timeout" npm install -g "$install_source" --no-fund --no-audit
|
||||
else
|
||||
echo "timeout command not found; running package install without OPENCLAW_E2E_NPM_INSTALL_TIMEOUT" >&2
|
||||
npm install -g "$install_source" --no-fund --no-audit
|
||||
fi
|
||||
command -v openclaw
|
||||
openclaw --version
|
||||
node -p "require('/npm-global/lib/node_modules/openclaw/package.json').version"
|
||||
|
||||
@@ -40,6 +40,12 @@ describe("package Telegram live Docker E2E", () => {
|
||||
|
||||
expect(installRunStart).toBeGreaterThanOrEqual(0);
|
||||
expect(installRunEnd).toBeGreaterThan(installRunStart);
|
||||
expect(installRun).toContain(
|
||||
'-e OPENCLAW_E2E_NPM_INSTALL_TIMEOUT="${OPENCLAW_E2E_NPM_INSTALL_TIMEOUT:-600s}"',
|
||||
);
|
||||
expect(installRun).toContain(
|
||||
'timeout --foreground --kill-after=30s "$npm_install_timeout" npm install -g "$install_source" --no-fund --no-audit',
|
||||
);
|
||||
expect(installRun).toContain('npm install -g "$install_source" --no-fund --no-audit');
|
||||
expect(installRun).toContain('"${package_mount_args[@]}"');
|
||||
expect(installRun).not.toContain('"${docker_env[@]}"');
|
||||
|
||||
@@ -143,6 +143,12 @@ describe("RTT harness", () => {
|
||||
expect(installEnvSnapshotIndex).toBeGreaterThanOrEqual(0);
|
||||
expect(convexSecretForwardIndex).toBeGreaterThan(installEnvSnapshotIndex);
|
||||
expect(packageInstallIndex).toBeLessThan(credentialAcquireIndex);
|
||||
expect(script).toContain(
|
||||
'-e OPENCLAW_E2E_NPM_INSTALL_TIMEOUT="${OPENCLAW_E2E_NPM_INSTALL_TIMEOUT:-600s}"',
|
||||
);
|
||||
expect(script).toContain(
|
||||
'timeout --foreground --kill-after=30s "$npm_install_timeout" npm install -g "$install_source" --no-fund --no-audit',
|
||||
);
|
||||
expect(script).toContain("run_logged docker_e2e_docker_run_cmd run --rm");
|
||||
expect(script).not.toContain("run_logged docker run --rm");
|
||||
expect(heartbeatStartIndex).toBeGreaterThan(sourceIndex);
|
||||
|
||||
Reference in New Issue
Block a user