Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,17 @@ jobs:
--cap-drop=ALL --cap-add=CHOWN --cap-add=DAC_OVERRIDE
--cap-add=FOWNER --cap-add=SETUID --cap-add=SETGID --cap-add=KILL
)
wait_for_box_ready() {
local _
for _ in {1..60}; do
if docker exec "$box" sh -c 'test "$(cat /proc/1/comm)" = sleep'; then
return 0
fi
sleep 1
done
docker logs "$box" >&2
return 1
}
docker volume create "$home_volume" >/dev/null
docker volume create "$workspace_volume" >/dev/null
docker run -d --name "$box" \
Expand All @@ -320,6 +331,7 @@ jobs:
-v "$workspace_volume:/workspace" \
-v /etc/localtime:/etc/localtime:ro \
squarebox:test sleep infinity
wait_for_box_ready
docker exec -u dev "$box" bash -c '
mkdir -p /workspace/.squarebox
printf "tmux\n" > /workspace/.squarebox/multiplexer
Expand All @@ -329,6 +341,7 @@ jobs:
'
docker stop "$box" >/dev/null
docker start "$box" >/dev/null
wait_for_box_ready
docker exec -u dev "$box" bash -c \
'grep -qx restart-ok ~/.squarebox-e2e-state && command -v tmux >/dev/null'
scripts/e2e-evidence.sh pass lifecycle.restart \
Expand All @@ -341,6 +354,7 @@ jobs:
-v "$workspace_volume:/workspace" \
-v /etc/localtime:/etc/localtime:ro \
squarebox:test sleep infinity
wait_for_box_ready
docker exec -u dev "$box" bash -c \
'grep -qx restart-ok ~/.squarebox-e2e-state && command -v tmux >/dev/null'
scripts/e2e-evidence.sh pass lifecycle.recreate \
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
- CI reports claiming behavior that was not executed.
- Release-candidate failures caused by a Compose UID-remap startup race,
cross-UID Evidence file permissions, LazyGit's lowercase Linux asset name,
and Gum release binaries built with a vulnerable Go standard library.
Gum release binaries built with a vulnerable Go standard library, and raw
lifecycle assertions racing synchronous Box-tier reconciliation.

### Removed

Expand Down
4 changes: 4 additions & 0 deletions tests/test-e2e-evidence.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ grep -Fq 'docker compose up -d --force-recreate --no-deps squarebox' "$WORKFLOW"
grep -Fq 'test "$replacement_box" != "$original_box"' "$WORKFLOW"
test "$(grep -Fc 'wait_for_compose_workspace' "$WORKFLOW")" -eq 3
grep -Fq 'test "$(stat -c %u /proc/1)" = "$1" && test -w /workspace' "$WORKFLOW"
# Raw Docker lifecycle assertions must wait for the entrypoint's synchronous
# Box-tier reconciliation after create, restart, and replacement.
test "$(grep -Fc 'wait_for_box_ready' "$WORKFLOW")" -eq 4
grep -Fq 'test "$(cat /proc/1/comm)" = sleep' "$WORKFLOW"
grep -Fq '~/.squarebox-compose-e2e' "$WORKFLOW"
grep -Fq '$SQUAREBOX_WORKSPACE/from-compose' "$WORKFLOW"
grep -Fq -- '--cap-drop=ALL --cap-add=CHOWN --cap-add=DAC_OVERRIDE' "$WORKFLOW"
Expand Down