mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
bcbf57d590
Summary: This uses a newer version of mocha in grist-core so that tests can be run in parallel. That allows more tests to be moved without slowing things down overall. Tests moved are venerable browser tests; only the ones that "just work" or worked without too much trouble to are moved, in order to keep the diff from growing too large. Will wrestle with more in follow up. Parallelism is at the file level, rather than the individual test. The newer version of mocha isn't needed for grist-saas repo; tests are parallelized in our internal CI by other means. I've chosen to allocate files to workers in a cruder way than our internal CI, based on initial characters rather than an automated process. The automated process would need some reworking to be compatible with mocha running in parallel mode. Test Plan: this diff was tested first on grist-core, then ported to grist-saas so saas repo history will correctly track history of moved files. Reviewers: jarek Reviewed By: jarek Subscribers: jarek Differential Revision: https://phab.getgrist.com/D3927
18 lines
683 B
JavaScript
18 lines
683 B
JavaScript
// enhance require() to support project paths and typescript.
|
|
const path = require('path');
|
|
const appModulePath = require('app-module-path');
|
|
// Root path can be complicated, pwd is more reliable for tests.
|
|
const root = process.cwd();
|
|
const nodePath = (process.env.NODE_PATH || '').split(path.delimiter);
|
|
const paths = [path.join(root, "_build"),
|
|
path.join(root, "_build/core"),
|
|
path.join(root, "_build/ext"),
|
|
path.join(root, "_build/stubs")];
|
|
for (const p of paths) {
|
|
appModulePath.addPath(p);
|
|
}
|
|
// add to path for any subprocesses also
|
|
process.env.NODE_PATH = [...nodePath, ...paths]
|
|
.filter(p => p !== '')
|
|
.join(path.delimiter);
|