forked from gristlabs/grist-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(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
- Loading branch information
Showing
126 changed files
with
6,833 additions
and
759 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../node_modules/mocha/mocha.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../node_modules/mocha/mocha.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<base href="/v/gtag/"> | ||
<title>Grist Tests</title> | ||
<script src="jquery/dist/jquery.min.js"></script> | ||
<script src="plotly/plotly-latest.min.js"></script> | ||
<script src="./mocha.js"></script> | ||
<script>mocha.setup('bdd')</script> | ||
<script src="./test.bundle.js"></script> | ||
<script> | ||
onload = function() { | ||
$('#app-test').ready(function() { | ||
try { | ||
window.loadTests(); | ||
} catch (err) { | ||
console.log("ERROR", err); | ||
mocha.failedTests = []; | ||
mocha.failedTests.push({title: 'Failed to load', error: err.toString()}); | ||
document.getElementById('mocha-status').textContent = 'DONE - FAILED TO LOAD'; | ||
return; | ||
} | ||
|
||
mocha.checkLeaks(); | ||
// fxdriver_id is set by selenium, execWebdriverJQuery by webdriverjq.js. | ||
mocha.globals(['cmd', 'fxdriver_id', 'execWebdriverJQuery']); | ||
var runner = mocha.run(); | ||
mocha.failedTests = []; | ||
runner.on('fail', function(test, err) { | ||
mocha.failedTests.push({title: test.fullTitle(), error: err.toString()}); | ||
}); | ||
runner.on('end', function() { | ||
document.getElementById('mocha-status').textContent = runner.failures > 0 ? 'DONE - FAILURE :(' : 'DONE - SUCCESS :)'; | ||
}); | ||
}); | ||
}; | ||
|
||
function scrollToBottom() { | ||
var bottom = document.getElementById('mocha-end'); | ||
bottom.scrollIntoView(true); | ||
} | ||
|
||
afterEach(function() { | ||
// keep scrolled to the bottom | ||
return scrollToBottom(); | ||
}); | ||
|
||
after(function() { | ||
// keep scrolled to the bottom | ||
return scrollToBottom(); | ||
}); | ||
</script> | ||
|
||
<style> | ||
#mocha { | ||
width: 50%; | ||
} | ||
|
||
#app-test { | ||
position: fixed; | ||
margin: -8px; | ||
width: 40%; | ||
height: 80%; | ||
top: 20%; | ||
left: 60%; | ||
} | ||
|
||
#mocha-status { | ||
position: fixed; | ||
bottom: 0px; | ||
padding: 1rem; | ||
border: 2px solid #cc9; | ||
font-family: Helvetica, Arial, sans-serif; | ||
} | ||
|
||
/* mostly match #mocha-stats class */ | ||
.extra-info { | ||
position: fixed; | ||
top: 60px; | ||
right: 10px; | ||
font-size: 12px; | ||
color: #888; | ||
z-index: 1; | ||
} | ||
|
||
</style> | ||
|
||
<link rel="stylesheet" href="./mocha.css"> | ||
</head> | ||
|
||
<body> | ||
<div id="mocha"> | ||
<div class="extra-info"> | ||
<a href="/test.html?timing=1">Run tests with timings</a> | ||
</div> | ||
</div> | ||
<div id="mocha-end"> </div> | ||
<div id="mocha-status">TBD - RUNNING...</div> | ||
</body> | ||
|
||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<base href="/v/gtag/"> | ||
<title>WebdriverJQuery test</title> | ||
<script src="jquery/dist/jquery.min.js"></script> | ||
</head> | ||
|
||
<body> | ||
<div class="foo bar"> | ||
<span class="baz"> | ||
Hello world | ||
</span> | ||
</div> | ||
<div class="bar"> | ||
<span class="baz"> | ||
Good bye | ||
<input id="btn" type="button" value="Go" onclick="this.value += 'o'"> | ||
</span> | ||
</div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* global window */ | ||
window.loadTests = function() { | ||
require('test/common/BinaryIndexedTree'); | ||
require('test/common/CircularArray'); | ||
require('test/common/MemBuffer'); | ||
require('test/common/arraySplice'); | ||
require('test/common/gutil'); | ||
require('test/common/marshal'); | ||
require('test/common/promises'); | ||
require('test/common/serializeTiming'); | ||
require('test/common/timeFormat'); | ||
require('test/common/ValueFormatter'); | ||
require('test/common/InactivityTimer'); | ||
|
||
require('test/client/clientUtil'); | ||
require('test/client/components/Layout'); | ||
require('test/client/components/commands'); | ||
require('test/client/components/sampleLayout'); | ||
require('test/client/lib/ObservableMap'); | ||
require('test/client/lib/ObservableSet'); | ||
require('test/client/lib/dispose'); | ||
require('test/client/lib/dom'); | ||
require('test/client/lib/koArray'); | ||
require('test/client/lib/koDom'); | ||
require('test/client/lib/koForm'); | ||
require('test/client/lib/koUtil'); | ||
require('test/client/models/modelUtil'); | ||
require('test/client/models/rowset'); | ||
require('test/client/lib/localStorageObs'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
/* global describe, it, before */ | ||
|
||
const assert = require('chai').assert; | ||
const ko = require('knockout'); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
/* global describe, it */ | ||
|
||
var assert = require('chai').assert; | ||
var ko = require('knockout'); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
/* global describe, it */ | ||
|
||
var assert = require('chai').assert; | ||
var ko = require('knockout'); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
/* global describe, it */ | ||
|
||
var assert = require('assert'); | ||
var ko = require('knockout'); | ||
|
||
|
Oops, something went wrong.