Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui-e2e-tests: steps to enable cypress tests #107212

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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