Faster tests, split everywhere: one sharded CI for pushes and releases
- The harness builds the DOM without the page's 2 MB of script text and runs the scripts straight in the window: a page load in tests takes about half the time (jsdom's parser was slow on the script text). - That also took the game's source out of the DOM, which showed three tests that matched a phrase in the page source rather than the screen; they now check the panel, the routing window and the dictionary. - CI plans its split once and runs the tests on 6 runners; every run on main records each file's time and caches it, so the parts stay even without anyone refreshing tests/durations.json. - auto-release.yml and release.yml call the same sharded tests instead of running all 170 files on one runner each (11 and 15 min); a release is tested once, before it is tagged. - Audit: five tests that duplicated a gameplay rule or checked nothing are gone; the two slowest checks sample a third of the cities, and a year of play to reach one due date became a moved due date.
This commit is contained in:
parent
7a6eb29013
commit
0342d90657
17 changed files with 244 additions and 109 deletions
|
|
@ -105,14 +105,3 @@ test('old saves with inbox, max-prefix and Large Peering Model state load and pl
|
|||
assert.equal(ev('__o.pdeskRep'), null);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('max-prefix incidents can no longer fire', () => {
|
||||
const { ev, errors } = load();
|
||||
setup(ev);
|
||||
assert.equal(ev("failureRun.toString().includes('maxpfx')"), false);
|
||||
ev("S.day=100;const src=failureRun.toString().replace(/^function\* failureRun/,'function*').replace('let tot=opts.reduce',\"opts.splice(0,opts.length,['funny',1]);let tot=opts.reduce\");window.__ff=eval('('+src+')')");
|
||||
ev("__reseed(7);for(let i=0;i<200;i++){runNow(__ff());S.inc=S.inc.filter(x=>x.type!=='maxpfx'||(window.__mp=1,0));}");
|
||||
assert.equal(ev('!!window.__mp'), false);
|
||||
assert.equal(ev("typeof inboxDay+typeof ibx+typeof ACT.inboxRaiseAll+typeof ACT.inboxBot"), 'undefinedundefinedundefinedundefined');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue