chore(ci): separate dev test and unit test (#6737)

This commit is contained in:
Xin Du (Clark) 2019-11-27 20:15:27 +00:00 committed by GitHub
parent 75a29c8b13
commit bd0ef6f01f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 4 deletions

View File

@ -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:

View File

@ -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

View File

@ -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",