From 3105ee1eac8b697866518faf05983164cd9c4513 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 13 Mar 2023 14:16:28 -0400 Subject: [PATCH 1/3] Run Tests sequentially One possible solution to tests timing out on CI https://jestjs.io/docs/troubleshooting#tests-are-extremely-slow-on-docker-and-or-continuous-integration-ci-server --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 75646fa58..195c83454 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "lint:dry": "eslint **/*.{js,jsx}", "circleci": "npm test && eslint **/*.{js,jsx} --max-warnings=0", "verify": "npm run lint && npm test", - "test": "jest", + "test": "jest --runInBand", "test:api-unit": "jest server/*.spec.js --verbose", "test:coverage": "jest --coverage --silent", "test:dev": "jest --verbose --watch", From 0a09cd9c674a9cb82d8d7541f6f0ef0b02108255 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 13 Mar 2023 14:34:48 -0400 Subject: [PATCH 2/3] Don't test in parallel, raise timeout --- .circleci/config.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3c48e7d34..780e20b98 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,7 +48,7 @@ jobs: - image: cimg/node:16.11.0 working_directory: ~/homebrewery - parallelism: 4 + parallelism: 1 steps: - attach_workspace: diff --git a/package.json b/package.json index 195c83454..147dbcbdc 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "build/*" ], "jest": { - "testTimeout": 15000, + "testTimeout": 30000, "modulePaths": [ "node_modules", "shared", From f148014a93ca71e76cdf0bf9379774b597d6a452 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 13 Mar 2023 14:48:10 -0400 Subject: [PATCH 3/3] Make coverage command run in sequence too --- .circleci/config.yml | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 780e20b98..3049a872a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,15 +61,15 @@ jobs: - run: name: Test - Basic command: npm run test:basic - - run: - name: Test - Coverage - command: npm run test:coverage - run: name: Test - Mustache Spans command: npm run test:mustache-span - run: name: Test - Routes command: npm run test:route + - run: + name: Test - Coverage + command: npm run test:coverage workflows: build_and_test: diff --git a/package.json b/package.json index 147dbcbdc..8ab17fa08 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "verify": "npm run lint && npm test", "test": "jest --runInBand", "test:api-unit": "jest server/*.spec.js --verbose", - "test:coverage": "jest --coverage --silent", + "test:coverage": "jest --coverage --silent --runInBand", "test:dev": "jest --verbose --watch", "test:basic": "jest tests/markdown/basic.test.js --verbose", "test:mustache-span": "jest tests/markdown/mustache-span.test.js --verbose",