From c3966aea82184d9750e0baddf3e07e02225ec893 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 23 Jan 2026 17:15:49 +0000 Subject: [PATCH] Fix playwright-screenshots utility for native dependencies Without this, a developer would need to both specify --with-node-modules && --entrypoint and provide a custom entrypoint to do the `yarn install`. --- packages/element-web-playwright-common/Dockerfile | 4 +++- .../element-web-playwright-common/docker-entrypoint.sh | 9 +++++++++ .../playwright-screenshots.sh | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100755 packages/element-web-playwright-common/docker-entrypoint.sh diff --git a/packages/element-web-playwright-common/Dockerfile b/packages/element-web-playwright-common/Dockerfile index c8bf12e503..3be889bcd8 100644 --- a/packages/element-web-playwright-common/Dockerfile +++ b/packages/element-web-playwright-common/Dockerfile @@ -6,4 +6,6 @@ WORKDIR /work # fonts-dejavu is needed for the same RTL rendering as on CI RUN apt-get update && apt-get -y install docker.io fonts-dejavu -ENTRYPOINT ["npx", "playwright", "test", "--update-snapshots", "--reporter", "line"] +COPY docker-entrypoint.sh /docker-entrypoint.sh + +ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/packages/element-web-playwright-common/docker-entrypoint.sh b/packages/element-web-playwright-common/docker-entrypoint.sh new file mode 100755 index 0000000000..500fb27c68 --- /dev/null +++ b/packages/element-web-playwright-common/docker-entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [[ "$YARN_INSTALL" == "true" ]]; then + yarn install --frozen-lockfile +fi + +npx playwright test --update-snapshots --reporter line "$@" \ No newline at end of file diff --git a/packages/element-web-playwright-common/playwright-screenshots.sh b/packages/element-web-playwright-common/playwright-screenshots.sh index 686807387c..04455ae4da 100755 --- a/packages/element-web-playwright-common/playwright-screenshots.sh +++ b/packages/element-web-playwright-common/playwright-screenshots.sh @@ -59,7 +59,7 @@ while [[ $# -gt 0 ]]; do # It's a volume rather than a directory because otherwise things tend to start picking up # files from it in the native environment and break. --with-node-modules) - RUN_ARGS+=(--mount "type=volume,src=ew-docker-node-modules,dst=/work/node_modules,volume-nocopy") + RUN_ARGS+=(--mount "type=volume,src=ew-docker-node-modules,dst=/work/node_modules,volume-nocopy" -e YARN_INSTALL=true) shift ;; # Sets a different entrypoint (in which case the default arguments to the script will be ignored)