(core) bump mocha version to allow parallel tests; move more tests to core

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
This commit is contained in:
Paul Fitzpatrick
2023-06-27 02:11:08 -04:00
parent 7d3b4b49d5
commit bcbf57d590
126 changed files with 6833 additions and 759 deletions

View File

@@ -1,5 +1,3 @@
/* global describe, it */
var assert = require('chai').assert;
var sinon = require('sinon');
var Promise = require('bluebird');

View File

@@ -1,5 +1,3 @@
/* global describe, it, before */
const assert = require('chai').assert;
const ko = require('knockout');

View File

@@ -1,5 +1,3 @@
/* global describe, it */
var assert = require('chai').assert;
var ko = require('knockout');

View File

@@ -1,5 +1,3 @@
/* global describe, it, before, after */
var dispose = require('app/client/lib/dispose');
var bluebird = require('bluebird');
@@ -9,6 +7,8 @@ var sinon = require('sinon');
var clientUtil = require('../clientUtil');
var dom = require('app/client/lib/dom');
require('chai').config.truncateThreshold = 10000;
describe('dispose', function() {
clientUtil.setTmpMochaGlobals();
@@ -153,9 +153,12 @@ describe('dispose', function() {
assert.equal(baz.dispose.callCount, 1);
assert(baz.dispose.calledBefore(bar.dispose));
assert.deepEqual(consoleErrors[0], ['Error constructing %s:', 'Foo', 'Error: test-error1']);
assert.deepEqual(consoleErrors[1], ['Error constructing %s:', 'Foo', 'Error: test-error2']);
assert.deepEqual(consoleErrors[2], ['Error constructing %s:', 'Foo', 'Error: test-error3']);
const name = consoleErrors[0][1]; // may be Foo, or minified.
assert(name === 'Foo' || name === 'o'); // this may not be reliable,
// just what I happen to see.
assert.deepEqual(consoleErrors[0], ['Error constructing %s:', name, 'Error: test-error1']);
assert.deepEqual(consoleErrors[1], ['Error constructing %s:', name, 'Error: test-error2']);
assert.deepEqual(consoleErrors[2], ['Error constructing %s:', name, 'Error: test-error3']);
assert.equal(consoleErrors.length, 3);
});

View File

@@ -1,5 +1,3 @@
/* global describe, it, before, after */
var assert = require('chai').assert;
var sinon = require('sinon');
var Promise = require('bluebird');

View File

@@ -1,5 +1,3 @@
/* global describe, it */
var _ = require('underscore');
var assert = require('assert');
var ko = require('knockout');

View File

@@ -1,5 +1,3 @@
/* global describe, it */
var assert = require('assert');
var ko = require('knockout');
var sinon = require('sinon');

View File

@@ -4,8 +4,6 @@ const G = require('app/client/lib/browserGlobals').get('window', '$');
const sinon = require('sinon');
const assert = require('assert');
/* global describe, it, after, before, beforeEach */
describe("koDomScrolly", function() {
clientUtil.setTmpMochaGlobals();

View File

@@ -1,5 +1,3 @@
/* global describe, it */
var assert = require('chai').assert;
var ko = require('knockout');

View File

@@ -1,5 +1,3 @@
/* global describe, it */
var assert = require('assert');
var ko = require('knockout');
var sinon = require('sinon');