Skip to content

Commit

Permalink
fix: use ses-ava in SwingSet where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Mar 26, 2021
1 parent ee54f5a commit 91a09db
Show file tree
Hide file tree
Showing 113 changed files with 189 additions and 148 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* global __dirname */

// eslint-disable-next-line import/no-extraneous-dependencies
import '@agoric/swingset-vat/tools/prepare-test-env';
import '@agoric/swingset-vat/tools/prepare-test-env-ava';

// eslint-disable-next-line import/no-extraneous-dependencies
import test from 'ava';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// @ts-check

// eslint-disable-next-line import/no-extraneous-dependencies
import '@agoric/swingset-vat/tools/prepare-test-env';
import '@agoric/swingset-vat/tools/prepare-test-env-ava';

// eslint-disable-next-line import/no-extraneous-dependencies
import test from 'ava';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check

// eslint-disable-next-line import/no-extraneous-dependencies
import '@agoric/swingset-vat/tools/prepare-test-env';
import '@agoric/swingset-vat/tools/prepare-test-env-ava';

// eslint-disable-next-line import/no-extraneous-dependencies
import test from 'ava';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check

// eslint-disable-next-line import/no-extraneous-dependencies
import '@agoric/swingset-vat/tools/prepare-test-env';
import '@agoric/swingset-vat/tools/prepare-test-env-ava';

// eslint-disable-next-line import/no-extraneous-dependencies
import test from 'ava';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check

// eslint-disable-next-line import/no-extraneous-dependencies
import '@agoric/swingset-vat/tools/prepare-test-env';
import '@agoric/swingset-vat/tools/prepare-test-env-ava';

// eslint-disable-next-line import/no-extraneous-dependencies
import test from 'ava';
Expand Down
2 changes: 1 addition & 1 deletion packages/ERTP/test/unitTests/test-interfaces.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check

// eslint-disable-next-line import/no-extraneous-dependencies
import '@agoric/swingset-vat/tools/prepare-test-env';
import '@agoric/swingset-vat/tools/prepare-test-env-ava';

// eslint-disable-next-line import/no-extraneous-dependencies
import test from 'ava';
Expand Down
2 changes: 1 addition & 1 deletion packages/ERTP/test/unitTests/test-issuerObj.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check

// eslint-disable-next-line import/no-extraneous-dependencies
import '@agoric/swingset-vat/tools/prepare-test-env';
import '@agoric/swingset-vat/tools/prepare-test-env-ava';

// eslint-disable-next-line import/no-extraneous-dependencies
import test from 'ava';
Expand Down
2 changes: 1 addition & 1 deletion packages/ERTP/test/unitTests/test-mintObj.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-check
// eslint-disable-next-line import/no-extraneous-dependencies
import '@agoric/swingset-vat/tools/prepare-test-env';
import '@agoric/swingset-vat/tools/prepare-test-env-ava';

import { Far } from '@agoric/marshal';
// eslint-disable-next-line import/no-extraneous-dependencies
Expand Down
4 changes: 2 additions & 2 deletions packages/SwingSet/test/definition/test-vat-definition.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global require */
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../../tools/prepare-test-env-ava';

import { buildVatController } from '../../src/index';

const mUndefined = { '@qclass': 'undefined' };
Expand Down
9 changes: 3 additions & 6 deletions packages/SwingSet/test/test-comms.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { wrapTest } from '@agoric/ses-ava';
import '@agoric/install-ses';
import rawTest from 'ava';
import { test } from '../tools/prepare-test-env-ava';

import buildCommsDispatch from '../src/vats/comms';
import { flipRemoteSlot } from '../src/vats/comms/parseRemoteSlot';
import { makeState, makeStateKit } from '../src/vats/comms/state';
import { makeCListKit } from '../src/vats/comms/clist';
import { addRemote } from '../src/vats/comms/remote';
import { debugState } from '../src/vats/comms/dispatch';

const test = wrapTest(rawTest);

test('provideRemoteForLocal', t => {
const s = makeState(0);
const stateKit = makeStateKit(s);
Expand Down Expand Up @@ -206,7 +203,7 @@ test('receive', t => {
encodeArgs(`47:deliver:${bobRemote}:bar::ro-20:${bobRemote};argsbytes`),
null,
),
{ message: /unexpected recv seqNum \(a string\)/ },
{ message: /unexpected recv seqNum .*/ },
);

// make sure comms can tolerate dropExports, even if it's a no-op
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-controller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* global require __dirname */
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../tools/prepare-test-env-ava';

// eslint-disable-next-line import/order
import path from 'path';
import { buildVatController, loadBasedir } from '../src/index';
import { checkKT } from './util';
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-demos-comms.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* global __dirname */
import '@agoric/install-ses';
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava';

import { initSwingStore } from '@agoric/swing-store-simple';
import test from 'ava';
import path from 'path';
import { buildLoopbox } from '../src/devices/loopbox';
import {
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-demos.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* global __dirname */
import '@agoric/install-ses';
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava';

import { initSwingStore } from '@agoric/swing-store-simple';
import test from 'ava';
import path from 'path';
import { buildLoopbox } from '../src/devices/loopbox';
import {
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-device-bridge.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* global require */
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../tools/prepare-test-env-ava';

// eslint-disable-next-line import/order
import { initSwingStore } from '@agoric/swing-store-simple';

import {
Expand Down
4 changes: 2 additions & 2 deletions packages/SwingSet/test/test-exomessages.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global require */
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../tools/prepare-test-env-ava';

import { buildVatController } from '../src/index';

async function beginning(t, mode) {
Expand Down
4 changes: 2 additions & 2 deletions packages/SwingSet/test/test-fake-weakref.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../tools/prepare-test-env-ava';

import { WeakRef, FinalizationRegistry } from '../src/weakref';

// We don't test that WeakRefs actually work, we only make sure we can
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-kernel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava';

import anylogger from 'anylogger';
import { initSwingStore } from '@agoric/swing-store-simple';
import { assert, details as X } from '@agoric/assert';
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-liveslots.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava';

import { E } from '@agoric/eventual-send';
import { Far } from '@agoric/marshal';
import { assert, details as X } from '@agoric/assert';
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-marshal.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* global setImmediate */
import '@agoric/install-ses';
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava';

import { Far } from '@agoric/marshal';
import test from 'ava';
import { makePromiseKit } from '@agoric/promise-kit';

import { WeakRef, FinalizationRegistry } from '../src/weakref';
Expand Down
3 changes: 1 addition & 2 deletions packages/SwingSet/test/test-netstring.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* global Buffer */
import '@agoric/install-ses'; // adds 'harden' to global
import { test } from '../tools/prepare-test-env-ava';

import test from 'ava';
import {
encode,
decode,
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-network.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@agoric/install-ses'; // adds 'harden' to global
import test from 'ava';
import { test } from '../tools/prepare-test-env-ava';

// eslint-disable-next-line import/order
import { makePromiseKit } from '@agoric/promise-kit';

import {
Expand Down
4 changes: 3 additions & 1 deletion packages/SwingSet/test/test-node-version.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// eslint-disable-next-line no-redeclare
/* global process */
import { test } from '../tools/prepare-test-env-ava';

// eslint-disable-next-line import/order
import semver from 'semver';
import test from 'ava';

test('Node version for IO queue priority', t => {
t.true(
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-promises.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* global __dirname */
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../tools/prepare-test-env-ava';

// eslint-disable-next-line import/order
import path from 'path';
import {
buildVatController,
Expand Down
2 changes: 1 addition & 1 deletion packages/SwingSet/test/test-queue-priority.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// eslint-disable-next-line no-redeclare
/* global setImmediate setTimeout */
import test from 'ava';
import { test } from '../tools/prepare-test-env-ava';

test('Promise queue should be higher priority than IO/timer queue', async t => {
const log = [];
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-state.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../tools/prepare-test-env-ava';

// eslint-disable-next-line import/order
import {
initSwingStore,
getAllState,
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-syscall-failure.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* global require */
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../tools/prepare-test-env-ava';

// eslint-disable-next-line import/order
import { initSwingStore } from '@agoric/swing-store-simple';
import { buildVatController } from '../src';

Expand Down
4 changes: 2 additions & 2 deletions packages/SwingSet/test/test-tildot.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global require */
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../tools/prepare-test-env-ava';

import { buildVatController } from '../src/index';

test('vat code can use tildot', async t => {
Expand Down
4 changes: 2 additions & 2 deletions packages/SwingSet/test/test-timer-device.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../tools/prepare-test-env-ava';

import { makeTimerMap, curryPollFn } from '../src/devices/timer-src';

test('multiMap multi store', t => {
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-transcript-light.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* global __dirname */
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava';

import path from 'path';
import {
initSwingStore,
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-transcript.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* global __dirname */
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava';

import path from 'path';
// import fs from 'fs';
import {
Expand Down
7 changes: 3 additions & 4 deletions packages/SwingSet/test/test-vat-env.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import '@agoric/swingset-vat/tools/prepare-test-env';
import { test } from '../tools/prepare-test-env-ava';

// eslint-disable-next-line import/order
import { Far } from '@agoric/marshal';
// eslint-disable-next-line import/no-extraneous-dependencies
import test from 'ava';

test('harden from SES is in the vat environment', t => {
harden();
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-vattp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* global require */
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../tools/prepare-test-env-ava';

// eslint-disable-next-line import/order
import { initSwingStore } from '@agoric/swing-store-simple';
import { initializeSwingset, makeSwingsetController } from '../src/index';
import { buildMailboxStateMap, buildMailbox } from '../src/devices/mailbox';
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-vpid-kernel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava';

import anylogger from 'anylogger';
import { initSwingStore } from '@agoric/swing-store-simple';
import { assert, details as X } from '@agoric/assert';
Expand Down
5 changes: 2 additions & 3 deletions packages/SwingSet/test/test-vpid-liveslots.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// eslint-disable-next-line no-redeclare
/* global setImmediate */

import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava';

import { E } from '@agoric/eventual-send';
import { makePromiseKit } from '@agoric/promise-kit';
Expand Down
3 changes: 1 addition & 2 deletions packages/SwingSet/test/test-worker-protocol.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* global Buffer */
import '@agoric/install-ses'; // adds 'harden' to global
import { test } from '../tools/prepare-test-env-ava';

import test from 'ava';
import { arrayEncoderStream, arrayDecoderStream } from '../src/worker-protocol';
import {
encode,
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/timer-device/test-device.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* global require */
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../../tools/prepare-test-env-ava';

// eslint-disable-next-line import/order
import { initSwingStore } from '@agoric/swing-store-simple';

import { initializeSwingset, makeSwingsetController } from '../../src/index';
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/virtualObjects/test-representatives.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* global __dirname */
import '@agoric/install-ses';
import { test } from '../../tools/prepare-test-env-ava';

// eslint-disable-next-line import/order
import path from 'path';
import test from 'ava';
import { buildVatController } from '../../src/index';
import makeNextLog from '../make-nextlog';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../../tools/prepare-test-env-ava';

import { makeCache } from '../../src/kernel/virtualObjectManager';

function makeFakeStore() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../../tools/prepare-test-env-ava';

// eslint-disable-next-line import/order
import { Far } from '@agoric/marshal';
import { makeFakeVirtualObjectManager } from '../../tools/fakeVirtualObjectManager';

Expand Down
4 changes: 2 additions & 2 deletions packages/SwingSet/test/workers/test-worker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global require __dirname */
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../../tools/prepare-test-env-ava';

import { loadBasedir, buildVatController } from '../../src/index';

const expected = [['B good', 'C good', 'F good', 'three good'], 'rp3 good'];
Expand Down
Loading

0 comments on commit 91a09db

Please sign in to comment.