diff --git a/.travis.yml b/.travis.yml index fb7677098..184cf5ee2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,45 +26,27 @@ matrix: stage: basic - os: linux node_js: "10" - env: NO_WATCH_TESTS=1 JOB_PART=lint + env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=lint-unit stage: advanced - os: linux node_js: "10" - env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration1 - stage: advanced - - os: linux - node_js: "10" - env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration2 - stage: advanced - - os: linux - node_js: "10" - env: NO_WATCH_TESTS=1 JOB_PART=unit + env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration stage: advanced - os: osx node_js: "10" - env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration1 - stage: versions - - os: osx - node_js: "10" - env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration2 + env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration stage: versions - os: linux node_js: "8" - env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration1 - stage: versions - - os: linux - node_js: "8" - env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration2 + env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration stage: versions - os: linux node_js: "6" - env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration1 - stage: versions - - os: linux - node_js: "6" - env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration2 + env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration stage: versions fast_finish: true + allow_failures: + - os: osx install: - yarn --frozen-lockfile @@ -76,7 +58,7 @@ script: yarn travis:$JOB_PART after_success: - cat ./coverage/lcov.info | node_modules/.bin/coveralls --verbose - bash <(curl -s https://codecov.io/bash) -F $JOB_PART -X gcov - - rm -rf ./coverage + - rm -f .jest-cache/haste-map* .jest-cache/perf-cache* notifications: slack: diff --git a/appveyor.yml b/appveyor.yml index dd1cc0f9e..bd61e1135 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,30 +9,28 @@ branches: init: - git config --global core.autocrlf input +cache: + - "..\\.yarn-cache" + - ".jest-cache" + # what combinations to test environment: matrix: - - nodejs_version: 8 + - nodejs_version: 10 job_part: unit - - nodejs_version: 8 - job_part: integration1 - jest: --maxWorkers=2 - - nodejs_version: 8 - job_part: integration2 - jest: --maxWorkers=2 + jest: --maxWorkers=2 --cacheDirectory .jest-cache + - nodejs_version: 10 + job_part: integration + jest: --maxWorkers=2 --cacheDirectory .jest-cache - nodejs_version: 6 - job_part: integration1 - jest: --maxWorkers=2 - - nodejs_version: 6 - job_part: integration2 - jest: --maxWorkers=2 + job_part: integration + jest: --maxWorkers=2 --cacheDirectory .jest-cache install: - ps: Install-Product node $env:nodejs_version x64 - - npm install yarn -g - - yarn install --frozen-lockfile - - yarn link --frozen-lockfile || yarn link --frozen-lockfile - - yarn link webpack --frozen-lockfile + - yarn --frozen-lockfile --preferred-cache-folder ..\\.yarn-cache + - yarn link --frozen-lockfile --preferred-cache-folder ..\\.yarn-cache || yarn link --frozen-lockfile --preferred-cache-folder ..\\.yarn-cache + - yarn link webpack --frozen-lockfile --preferred-cache-folder ..\\.yarn-cache build: off @@ -44,5 +42,7 @@ test_script: - yarn --version - cmd: set JEST=%jest% - cmd: yarn appveyor:%job_part% + - cmd: yarn istanbul report --report lcovonly - cmd: yarn unlink webpack - cmd: yarn global add codecov && codecov -F %job_part% --disable=gcov + - cmd: del /F /Q .jest-cache\\haste-map* .jest-cache\\perf-cache* 2> null || Ver > null diff --git a/package.json b/package.json index c2fc85090..ab8cc8eec 100644 --- a/package.json +++ b/package.json @@ -102,15 +102,12 @@ "test:integration": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/*.test.js\"", "test:basic": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/{TestCasesNormal,StatsTestCases,ConfigTestCases}.test.js\"", "test:unit": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/*.unittest.js\"", - "travis:integration1": "yarn cover:init && yarn cover:integration \"test/((?!TestCases)|TestCasesD)\" --ci $JEST && yarn cover:report-min", - "travis:integration2": "yarn cover:init && yarn cover:integration \"test/TestCases(?!D)\" --ci $JEST && yarn cover:report-min", + "travis:integration": "yarn cover:init && yarn cover:integration \"test/((?!TestCases)|TestCasesD)\" --ci $JEST && mv coverage/coverage-final.json coverage/coverage-final-1.json && yarn cover:integration \"test/TestCases(?!D)\" --ci $JEST && mv coverage/coverage-final.json coverage/coverage-final-2.json", "travis:basic": "yarn test:basic --ci $JEST", - "travis:unit": "yarn cover:init && yarn cover:unit --ci", - "travis:lint": "yarn lint", + "travis:lint-unit": "yarn lint && yarn cover:init && yarn cover:unit --ci $JEST", "travis:benchmark": "yarn benchmark --ci", - "appveyor:integration1": "yarn cover:init && yarn cover:integration \"test/((?!TestCases)|TestCasesD)\" --ci %JEST% && yarn cover:report-min", - "appveyor:integration2": "yarn cover:init && yarn cover:integration \"test/TestCases(?!D)\" --ci %JEST% && yarn cover:report-min", - "appveyor:unit": "yarn cover:init && yarn cover:unit --ci && yarn cover:report-min", + "appveyor:integration": "yarn cover:init && yarn cover:integration \"test/((?!TestCases)|TestCasesD)\" --ci %JEST% && move coverage\\coverage-final.json coverage\\coverage-final-1.json && yarn cover:integration \"test/TestCases(?!D)\" --ci %JEST% && move coverage\\coverage-final.json coverage\\coverage-final-2.json", + "appveyor:unit": "yarn cover:init && yarn cover:unit --ci %JEST%", "appveyor:benchmark": "yarn benchmark --ci", "circleci:test": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --ci", "circleci:lint": "yarn lint", @@ -129,8 +126,7 @@ "cover:all": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --coverage", "cover:integration": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --testMatch \"/test/*.test.js\" --coverage", "cover:unit": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --testMatch \"/test/*.unittest.js\" --coverage", - "cover:report": "istanbul report", - "cover:report-min": "istanbul report --report lcovonly" + "cover:report": "istanbul report" }, "jest": { "forceExit": true, @@ -147,7 +143,8 @@ "/test/fixtures/temp-", "/benchmark/", "/examples/*/dist", - "/coverage/" + "/coverage/", + "/.eslintcache/" ], "modulePathIgnorePatterns": [ "/node_modules/webpack/node_modules/", @@ -157,7 +154,8 @@ "/test/fixtures/temp-", "/benchmark/", "/examples/*/dist", - "/coverage/" + "/coverage/", + "/.eslintcache/" ], "transformIgnorePatterns": [ "/"