Skip to content

Commit

Permalink
fix: force ipv4
Browse files Browse the repository at this point in the history
  • Loading branch information
federicobadini committed Jun 28, 2023
1 parent 33de7e2 commit 07e6b5a
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-test-frontend/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs:
- name: Build Next.js
env:
NODE_ENV: test
NEXT_PUBLIC_STRAPI_ORIGIN: http://localhost:1337
NEXT_PUBLIC_STRAPI_ORIGIN: http://127.0.0.1:1337
ALGOLIA_API_KEY: ${{ inputs.ALGOLIA_API_KEY }}
run: cd frontend && pnpm build
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ jobs:
- name: Run Jest tests
run: pnpm test
env:
NEXT_PUBLIC_STRAPI_ORIGIN: http://localhost:1337
NEXT_PUBLIC_STRAPI_ORIGIN: http://127.0.0.1:1337
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Run Playwright Tests
env:
NODE_ENV: test
NEXT_PUBLIC_STRAPI_ORIGIN: http://localhost:1337
NEXT_PUBLIC_STRAPI_ORIGIN: http://127.0.0.1:1337
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
run: cd frontend && pnpm playwright:run --project="${{ matrix.project }}"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stress_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Run Playwright Tests
env:
NODE_ENV: test
NEXT_PUBLIC_STRAPI_ORIGIN: http://localhost:1337
NEXT_PUBLIC_STRAPI_ORIGIN: http://127.0.0.1:1337
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
run: cd frontend && pnpm playwright:run --project="${{ matrix.project }}" ${{ needs.check-diff.outputs.modified-playwright-tests }} --repeat-each=5

Expand Down Expand Up @@ -117,5 +117,5 @@ jobs:
- name: Run Jest tests
run: for i in {1..5}; do pnpm test -- ${{ needs.check-diff.outputs.modified-jest-tests }}; done
env:
NEXT_PUBLIC_STRAPI_ORIGIN: http://localhost:1337
NEXT_PUBLIC_STRAPI_ORIGIN: http://127.0.0.1:1337
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
4 changes: 2 additions & 2 deletions frontend/.env.development
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NEXT_PUBLIC_ALGOLIA_APP_ID=XQEP3AD9ZT
NEXT_PUBLIC_IFIXIT_ORIGIN=https://www.cominor.com
NEXT_PUBLIC_APP_ORIGIN=http://localhost:3000
NEXT_PUBLIC_STRAPI_ORIGIN=http://localhost:1337
NEXT_PUBLIC_APP_ORIGIN=http://127.0.0.1:3000
NEXT_PUBLIC_STRAPI_ORIGIN=http://127.0.0.1:1337
NEXT_PUBLIC_SHOPIFY_STOREFRONT_VERSION=2022-10
STRAPI_IMAGE_DOMAIN=ifixit-dev-strapi-uploads.s3.us-west-1.amazonaws.com
NEXT_PUBLIC_SENTRY_DSN=https://[email protected]/6475315
Expand Down
2 changes: 1 addition & 1 deletion frontend/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ NEXT_PUBLIC_ALGOLIA_APP_ID=XQEP3AD9ZT

# IFIXIT_ORIGIN should point to cominor in dev (e.g. use for iFixit PHP API)
NEXT_PUBLIC_IFIXIT_ORIGIN=https://www.cominor.com
# APP_ORIGIN should point to localhost:3000 in dev (e.g. use for Next.js API)
# APP_ORIGIN should point to 127.0.0.1:3000 in dev (e.g. use for Next.js API)
NEXT_PUBLIC_APP_ORIGIN=https://${VERCEL_URL}

# Overridden in prod
Expand Down
2 changes: 1 addition & 1 deletion frontend/.env.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NEXT_PUBLIC_ALGOLIA_APP_ID=XQEP3AD9ZT
NEXT_PUBLIC_IFIXIT_ORIGIN=https://www.cominor.com
NEXT_PUBLIC_APP_ORIGIN=http://localhost:3000
NEXT_PUBLIC_APP_ORIGIN=http://127.0.0.1:3000
NEXT_PUBLIC_STRAPI_ORIGIN=https://strapi.cominor.com
NEXT_PUBLIC_SHOPIFY_STOREFRONT_VERSION=2022-10
STRAPI_IMAGE_DOMAIN=ifixit-dev-strapi-uploads.s3.us-west-1.amazonaws.com
Expand Down
2 changes: 1 addition & 1 deletion frontend/codegen/strapi-schema-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const schemaConfig: CodegenConfig = {
overwrite: true,
generates: {
'lib/strapi-sdk/generated/schema.graphql': {
schema: 'http://localhost:1337/graphql',
schema: 'http://127.0.0.1:1337/graphql',
plugins: ['schema-ast'],
},
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const config: PlaywrightTestConfig = {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0,
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'http://localhost:3000',
baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
Expand Down
2 changes: 1 addition & 1 deletion frontend/tests/playwright/fixtures/custom-nextjs-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ loadEnvConfig('./', process.env.NODE_ENV !== 'production');
* running the tests.
*/
const isDev = process.env.NODE_ENV !== 'production' && process.env.CI == null;
const hostname = 'localhost';
const hostname = '127.0.0.1';

// Create Next.js instance
const app = next({ dev: isDev, hostname, quiet: true });
Expand Down
8 changes: 4 additions & 4 deletions frontend/tests/playwright/test-fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ export const test = base.extend<
},
],
productPage: async ({ page, baseURL }, use) => {
await use(new ProductPage(page, baseURL ?? 'http://localhost:3000'));
await use(new ProductPage(page, baseURL ?? 'http://127.0.0.1:3000'));
},
partsPage: async ({ page, baseURL }, use) => {
await use(new PartsPage(page, baseURL ?? 'http://localhost:3000'));
await use(new PartsPage(page, baseURL ?? 'http://127.0.0.1:3000'));
},
cartDrawer: async ({ page }, use) => {
await use(new CartDrawer(page));
Expand Down Expand Up @@ -97,8 +97,8 @@ export const test = base.extend<
*/
serverRequestInterceptor: [
async ({ customServer, productPage, partsPage }, use) => {
productPage.updateBaseURL(`http://localhost:${customServer.port}`);
partsPage.updateBaseURL(`http://localhost:${customServer.port}`);
productPage.updateBaseURL(`http://127.0.0.1:${customServer.port}`);
partsPage.updateBaseURL(`http://127.0.0.1:${customServer.port}`);
await use(customServer.serverRequestInterceptor);
},
{ scope: 'test' },
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"install:all": "export $(cat .env.local) && pnpm install && npm run install:backend",
"install:backend": "cd backend && yarn install:all",
"dev:backend": "cd backend && pnpm run dev",
"dev:frontend": "wait-on http://localhost:1337/_health && cd frontend && npm run dev",
"dev:frontend": "wait-on http://127.0.0.1:1337/_health && cd frontend && npm run dev",
"dev": "cross-env FORCE_COLOR=1 npm-run-all -l -p dev:*",
"build:backend": "cd backend && pnpm run build",
"build:frontend": "cd frontend && pnpm run build",
Expand Down

0 comments on commit 07e6b5a

Please sign in to comment.