Skip to content

Commit 60b6b67

Browse files
committed
ci: bound runtime volumes e2e clone step
1 parent f5bcc6e commit 60b6b67

2 files changed

Lines changed: 42 additions & 14 deletions

File tree

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ jobs:
191191
e2e-runtime-volumes-ssh:
192192
name: E2E (Runtime volumes + SSH)
193193
runs-on: ubuntu-latest
194-
timeout-minutes: 40
194+
timeout-minutes: 60
195195
steps:
196196
- uses: actions/checkout@v6
197197
- name: Install dependencies

scripts/e2e/runtime-volumes-ssh.sh

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,26 @@ SSH_KEY="$ROOT/dev_ssh_key"
3333
SSH_PUB_KEY="$ROOT/dev_ssh_key.pub"
3434
CLONE_LOG="$ROOT/clone.log"
3535
SSH_LOG="$ROOT/runtime-volumes-ssh.log"
36+
RUN_SCRIPT="$ROOT/run-runtime-volumes-ssh-clone.sh"
37+
# Cold controller and project image builds can be slow on GitHub-hosted runners.
38+
RUNTIME_CLONE_TIMEOUT="${DOCKER_GIT_E2E_RUNTIME_CLONE_TIMEOUT:-3300s}"
3639
HELPER_IMAGE=""
40+
FAILURE_DUMPED=0
3741

3842
fail() {
3943
echo "e2e/runtime-volumes-ssh: $*" >&2
44+
if [[ "$FAILURE_DUMPED" == "0" ]]; then
45+
on_error "fail"
46+
fi
4047
exit 1
4148
}
4249

4350
on_error() {
4451
local line="$1"
52+
if [[ "$FAILURE_DUMPED" == "1" ]]; then
53+
return
54+
fi
55+
FAILURE_DUMPED=1
4556
echo "e2e/runtime-volumes-ssh: failed at line $line" >&2
4657
docker ps -a --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}' | head -n 80 || true
4758
if docker ps -a --format '{{.Names}}' | grep -qx "$CONTAINER_NAME" 2>/dev/null; then
@@ -131,19 +142,36 @@ CODEX_AUTO_UPDATE=0
131142
CODEX_SHARE_AUTH=1
132143
EOF_ENV
133144

134-
(
135-
cd "$REPO_ROOT"
136-
dg_run_docker_git "$REPO_ROOT" clone "$REPO_URL" \
137-
--force \
138-
--gh-skip \
139-
--no-ssh \
140-
--authorized-keys "$ROOT/authorized_keys" \
141-
--ssh-port "$SSH_PORT" \
142-
--out-dir "$OUT_DIR_REL" \
143-
--container-name "$CONTAINER_NAME" \
144-
--service-name "$SERVICE_NAME" \
145-
--volume-name "$VOLUME_NAME"
146-
) >"$CLONE_LOG" 2>&1
145+
cat > "$RUN_SCRIPT" <<'EOF_RUN'
146+
#!/usr/bin/env bash
147+
set -euo pipefail
148+
149+
cd "$REPO_ROOT"
150+
bun packages/app/dist/src/docker-git/main.js clone "$REPO_URL" \
151+
--force \
152+
--gh-skip \
153+
--no-ssh \
154+
--authorized-keys "$ROOT/authorized_keys" \
155+
--ssh-port "$SSH_PORT" \
156+
--out-dir "$OUT_DIR_REL" \
157+
--container-name "$CONTAINER_NAME" \
158+
--service-name "$SERVICE_NAME" \
159+
--volume-name "$VOLUME_NAME"
160+
EOF_RUN
161+
chmod +x "$RUN_SCRIPT"
162+
163+
export REPO_ROOT REPO_URL ROOT SSH_PORT OUT_DIR_REL CONTAINER_NAME SERVICE_NAME VOLUME_NAME
164+
165+
set +e
166+
timeout "$RUNTIME_CLONE_TIMEOUT" "$RUN_SCRIPT" >"$CLONE_LOG" 2>&1
167+
clone_exit=$?
168+
set -e
169+
if [[ "$clone_exit" -eq 124 ]]; then
170+
fail "clone command timed out after $RUNTIME_CLONE_TIMEOUT"
171+
fi
172+
if [[ "$clone_exit" -ne 0 ]]; then
173+
fail "clone command failed with exit code $clone_exit"
174+
fi
147175

148176
grep -Fq -- "Project created: octocat/hello-world" "$CLONE_LOG" \
149177
|| fail "expected clone log to confirm project creation"

0 commit comments

Comments
 (0)