Skip to content

Commit

Permalink
Ensure docker container can access host's localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
louise-davies committed Jun 19, 2024
1 parent 38a3922 commit 35005b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,6 @@ jobs:
run: nohup poetry run python -m operationsgateway_api.src.main > api-output.txt &
working-directory: ./operationsgateway-api

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3

- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4
with:
node-version: 20
Expand All @@ -216,6 +213,9 @@ jobs:
- name: Install dependencies
run: yarn --immutable

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3

- name: Run playwright tests
run: yarn playwright:test:real

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"test": "craco test --env=jsdom --coverage --watchAll=false",
"test:watch": "craco test --env=jsdom --watch",
"playwright:test:mocked": "docker run -v $PWD:/test -w=/test $(node -e \"if(process.env.CI !== 'true'){console.log('-it -u pwuser')}else{console.log('-e CI')}\") --rm --ipc=host -p 9323:9323 --add-host host.docker.internal:host-gateway mcr.microsoft.com/playwright:v$(yarn info @playwright/test --name-only --json | sed -n 's/^.*:\\(.*\\)\"$/\\1/p') yarn playwright test",
"playwright:test:real": "docker run -v $PWD:/test -w=/test -e \"USE_REAL_API=true\" $(node -e \"if(process.env.CI !== 'true'){console.log('-it -u pwuser')}else{console.log('-e CI')}\") --rm --ipc=host -p 9323:9323 --add-host host.docker.internal:host-gateway mcr.microsoft.com/playwright:v$(yarn info @playwright/test --name-only --json | sed -n 's/^.*:\\(.*\\)\"$/\\1/p') yarn playwright test",
"playwright:test:real": "docker run -v $PWD:/test -w=/test -e \"USE_REAL_API=true\" $(node -e \"if(process.env.CI !== 'true'){console.log('-it -u pwuser')}else{console.log('-e CI')}\") --rm --ipc=host -p 9323:9323 -p 8000:8000 --add-host host.docker.internal:host-gateway mcr.microsoft.com/playwright:v$(yarn info @playwright/test --name-only --json | sed -n 's/^.*:\\(.*\\)\"$/\\1/p') yarn playwright test",
"eject": "react-scripts eject",
"build:e2e": "cross-env REACT_APP_E2E_TESTING=true GENERATE_SOURCEMAP=false craco build",
"e2e-test-server": "node ./server/e2e-test-server.js",
Expand Down
2 changes: 1 addition & 1 deletion server/e2e-settings-real.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"apiUrl": "http://localhost:8000",
"apiUrl": "http://host.docker.internal:8000",
"recordLimitWarning": -1,
"routes": [
{
Expand Down

0 comments on commit 35005b8

Please sign in to comment.