Skip to content

Commit

Permalink
restore Ava-XS runner and disable tests that broke while it was off (#…
Browse files Browse the repository at this point in the history
…5501)

* fix: avaXS SES_ALREADY_LOCKED_DOWN

* ci: ava-xs ignore unsupported tests

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
turadg and mergify[bot] committed Jun 4, 2022
1 parent fcfa293 commit c6db041
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 5 deletions.
8 changes: 7 additions & 1 deletion packages/ERTP/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@
"exported.js"
],
"ava-xs": {
"exclude": "swingsetTests"
"exclude": [
"swingsetTests",
"# fast-check unsupported",
"test/unitTests/test-amountProperties.js",
"test/unitTests/test-inputValidation.js",
"test/unitTests/test-issuerObj.js"
]
},
"ava": {
"files": [
Expand Down
21 changes: 17 additions & 4 deletions packages/xsnap/src/avaHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,16 @@ const testRequire = function require(specifier) {
return test;
case 'ses':
return undefined;
case 'path':
return {
default: {
dirname: s => s.substring(0, s.lastIndexOf('/')),
},
};
case '@endo/ses-ava':
return { wrapTest: test => test };
case '@endo/init':
case '@endo/init/debug.js':
return undefined;
case '@agoric/install-metering-and-ses':
console.log('TODO: @agoric/install-metering-and-ses');
Expand Down Expand Up @@ -82,6 +89,14 @@ function handler(rawMessage) {
assert,
// @ts-expect-error
HandledPromise,
URL: class URLStub {
constructor(url, base) {
if (base) throw Error('not impl');
this.pathname = url.replace(/file:/, '');
this.href = url;
console.log('new URL@@', { url, base, pathname: this.pathname });
}
},
TextEncoder,
TextDecoder,
...virtualObjectGlobals,
Expand All @@ -90,10 +105,8 @@ function handler(rawMessage) {
c.evaluate(`(${source}\n)()`);
send({ testNames: harness.testNames() });
} catch (ex) {
send({
status: 'not ok',
message: `running test script: ${ex.message}`,
});
console.error('loadScript failed', globalThis.getStackString(ex));
throw Error(`avaHandler: loadScript failed: ${ex.message}`);
}
break;
}
Expand Down
1 change: 1 addition & 0 deletions packages/xsnap/src/avaXS.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const externals = [
'@endo/ses-ava',
'@endo/bundle-source',
'@endo/init',
'@endo/init/debug.js',
'@agoric/install-metering-and-ses',
];

Expand Down
34 changes: 34 additions & 0 deletions packages/zoe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,40 @@
],
"ava-xs": {
"exclude": [
"# path/url/import.meta stuff",
"unitTests/contracts/",
"test/swingsetTests/privateArgs/test-privateArgs.js",
"test/swingsetTests/brokenContracts/test-crashingContract.js",
"test/swingsetTests/offerArgs/test-offerArgs.js",
"test/swingsetTests/makeKind/test-makeKind.js",
"test/swingsetTests/zoe/test-zoe.js",
"test/swingsetTests/runMint/test-runMint.js",
"test/unitTests/test-zoe.js",
"test/unitTests/test-scriptedOracle.js",
"test/unitTests/test-makeKind.js",
"test/unitTests/test-instanceStorage.js",
"test/unitTests/contractSupport/test-depositTo.js",
"test/unitTests/contractSupport/test-withdrawFrom.js",
"test/unitTests/contractSupport/test-offerTo.js",
"test/unitTests/zcf/test-zcfSeat.js",
"test/unitTests/zcf/test-zcfSeat-exit.js",
"test/unitTests/zcf/setupZcfTest.js",
"test/unitTests/zcf/test-feeMintAccess.js",
"# import.meta.url by way of setupZcfTest",
"test/unitTests/test-zoe.js",
"test/unitTests/zcf/test-reallocate-empty.js",
"test/unitTests/zcf/test-zoeHelpersWZcf.js",
"test/unitTests/zcf/test-reallocateForZCFMint.js",
"test/unitTests/zcf/test-zcf.js",
"test/unitTests/zcf/test-allStagedSeatsUsed.js",
"# ManualTimer.setWakeup: no function",
"test/unitTests/test-fakePriceAuthority.js",
"test/unitTests/test-manualTimer.js",
"# hangs",
"test-makeKind.js",
"test/unitTests/test-scriptedOracle.js",
"test/unitTests/test-zoe.js",
"test/unitTests/zcf/test-allStagedSeatsUsed.js",
"# We use SWINGSET_WORKER_TYPE=xs ava to run these...",
"swingsetTests"
]
Expand Down

0 comments on commit c6db041

Please sign in to comment.