Skip to content

Commit

Permalink
CI: Overhaul for speed 🚀 (#27180)
Browse files Browse the repository at this point in the history
* Use a parallel CI workflow

* Restructure CI config with references

* Inline CircleCI test runners

* Report eslint results

* Use js for jest config

* Persist Jest caches between builds

* Better git caching

* Cache node_modules

* Reenable tests and further split

* Run integration nightly

* Remove CI splitting for non-parallel jobs

* Test results by directory not filename

* Try timings again with cache-bust

* Add 2m timeout to Jest

I've observed a hung test suite that waited the default
10 minutes. Let's ensure that doesn't happen again.

* Add docs describing the cache mechanisms

* Replace CircleCI v1 notify with explicit curl
  • Loading branch information
sirreal committed Sep 25, 2018
1 parent eb1ac52 commit 41c8555
Show file tree
Hide file tree
Showing 14 changed files with 393 additions and 194 deletions.
403 changes: 326 additions & 77 deletions .circleci/config.yml

Large diffs are not rendered by default.

14 changes: 0 additions & 14 deletions bin/run-integration

This file was deleted.

9 changes: 3 additions & 6 deletions package.json
Expand Up @@ -253,16 +253,13 @@
"pretest": "npm run -s install-if-deps-outdated",
"test": "run-s -s test-client test-server",
"pretest-client": "npm run -s pretest",
"test-client": "jest -c=test/client/jest.config.json",
"test-client:ci": "cross-env-shell JEST_JUNIT_OUTPUT=./test-results-client.xml jest -c=test/client/jest.config.ci.js -w=2",
"test-client": "jest -c=test/client/jest.config.js",
"test-client:watch": "npm run -s test-client -- --watch",
"pretest-integration": "npm run -s pretest",
"test-integration": "jest -c=test/integration/jest.config.json",
"test-integration:ci": "cross-env-shell JEST_JUNIT_OUTPUT=./test-results-integration.xml jest -c=test/integration/jest.config.ci.js -w=2",
"test-integration": "jest -c=test/integration/jest.config.js",
"test-integration:watch": "npm run -s test-integration -- --watch",
"pretest-server": "npm run -s pretest",
"test-server": "jest -c=test/server/jest.config.json",
"test-server:ci": "cross-env-shell JEST_JUNIT_OUTPUT=./test-results-server.xml jest -c=test/server/jest.config.ci.js -w=2",
"test-server": "jest -c=test/server/jest.config.js",
"test-server:coverage": "npm run -s test-server -- --coverage",
"test-server:watch": "npm run -s test-server -- --watch",
"translate": "i18n-calypso --format pot --output-file ./calypso-strings.pot -e date \"**/*.js\" \"**/*.jsx\" \"!build/**\" \"!node_modules/**\" \"!public/**\"",
Expand Down
11 changes: 0 additions & 11 deletions test/client/jest.config.ci.js

This file was deleted.

23 changes: 23 additions & 0 deletions test/client/jest.config.js
@@ -0,0 +1,23 @@
/** @format */

module.exports = {
moduleNameMapper: {
'^config$': '<rootDir>/server/config/index.js',
},
transform: {
'^.+\\.jsx?$': 'babel-jest',
'\\.(svg|(sc|sa|c)ss)$': '<rootDir>/test/test/helpers/assets/transform.js',
},
modulePaths: [ '<rootDir>/test/', '<rootDir>/client/', '<rootDir>/client/extensions/' ],
rootDir: './../../',
roots: [ '<rootDir>/client/' ],
testEnvironment: 'node',
transformIgnorePatterns: [ 'node_modules[\\/\\\\](?!flag-icon-css|redux-form)' ],
testMatch: [ '<rootDir>/client/**/test/*.js?(x)' ],
testURL: 'https://example.com',
setupTestFrameworkScriptFile: '<rootDir>/test/client/setup-test-framework.js',
verbose: false,
globals: {
google: {},
},
};
21 changes: 0 additions & 21 deletions test/client/jest.config.json

This file was deleted.

5 changes: 1 addition & 4 deletions test/client/setup-test-framework.js
@@ -1,7 +1,4 @@
/**
* @format
*/

/** @format */
/**
* External dependencies
*/
Expand Down
11 changes: 0 additions & 11 deletions test/integration/jest.config.ci.js

This file was deleted.

19 changes: 19 additions & 0 deletions test/integration/jest.config.js
@@ -0,0 +1,19 @@
/** @format */

module.exports = {
modulePaths: [
'<rootDir>/test/',
'<rootDir>/server/',
'<rootDir>/client/',
'<rootDir>/client/extensions/',
],
rootDir: './../../',
testEnvironment: 'node',
testMatch: [
'<rootDir>/bin/**/integration/*.js',
'<rootDir>/client/**/integration/*.js',
'<rootDir>/server/**/integration/*.js',
'<rootDir>/test/test/helpers/**/integration/*.js',
],
verbose: false,
};
17 changes: 0 additions & 17 deletions test/integration/jest.config.json

This file was deleted.

11 changes: 0 additions & 11 deletions test/server/jest.config.ci.js

This file was deleted.

20 changes: 20 additions & 0 deletions test/server/jest.config.js
@@ -0,0 +1,20 @@
/** @format */

module.exports = {
collectCoverageFrom: [ 'server/**/*.js?(x)' ],
coveragePathIgnorePatterns: [ '<rootDir>/server/devdocs/search-index.js' ],
modulePaths: [
'<rootDir>/test/',
'<rootDir>/server/',
'<rootDir>/client/',
'<rootDir>/client/extensions/',
],
rootDir: './../../',
roots: [ '<rootDir>/server/' ],
testEnvironment: 'node',
transformIgnorePatterns: [ 'node_modules[\\/\\\\](?!redux-form)' ],
testMatch: [ '<rootDir>/server/**/test/*.js?(x)' ],
timers: 'fake',
setupTestFrameworkScriptFile: '<rootDir>/test/server/setup-test-framework.js',
verbose: false,
};
22 changes: 0 additions & 22 deletions test/server/jest.config.json

This file was deleted.

1 change: 1 addition & 0 deletions test/server/setup-test-framework.js
@@ -1,3 +1,4 @@
/** @format */
/**
* External dependencies
*/
Expand Down

0 comments on commit 41c8555

Please sign in to comment.