Skip to content

Commit

Permalink
Merge pull request #2607 from Agoric/2605-zoe-xs-tests
Browse files Browse the repository at this point in the history
test(zoe): disable fewer tests; ava-xs refinements
  • Loading branch information
dckc authored Mar 16, 2021
2 parents bc36651 + d341d4b commit 8ea694b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
18 changes: 11 additions & 7 deletions packages/xsnap/src/ava-xs.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
#!/usr/bin/env node

// We use cjs / require style because -r esm doesn't fit on the #! line.
// https://unix.stackexchange.com/questions/399690/multiple-arguments-in-shebang

/* global require, module */
// @ts-check
const esmRequire = require('esm')(module);
// eslint-disable-next-line no-global-assign
require = require('esm')(module);
require('@agoric/install-ses');
const process = require('process');
const { spawn } = require('child_process');
const { type: osType } = require('os');
const { promises } = require('fs');
const { promises: fsp } = require('fs');
const path = require('path');
const glob = require('glob');
const bundleSource = require('@agoric/bundle-source').default;

esmRequire('@agoric/install-ses');
const bundleSource = esmRequire('@agoric/bundle-source').default;

const { main, makeBundleResolve } = esmRequire('./avaXS');
const { main, makeBundleResolve } = require('./avaXS');

Promise.resolve()
.then(_ =>
main(process.argv.slice(2), {
bundleSource,
spawn,
osType,
readFile: promises.readFile,
readFile: fsp.readFile,
resolve: makeBundleResolve(path),
dirname: path.dirname,
glob,
Expand Down
4 changes: 2 additions & 2 deletions packages/xsnap/src/avaAssertXS.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ function test(label, run, htestOpt) {
const out = tapFormat(htest.send);
const t = makeTester(htest, out);
try {
out.diagnostic('start', label);
// out.diagnostic('start', label);
await run(t);
out.diagnostic('end', label);
// out.diagnostic('end', label);
} catch (ex) {
console.log('FAIL (todo route console)', ex);
t.fail(`${label} threw: ${ex.message}`);
Expand Down
2 changes: 1 addition & 1 deletion packages/xsnap/src/avaXS.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const { keys } = Object;
* @param {string} pattern
*/
function isMatch(specimen, pattern) {
return specimen.match(pattern.replace(/\*/g, '.*'));
return specimen.match(`^${pattern.replace(/\*/g, '.*')}$`);
}

/**
Expand Down
18 changes: 6 additions & 12 deletions packages/zoe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,17 @@
],
"ava-xs": {
"exclude": [
"# eek! SIGSEGV in GC https://github.com/Moddable-OpenSource/moddable/issues/592",
"test-loan-e2e.js",
"# another SEGV, but not in --debug so I cannot get a stack trace",
"contracts/test-callSpread-calculation",
"# another SEGV; not investigated",
"# F test/unitTests/contracts/loan/test-borrow.js borrow, then addCollateral, then getLiquidationPromise",
"# amount value: 100, expected value: 101, message",
"loan/test-borrow.js",
"# https://github.com/Moddable-OpenSource/moddable/issues/604 ",
"test-fakePriceAuthority.js",
"# message: 'isOfferSafe - less than want, less than give threw: get super 32554: no home'",
"test-offerSafety",
"test-scriptedOracle",
"test-zoeHelpers",
"# multiple instances of automaticRefund for the same Zoe bad plan: 6 still to go",
"# F test/unitTests/contracts/test-automaticRefund.js multiple instances of automaticRefund for the same Zoe",
"# bad plan: 6 still to go",
"test-automaticRefund",
"test-secondPriceAuction.js",
"test-escrowToVote",
"test-coveredCall",
"# offerOk threw: \"instance\" not found: (an object)'",
"test-otcDesk.js",
"# We use WORKER_TYPE=xs ava to run these...",
"swingsetTests"
]
Expand Down

0 comments on commit 8ea694b

Please sign in to comment.