Skip to content

Commit

Permalink
Chore(ci): Migrate E2E tests to docker compose template
Browse files Browse the repository at this point in the history
  * fixing compatibility issues with local development on Windows
  • Loading branch information
literat committed Feb 5, 2025
1 parent f418ef6 commit 7433995
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
16 changes: 14 additions & 2 deletions bin/make/e2e.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/sh
#!/usr/bin/env bash

set -o errexit

project_root=$(cd $(dirname "${BASH_SOURCE}")/../..; pwd)

if ! command -v jq &> /dev/null; then
echo "jq could not be found, please install it."
exit 1
Expand Down Expand Up @@ -35,4 +37,14 @@ while [[ $# -gt 0 ]]; do
shift
done

docker run --rm --network=host --ipc=host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v$PLAYWRIGHT_VERSION-$UBUNTU_VERSION $XVFB sh -c "corepack install && corepack enable && yarn test:e2e$E2E_FLAG"
if [ "$(uname)" = "MINGW64_NT" ] || [ "$(uname)" = "MINGW32_NT" ]; then
# Convert Windows path to Unix path for Docker
WORK_DIR=$(cygpath -u "$(pwd)")
else
WORK_DIR=$(pwd)
fi

export PLAYWRIGHT_VERSION
export E2E_FLAG

docker compose --file "${project_root}/docker/docker-compose-e2e.yml" run --rm e2e
9 changes: 9 additions & 0 deletions docker/docker-compose-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
e2e:
image: mcr.microsoft.com/playwright:v${PLAYWRIGHT_VERSION}-jammy
working_dir: /work/
volumes:
- ${PWD}:/work/
ipc: host
network_mode: host
entrypoint: sh -c "corepack install && corepack enable && yarn test:e2e${E2E_FLAG}"

0 comments on commit 7433995

Please sign in to comment.