From 37e00bf7563986be19cb1a5a1dd754abae05723b Mon Sep 17 00:00:00 2001 From: James Wampler Date: Sat, 4 Jul 2026 18:39:06 -0700 Subject: [PATCH] Use docker cp instead of a bind mount to get repo files into the playwright container This script runs inside the runner's own job container and talks to the host's docker daemon over a mounted socket (docker-outside-of-docker). A bind mount path only exists inside this job container, not on the host the daemon resolves it against, so docker run -v failed with ENOENT. docker cp copies file contents instead, sidestepping the path mismatch. --- scripts/ci/smoke-qa.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/ci/smoke-qa.sh b/scripts/ci/smoke-qa.sh index 39c7927..8c986a4 100755 --- a/scripts/ci/smoke-qa.sh +++ b/scripts/ci/smoke-qa.sh @@ -36,12 +36,20 @@ npm --prefix src/admin ci # at /ms-playwright), as a sibling container reachable at the same bridge # gateway IP used above. Pin the image tag to the exact resolved # @playwright/test version so the test runner and browser build match. +# +# This script itself runs inside the runner's own job container, talking to +# the host's docker daemon over a mounted socket (docker-outside-of-docker) - +# `docker run -v "$CI_ROOT:/work"` would ask the *host* daemon to bind-mount a +# path that only exists inside this job container, which fails. `docker cp` +# instead copies the files by content, sidestepping the path mismatch. PW_VERSION="$(node -p "require('./src/admin/node_modules/@playwright/test/package.json').version")" log "Running Playwright admin e2e suite against $BASE_URL (playwright:v$PW_VERSION-noble)" -docker run --rm \ - -e "E2E_BASE_URL=$BASE_URL" \ - -v "$CI_ROOT:/work" -w /work/src/admin \ - "mcr.microsoft.com/playwright:v${PW_VERSION}-noble" \ - npm run e2e + +PW_CONTAINER="$(docker create -e "E2E_BASE_URL=$BASE_URL" -w /work/src/admin "mcr.microsoft.com/playwright:v${PW_VERSION}-noble" npm run e2e)" +docker cp "$CI_ROOT/." "$PW_CONTAINER:/work" +pw_status=0 +docker start -a "$PW_CONTAINER" || pw_status=$? +docker rm -f "$PW_CONTAINER" > /dev/null +[[ "$pw_status" -eq 0 ]] || fail "Playwright e2e suite failed (exit $pw_status)" log "smoke-qa.sh complete - QA environment validated end to end"