From bd0ef6f01f6109c2e3b61949c47a771078c4e7bf Mon Sep 17 00:00:00 2001 From: "Xin Du (Clark)" Date: Wed, 27 Nov 2019 20:15:27 +0000 Subject: [PATCH] chore(ci): separate dev test and unit test (#6737) --- .circleci/config.yml | 12 +++++++++++- azure-pipelines.yml | 6 +++++- package.json | 5 +++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bd849addf8..d8b06cf01f 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -130,13 +130,21 @@ jobs: # -------------------------------------------------------------------------- # Phase 3: Unit and E2E tests # -------------------------------------------------------------------------- + test-dev: + executor: node + steps: + - attach-project + - run: + name: Dev Tests + command: yarn test:dev -w=2 + test-unit: executor: node steps: - attach-project - run: name: Unit Tests - command: yarn test:unit -w=2 --coverage && yarn coverage -F unit + command: yarn test:unit --coverage && yarn coverage -F unit environment: JEST_JUNIT_OUTPUT_NAME: unit.xml - store-test-results @@ -189,6 +197,7 @@ workflows: - audit: { requires: [setup] } - build: { requires: [setup] } - lint-app: { requires: [build] } + - test-dev: { requires: [build] } - test-unit: { requires: [build] } - test-e2e: { requires: [build] } - release-commit: @@ -204,6 +213,7 @@ workflows: - audit: { requires: [setup] } - build: { requires: [setup] } - lint-app: { requires: [build] } + - test-dev: { requires: [build] } - test-unit: { requires: [build] } - test-e2e: { requires: [build] } - release-nightly: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 48ae3dceec..f791239a5b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -24,7 +24,11 @@ steps: displayName: 'Test: Build Fixtures' - script: | - set JEST_JUNIT_OUTPUT_NAME=unit.xml && set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:unit -w=2 + set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:dev -w2 + displayName: 'Test: Run dev tests' + +- script: | + set JEST_JUNIT_OUTPUT_NAME=unit.xml && set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:unit displayName: 'Test: Run unit tests' - task: PublishTestResults@2 diff --git a/package.json b/package.json index 69e67931df..65810d10de 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,12 @@ "lint:app": "eslint-multiplexer eslint --ignore-path packages/vue-app/template/.eslintignore 'test/fixtures/!(missing-plugin)/.nuxt!(-dev)/**' | eslint-multiplexer -b", "nuxt": "node -r esm ./packages/cli/bin/nuxt-cli.js", "pkg": "node -r esm ./scripts/package", - "test": "yarn test:fixtures && yarn test:unit", + "test": "yarn test:fixtures && yarn test:dev && yarn test:unit", + "test:dev": "jest test/unit --forceExit", "test:e2e": "jest -i test/e2e --forceExit", "test:fixtures": "jest test/fixtures --forceExit", "test:lint": "yarn lint", - "test:unit": "jest test/unit packages --forceExit" + "test:unit": "jest packages --forceExit" }, "devDependencies": { "@babel/core": "^7.7.4",