Compare commits

...

4 Commits

Author SHA1 Message Date
eps1lon 397e5ef1b6
REVERT LATER debug yarn install
or should this stay?
2023-02-11 18:29:50 +01:00
eps1lon 3638769e49
ff 2023-02-11 17:59:34 +01:00
eps1lon b3db2b0695
Describe steps how to reproduce CI Playwright locally 2023-02-11 17:29:39 +01:00
eps1lon 92e668940a
Use Playwright Docker image in CI 2023-02-11 17:29:05 +01:00
5 changed files with 57 additions and 8 deletions

View File

@ -49,9 +49,9 @@ commands:
- run:
name: Install dependencies
command: |
yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
yarn install --verbose --frozen-lockfile --cache-folder ~/.cache/yarn
if [ $? -ne 0 ]; then
yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
yarn install --verbose --frozen-lockfile --cache-folder ~/.cache/yarn
fi
- save_cache:
name: Save yarn cache
@ -215,18 +215,15 @@ jobs:
path: ./build/devtools.tgz
run_devtools_e2e_tests:
docker: *docker
docker:
# Make sure used Dockerfiles in this repository reference the same version
- image: mcr.microsoft.com/playwright:v1.16.0-focal
environment: *environment
steps:
- checkout
- attach_workspace:
at: .
- setup_node_modules
- run:
name: Playwright install deps
command: |
npx playwright install
sudo npx playwright install-deps
- run:
environment:
RELEASE_CHANNEL: experimental

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
node_modules/
build/

View File

@ -0,0 +1,6 @@
FROM mcr.microsoft.com/playwright:v1.16.0-focal
RUN mkdir -p /tmp/react
COPY . /tmp/react
WORKDIR /tmp/react
RUN yarn
WORKDIR /tmp/react/packages/react-devtools-inline

View File

@ -363,3 +363,38 @@ yarn start
```
To test package changes, refer to the [`react-devtools-shell` README](https://github.com/facebook/react/blob/main/packages/react-devtools-shell/README.md).
## Running e2e tests
### Prerequisites
1. Chrome installed locally (run `npx playwright install chrome --with-deps`)
1. Running build (`yarn start`)
### Running
```sh
`yarn test:e2e`
```
This will use your local installation of Chrome.
To use the same version as CI, you need to [have Docker installed](https://docs.docker.com/get-docker/).
```sh
$ docker compose -f packages/react-devtools-inline/docker-compose.yml up --detach
$ docker exec react-devtools-e2e-test-runner yarn test:e2e
```
WARNING: If you change the test code after you created the Docker container, you need to either copy the tests to the running container (fast but dangerous):
```sh
# assuming you're in the repository root
$ docker cp packages/react-devtools-inline/__tests__ react-devtools-e2e-test-runner:/tmp/react/packages/react-devtools-inline/
```
or rebuild the container entirely (slow but safe):
```sh
docker compose -f packages/react-devtools-inline/docker-compose.yml up --build --detach
```

View File

@ -0,0 +1,9 @@
version: '3.3'
services:
test-runner:
build:
context: ../../
dockerfile: ./packages/react-devtools-inline/Dockerfile
container_name: "react-devtools-e2e-test-runner"
network_mode: "host"
tty: true