Skip to content

Commit

Permalink
ui-e2e-tests: steps to enable cypress tests
Browse files Browse the repository at this point in the history
This doesn't get the job fully working yet, but it's an improvement.

Epic: none
Part of cockroachdb#106584
Release note: None
  • Loading branch information
rickystewart committed Jul 20, 2023
1 parent 98cd2f0 commit 3892520
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
3 changes: 3 additions & 0 deletions pkg/ui/workspaces/e2e-tests/Dockerfile.cypress
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
RUN curl -fsSL https://get.pnpm.io/install.sh | env SHELL=bash PNPM_HOME=/usr/local/bin PNPM_VERSION=8.5.1 sh -
RUN pnpm --version
8 changes: 4 additions & 4 deletions pkg/ui/workspaces/e2e-tests/build/compose-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ set -uemo pipefail

set -x

# Copy the /e2e tree into /scratch and remove any existing node_modules, to
# Copy the /ui tree into /scratch and remove any existing node_modules, to
# prevent files with unexpected owners from escaping
mkdir /scratch
cp --recursive --no-target-directory --no-preserve=owner /e2e /scratch
cp --recursive --no-target-directory --no-preserve=owner /ui /scratch
cd /scratch

# Remove and reinstall any node_modules that may have been copied, since they're
# potentially specific to the host platform.
rm -rf node_modules/
pnpm install --filter . --force --frozen-lockfile
pnpm install --filter workspaces/e2e-tests --force --frozen-lockfile

# Run tests, passing extra CLI arguments through to Cypress
pnpm run cy:run "$@"
pnpm run -C ./workspaces/e2e-tests cy:run "$@"
11 changes: 7 additions & 4 deletions pkg/ui/workspaces/e2e-tests/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ services:
COCKROACH_DATABASE: movr

cypress:
image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
working_dir: /e2e
entrypoint: ./build/compose-entrypoint.sh
build:
context: .
dockerfile: Dockerfile.cypress
image: crdb_ci-cypress_20230719
working_dir: /ui
entrypoint: ./workspaces/e2e-tests/build/compose-entrypoint.sh
environment:
IS_DOCKER: "1"
depends_on:
Expand All @@ -29,7 +32,7 @@ services:
networks:
- db
volumes:
- ./:/e2e
- ../../:/ui
- ./artifacts:/artifacts

networks:
Expand Down

0 comments on commit 3892520

Please sign in to comment.