Skip to content

Commit

Permalink
tests: separate e2e compose
Browse files Browse the repository at this point in the history
  • Loading branch information
wusteven815 committed Mar 20, 2024
1 parent 09c8eec commit 526eb37
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 30 deletions.
24 changes: 0 additions & 24 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ version: '3'

services:
deephaven-plugins:
container_name: deephaven-plugins
build:
dockerfile: ./Dockerfile
pull: true
Expand All @@ -15,26 +14,3 @@ services:
- ./tests/app.d:/app.d
environment:
- START_OPTS=-Xmx4g -DAuthHandlers=io.deephaven.auth.AnonymousAuthenticationHandler -Ddeephaven.console.type=python -Ddeephaven.application.dir=./app.d

e2e-tests:
build:
dockerfile: ./tests/Dockerfile
ports:
- '9323:9323'
ipc: host
volumes:
- ./tests:/work/tests
- ./test-results:/work/test-results
- ./playwright-report:/work/playwright-report
entrypoint: "npx playwright test --config=playwright-docker.config.ts"
depends_on:
deephaven-plugins:
condition: service_healthy

update-snapshots:
extends:
service: e2e-tests
entrypoint: 'npx playwright test --config=playwright-docker.config.ts --update-snapshots'
depends_on:
deephaven-plugins:
condition: service_healthy
4 changes: 2 additions & 2 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
# Dockerfile for updating the snapshots.
# Expects to be run from the root of the web-client-ui repo

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

Expand Down
39 changes: 39 additions & 0 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: '3'

services:
deephaven-plugins:
container_name: deephaven-plugins
build:
context: ../
dockerfile: ./Dockerfile
expose:
- 10000
volumes:
- ../docker/data/:/data
- ../tests/app.d:/app.d
environment:
- START_OPTS=-Xmx4g -DAuthHandlers=io.deephaven.auth.AnonymousAuthenticationHandler -Ddeephaven.console.type=python -Ddeephaven.application.dir=./app.d

e2e-tests:
build:
context: ../
dockerfile: ./tests/Dockerfile
ports:
- '9323:9323'
ipc: host
volumes:
- ../tests:/work/tests
- ../test-results:/work/test-results
- ../playwright-report:/work/playwright-report
entrypoint: "npx playwright test --config=playwright-docker.config.ts"
depends_on:
deephaven-plugins:
condition: service_healthy

update-snapshots:
extends:
service: e2e-tests
entrypoint: 'npx playwright test --config=playwright-docker.config.ts --update-snapshots'
depends_on:
deephaven-plugins:
condition: service_healthy
8 changes: 4 additions & 4 deletions tools/run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ pushd "$(dirname "$0")"

# Start the containers
if [[ -z "${CI}" ]]; then
docker compose run --service-ports --rm --build "$@"
docker compose -f ../tests/docker-compose.yml run --service-ports --rm --build "$@"
exit_code=$?
docker compose down
docker compose -f ../tests/docker-compose.yml down
else
docker compose run --service-ports --rm --build -e CI=true "$@"
docker compose -f ../tests/docker-compose.yml run --service-ports --rm --build -e CI=true "$@"
exit_code=$?
docker compose stop deephaven-plugins
docker compose -f ../tests/docker-compose.yml stop deephaven-plugins-e2e
fi

# Reset pwd
Expand Down

0 comments on commit 526eb37

Please sign in to comment.