Skip to content

Commit

Permalink
chore: Upgrade Playwright 1.44.1 (#538)
Browse files Browse the repository at this point in the history
* Upgraded Playwright to 1.44.1
* Cleaned up `run_docker.sh`
* Added `nvm` to Dockerfile

resolves #537
  • Loading branch information
bmingles authored Jun 10, 2024
1 parent 9b0b498 commit 606180a
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 34 deletions.
48 changes: 24 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"@deephaven/eslint-config": "^0.72.0",
"@deephaven/prettier-config": "^0.72.0",
"@deephaven/tsconfig": "^0.72.0",
"@playwright/test": "^1.41.2",
"@testing-library/jest-dom": "^5.16.4",
"@playwright/test": "^1.44.1",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^12.1.3",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.4.3",
Expand Down
27 changes: 25 additions & 2 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1

# Dockerfile for running and updating snapshots locally and on CI
FROM mcr.microsoft.com/playwright:v1.41.2-jammy AS playwright
FROM mcr.microsoft.com/playwright:v1.44.1-jammy AS playwright
WORKDIR /work/

# Update packages list and install some build tools.
Expand All @@ -14,6 +14,29 @@ RUN set -eux; \

RUN fc-list : family;

RUN npm install @playwright/[email protected]
# Copy just the .nvmrc first and install nvm/node/npm first as these will change the least often
# https://docs.docker.com/build/cache/
COPY .nvmrc .

# nvm needs to be run in a bash shell
SHELL ["/bin/bash", "--login", "-c"]
# The default `.bashrc` bails on the first line if not in interactive shell.
# We can just empty it so that the nvm install below will actually run when sourcing
# `.bashrc`
RUN echo "" > /root/.bashrc
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
RUN source /root/.bashrc && nvm install

# Now clobber the default node installed by the playwright
# image so that the commands in docker compose entrypoint will
# also use the correct version of node without running in bash
RUN ln -s $(which node) /usr/local/bin/nodejs
RUN ln -s $(which node) /usr/local/bin/node
RUN ln -s $(which npm) /usr/local/bin/npm

# Confirm node version is correct for debugging
RUN node --version

RUN npm install @playwright/[email protected]
COPY playwright.config.ts .
COPY playwright-docker.config.ts .
14 changes: 8 additions & 6 deletions tools/run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
pushd "$(dirname "$0")"

# Start the containers
if [[ -z "${CI}" ]]; then
docker compose -f ../tests/docker-compose.yml run --service-ports --rm --build "$@"
exit_code=$?
docker compose -f ../tests/docker-compose.yml down
else
docker compose -f ../tests/docker-compose.yml run --service-ports --rm --build -e CI=true "$@"
if [[ "${CI}" == "1" || "${CI}" == "true" ]]; then
# In CI, keep the container in case we need to dump logs in another
# step of the GH action. It should be cleaned up automatically by the CI runner.
docker compose -f ../tests/docker-compose.yml run --service-ports --build -e CI=true "$@"
exit_code=$?
# stop instead of down to preserve container logs
docker compose -f ../tests/docker-compose.yml stop deephaven-plugins
else
docker compose -f ../tests/docker-compose.yml run --service-ports --rm --build "$@"
exit_code=$?
docker compose -f ../tests/docker-compose.yml down
fi

# Reset pwd
Expand Down

0 comments on commit 606180a

Please sign in to comment.