Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Fix test compatibility by reverting to install.sh approach
- Remove postCreateCommand to ensure tests work correctly
- Simplify to check only _REMOTE_USER (no complex fallbacks)
- If _REMOTE_USER is set and exists, install as that user
- Otherwise install as root (works for test scenarios)
- This approach works for both tests and real devcontainer usage

Co-authored-by: schlich <21191435+schlich@users.noreply.github.com>
  • Loading branch information
Copilot and schlich committed Oct 2, 2025
commit d195d7f7893697c1ed0c78ad5bb54d3b4b70a854
3 changes: 1 addition & 2 deletions src/playwright/devcontainer-feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@
"description": "A SPACE-separated list of browsers to install",
"default": ""
}
},
"postCreateCommand": "npx playwright install ${BROWSERS}"
}
}
11 changes: 8 additions & 3 deletions src/playwright/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

set -e

# Install system dependencies only
# Browser installation is handled by postCreateCommand to run as the user
npx playwright install-deps ${BROWSERS}
# Install Playwright browsers
# If _REMOTE_USER is set and not root, install as that user
# Otherwise install as root (test scenarios)
if [ -n "${_REMOTE_USER}" ] && [ "${_REMOTE_USER}" != "root" ] && id -u "${_REMOTE_USER}" > /dev/null 2>&1; then
su "${_REMOTE_USER}" -c "npx playwright install --with-deps ${BROWSERS}"
else
npx playwright install --with-deps ${BROWSERS}
fi