From f3713250d67a8c43434d594987b3ff6f92c95dd1 Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Fri, 11 Aug 2023 13:13:19 -0300 Subject: [PATCH 1/4] fix: rename test name --- tests/build-without-next-and-check-health.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/build-without-next-and-check-health.test.ts b/tests/build-without-next-and-check-health.test.ts index 65dd122..a7f740d 100644 --- a/tests/build-without-next-and-check-health.test.ts +++ b/tests/build-without-next-and-check-health.test.ts @@ -3,7 +3,7 @@ import getPort from "get-port" import axios from "axios" import { getSampleProject } from "./fixtures/get-sample-project-without-next" -test("build and check health", async (t) => { +test("build without nextjs and check health", async (t) => { const {getNsmIndex} = await getSampleProject() const port = await getPort() const server = await getNsmIndex({ port }) From 0d0da2c7db2fef5d96a79f87779ce9ebccffcee4 Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Fri, 11 Aug 2023 14:13:06 -0300 Subject: [PATCH 2/4] increate timeout --- .github/workflows/npm-test.yml | 2 +- .../build-without-next-and-check-health.test.ts | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 tests/build-without-next-and-check-health.test.ts diff --git a/.github/workflows/npm-test.yml b/.github/workflows/npm-test.yml index 21765c0..9f206b8 100644 --- a/.github/workflows/npm-test.yml +++ b/.github/workflows/npm-test.yml @@ -19,4 +19,4 @@ jobs: - name: Typecheck run: npx tsc - name: Run NPM Test - run: yarn test -T 1m + run: yarn test -T 2m diff --git a/tests/build-without-next-and-check-health.test.ts b/tests/build-without-next-and-check-health.test.ts deleted file mode 100644 index a7f740d..0000000 --- a/tests/build-without-next-and-check-health.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import test from "ava" -import getPort from "get-port" -import axios from "axios" -import { getSampleProject } from "./fixtures/get-sample-project-without-next" - -test("build without nextjs and check health", async (t) => { - const {getNsmIndex} = await getSampleProject() - const port = await getPort() - const server = await getNsmIndex({ port }) - - const { data: res } = await axios.get(`http://localhost:${port}/api/health`) - - t.truthy(res.includes("healthy!")) - - server.close() -}) From 11819748ed59ad120afae793b19b589bf8adba8b Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Fri, 11 Aug 2023 14:16:45 -0300 Subject: [PATCH 3/4] increase timeout to 5m --- .github/workflows/npm-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npm-test.yml b/.github/workflows/npm-test.yml index 9f206b8..79ea6dc 100644 --- a/.github/workflows/npm-test.yml +++ b/.github/workflows/npm-test.yml @@ -19,4 +19,4 @@ jobs: - name: Typecheck run: npx tsc - name: Run NPM Test - run: yarn test -T 2m + run: yarn test -T 5m From b3dcb5f02c7c28b88d74c9ba2d3f1f13e07012da Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Fri, 11 Aug 2023 15:41:43 -0300 Subject: [PATCH 4/4] serial everything --- tests/build-and-check-health.test.ts | 2 +- tests/build-nextless-and-check-health.test.ts | 2 +- tests/dynamic-catchall.test.ts | 2 +- tests/no-rewrite-with-query.test.ts | 2 +- tests/resolve-rewrites.test.ts | 2 +- tests/streaming.test.ts | 2 +- tests/wait-for-server.test.ts | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/build-and-check-health.test.ts b/tests/build-and-check-health.test.ts index da8649a..d91a51c 100644 --- a/tests/build-and-check-health.test.ts +++ b/tests/build-and-check-health.test.ts @@ -3,7 +3,7 @@ import getPort from "get-port" import axios from "axios" import { getSampleProject } from "./fixtures/get-sample-project" -test("build and check health", async (t) => { +test.serial("build and check health", async (t) => { const {getNsmIndex} = await getSampleProject() const port = await getPort() const server = await getNsmIndex({ port }) diff --git a/tests/build-nextless-and-check-health.test.ts b/tests/build-nextless-and-check-health.test.ts index 65dd122..38c228c 100644 --- a/tests/build-nextless-and-check-health.test.ts +++ b/tests/build-nextless-and-check-health.test.ts @@ -3,7 +3,7 @@ import getPort from "get-port" import axios from "axios" import { getSampleProject } from "./fixtures/get-sample-project-without-next" -test("build and check health", async (t) => { +test.serial("build and check health", async (t) => { const {getNsmIndex} = await getSampleProject() const port = await getPort() const server = await getNsmIndex({ port }) diff --git a/tests/dynamic-catchall.test.ts b/tests/dynamic-catchall.test.ts index 659499e..516c1d1 100644 --- a/tests/dynamic-catchall.test.ts +++ b/tests/dynamic-catchall.test.ts @@ -3,7 +3,7 @@ import getPort from "get-port" import axios from "axios" import { getSampleProject } from "./fixtures/get-sample-project" -test("dynamic catchall path", async (t) => { +test.serial("dynamic catchall path", async (t) => { const {getNsmIndex} = await getSampleProject() const port = await getPort() diff --git a/tests/no-rewrite-with-query.test.ts b/tests/no-rewrite-with-query.test.ts index 16573fc..fedcceb 100644 --- a/tests/no-rewrite-with-query.test.ts +++ b/tests/no-rewrite-with-query.test.ts @@ -2,7 +2,7 @@ import test from "ava" import axios from "axios" import { getSampleProject } from "./fixtures/get-sample-project" -test("no rewrite with query", async (t) => { +test.serial("no rewrite with query", async (t) => { const {getServerFixture} = await getSampleProject() const {serverURL} = await getServerFixture(t) diff --git a/tests/resolve-rewrites.test.ts b/tests/resolve-rewrites.test.ts index 50ae725..600e8a1 100644 --- a/tests/resolve-rewrites.test.ts +++ b/tests/resolve-rewrites.test.ts @@ -2,7 +2,7 @@ import test from "ava" import { parseUrl } from "nsm/nextjs-middleware/parse-url" import resolveRewrites from "nsm/nextjs-middleware/resolve-rewrites" -test("resolve rewrites /health -> /api/health", async (t) => { +test.serial("resolve rewrites /health -> /api/health", async (t) => { const result = resolveRewrites( "/health", ["/api/health"], diff --git a/tests/streaming.test.ts b/tests/streaming.test.ts index a05b5bc..ece2d4c 100644 --- a/tests/streaming.test.ts +++ b/tests/streaming.test.ts @@ -1,7 +1,7 @@ import test from "ava" import { getSampleProject } from "./fixtures/get-sample-project" -test("streaming", async (t) => { +test.serial("streaming", async (t) => { const {getServerFixture} = await getSampleProject() const {axios} = await getServerFixture(t) diff --git a/tests/wait-for-server.test.ts b/tests/wait-for-server.test.ts index 1455021..a7f34f9 100644 --- a/tests/wait-for-server.test.ts +++ b/tests/wait-for-server.test.ts @@ -2,7 +2,7 @@ import test from "ava" import getPort from "get-port" import { getSampleProject } from "./fixtures/get-sample-project" -test("wait for server to start or throw", async (t) => { +test.serial("wait for server to start or throw", async (t) => { const { getNsmIndex } = await getSampleProject() const port = await getPort()