Skip to content

Commit

Permalink
fixup! fixup! fixup! front: switch from yarn to npm
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohh committed Nov 21, 2024
1 parent e715a27 commit d622b9c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 26 deletions.
4 changes: 2 additions & 2 deletions front/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Launches end to end tests.

It requires:

- Install playwright dependencies `cd ./front/ && yarn playwright install --with-deps`
- Install playwright dependencies `cd ./front/ && npx playwright install --with-deps`
- Backend containers to be up:
`docker compose up --no-build --detach valkey postgres gateway core editoast`
- Running front with `docker compose up --build --detach front`
Expand All @@ -48,7 +48,7 @@ Now you can run the test with `cd front/ && npm run e2e-tests`.
If you are using a Linux distribution not supported by playwright (which only supports Windows,
macOS and Ubuntu/Debian), you can instead start the tests inside a docker container using
`osrd/scripts/run-front-playwright-container.sh`. You may pass the same options and arguments to
this script as you would to `yarn e2e-tests` or `yarn playwright test`.
this script as you would to `npm run e2e-tests` or `npx playwright test`.

> [!CAUTION] If you try to run `npm run start` instead of running it through docker, you'll notice
> it doesn't work because the gateway can't access your local port from inside a container. 2
Expand Down
26 changes: 4 additions & 22 deletions front/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions scripts/run-front-playwright-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if ! command -v jq &> /dev/null; then
exit 1
fi
cd front
VERSION=$(yarn list --pattern playwright --json | jq -r '.data.trees[].name | split("@")[-1]' | sort -u)
VERSION=$(npm list --pattern playwright --json | jq -r '.dependencies["@playwright/test"].version' | sort -u)
if [ "$(echo "$VERSION" | wc -l)" -ne 1 ]; then
echo "Error: Zero or multiple playwright versions found: $VERSION" >&2
exit 1
Expand Down Expand Up @@ -40,4 +40,4 @@ docker run -it --rm \
-v "$PWD/front/playwright-report:/app/front/playwright-report" \
-v "$PWD/front/test-results:/app/front/test-results" \
-u "$(stat -c %u:%g .)" \
osrd-playwright:latest yarn playwright test "${args[@]}"
osrd-playwright:latest npx playwright test "${args[@]}"

0 comments on commit d622b9c

Please sign in to comment.