Skip to content

Commit

Permalink
Merge pull request #8205 from Agoric/ta/ava-prepare
Browse files Browse the repository at this point in the history
always init Endo in tests
  • Loading branch information
turadg authored Aug 16, 2023
2 parents 38329c2 + 84e49cc commit 8046ffc
Show file tree
Hide file tree
Showing 131 changed files with 113 additions and 122 deletions.
3 changes: 3 additions & 0 deletions packages/ERTP/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "5m"
},
"publishConfig": {
Expand Down
3 changes: 3 additions & 0 deletions packages/SwingSet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "20m",
"workerThreads": false
},
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/test/test-bundle-handler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '@endo/init/debug.js';
import test from 'ava';

import {
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/test/test-xsnap-store.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @ts-nocheck
/* global globalThis */
import '@endo/init/debug.js';

import { spawn } from 'child_process';
import fs from 'fs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-nocheck
/* eslint @typescript-eslint/no-floating-promises: "warn" */
import test from 'ava';
import '@endo/init/debug.js';
import tmp from 'tmp';
import {
initSwingStore,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-nocheck
/* eslint @typescript-eslint/no-floating-promises: "warn" */
import test from 'ava';
import '@endo/init/debug.js';
import { initSwingStore } from '@agoric/swing-store';
import { initializeSwingset, makeSwingsetController } from '../../src/index.js';
import { buildKernelBundle } from '../../src/controller/initializeSwingset.js';
Expand Down
4 changes: 1 addition & 3 deletions packages/SwingSet/test/vat-warehouse/test-warehouse.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// @ts-check

import '@endo/init/pre-bundle-source.js';

// eslint-disable-next-line import/order
import { test } from '../../tools/prepare-test-env-ava.js';

import { buildVatController } from '../../src/index.js';
import { makeLRU } from '../../src/kernel/vat-warehouse.js';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-nocheck
import '@endo/init/debug.js';
import test from 'ava';
import { initSwingStore } from '@agoric/swing-store';
import { buildVatController } from '../../src/index.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-nocheck
import '@endo/init/debug.js';
import test from 'ava';
import { createHash } from 'crypto';

Expand Down
3 changes: 0 additions & 3 deletions packages/SwingSet/tools/prepare-test-env-ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ import '@endo/ses-ava/exported.js';
import { wrapTest } from '@endo/ses-ava';
import rawTest from 'ava';

/** @type {typeof rawTest} */
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore XXX https://github.com/endojs/endo/issues/1235
export const test = wrapTest(rawTest);

// Does not import from a module because we're testing the global env
Expand Down
3 changes: 3 additions & 0 deletions packages/access-token/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "2m"
}
}
5 changes: 5 additions & 0 deletions packages/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
"@endo/init": "^0.5.57",
"ava": "^5.3.0"
},
"ava": {
"require": [
"@endo/init/debug.js"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/Agoric/agoric-sdk.git"
Expand Down
2 changes: 0 additions & 2 deletions packages/assert/test/test-assert.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import '@endo/init';
// eslint-disable-next-line import/no-unresolved -- lint error not worth solving; test passes
import test from 'ava';

import { NonNullish, Fail } from '../src/assert.js';
Expand Down
3 changes: 3 additions & 0 deletions packages/base-zone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "20m",
"workerThreads": false
}
Expand Down
1 change: 0 additions & 1 deletion packages/base-zone/test/prepare-test-env-ava.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import '@endo/init/debug.js';

import test from 'ava';

Expand Down
3 changes: 3 additions & 0 deletions packages/boot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "20m",
"workerThreads": false
}
Expand Down
3 changes: 3 additions & 0 deletions packages/builders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "20m",
"workerThreads": false
}
Expand Down
3 changes: 3 additions & 0 deletions packages/cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "20m"
}
}
3 changes: 3 additions & 0 deletions packages/cosmic-swingset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "20m"
}
}
1 change: 0 additions & 1 deletion packages/cosmic-swingset/test/test-clean-core-eval.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '@endo/init/debug.js';
import test from 'ava';
import {
defangEvaluableCode,
Expand Down
1 change: 0 additions & 1 deletion packages/cosmic-swingset/test/test-export-storage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-check
import '@endo/init';
import test from 'ava';
import { exportStorage } from '../src/export-storage.js';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* global setTimeout */
import '@endo/init/debug.js';
import test from 'ava';

// Use ambient authority only in test.before()
Expand Down
3 changes: 3 additions & 0 deletions packages/deploy-script-support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
"ava": {
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
]
},
"publishConfig": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @ts-check
import test from 'ava';
import '@endo/init';

import { assertOfferResult } from '../../src/assertOfferResult.js';

Expand Down
3 changes: 3 additions & 0 deletions packages/governance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "10m"
},
"publishConfig": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable ava/assertion-arguments -- the standard diff is unreadable */
// eslint-disable-next-line import/no-extraneous-dependencies
import '@endo/init/debug.js';
import test from 'ava';
import { buildVatController, buildKernelBundles } from '@agoric/swingset-vat';
import bundleSource from '@endo/bundle-source';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '@endo/init/debug.js';
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
import path from 'path';

Expand Down
3 changes: 3 additions & 0 deletions packages/inter-protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"workerThreads": false,
"timeout": "10m"
},
Expand Down
3 changes: 0 additions & 3 deletions packages/inter-protocol/test/vaultFactory/test-storeUtils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Must be first to set up globals
import '@endo/init/debug.js';
// Consider ses-ava once https://github.com/endojs/endo/issues/1235 is resolved
import test from 'ava';

import { AmountMath } from '@agoric/ertp';
Expand Down
5 changes: 5 additions & 0 deletions packages/internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
"ava": "^5.3.0",
"tsd": "^0.28.1"
},
"ava": {
"require": [
"@endo/init/debug.js"
]
},
"author": "Agoric",
"license": "Apache-2.0",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/internal/src/install-ses-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
// The setting below are *unsafe* and should not be used in contact with
// genuinely malicious code.

export * from '@endo/init/debug.js';
import '@endo/init/debug.js';
1 change: 0 additions & 1 deletion packages/internal/test/test-callback.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-check
import '@endo/init';
import test from 'ava';

import { Far } from '@endo/far';
Expand Down
1 change: 0 additions & 1 deletion packages/internal/test/test-netstring.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* global Buffer */
import '@endo/init/debug.js';
import test from 'ava';

import {
Expand Down
1 change: 0 additions & 1 deletion packages/internal/test/test-priority-senders.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @ts-check
import test from 'ava';
import '@endo/init/debug.js';

import { makeFakeStorageKit } from '../src/storage-test-utils.js';
import { HIGH_PRIORITY_SENDERS } from '../src/chain-storage-paths.js';
Expand Down
1 change: 0 additions & 1 deletion packages/internal/test/test-storage-test-utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @ts-check
import test from 'ava';
import '@endo/init/debug.js';
import { Far } from '@endo/far';
import { makeMarshal } from '@endo/marshal';

Expand Down
1 change: 0 additions & 1 deletion packages/internal/test/test-upgrade-api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-check
import '@endo/init';
import test from 'ava';
import {
makeUpgradeDisconnection,
Expand Down
1 change: 0 additions & 1 deletion packages/internal/test/test-utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @ts-check
import test from 'ava';
import '@endo/init';

import { Far } from '@endo/far';
import {
Expand Down
3 changes: 3 additions & 0 deletions packages/network/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "20m",
"workerThreads": false
}
Expand Down
3 changes: 3 additions & 0 deletions packages/notifier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "2m"
}
}
4 changes: 0 additions & 4 deletions packages/notifier/test/prepare-test-env-ava.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import '@endo/init';

import { wrapTest } from '@endo/ses-ava';
import rawTest from 'ava';

// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore -- https://github.com/endojs/endo/issues/1235
export const test = wrapTest(rawTest);
3 changes: 3 additions & 0 deletions packages/pegasus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "10m"
},
"publishConfig": {
Expand Down
3 changes: 3 additions & 0 deletions packages/smart-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "2m"
},
"publishConfig": {
Expand Down
3 changes: 3 additions & 0 deletions packages/solo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "20m",
"workerThreads": false
}
Expand Down
3 changes: 3 additions & 0 deletions packages/spawner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "2m"
}
}
3 changes: 3 additions & 0 deletions packages/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
"files": [
"test/**/test-*.js"
],
"require": [
"@endo/init/debug.js"
],
"timeout": "2m"
}
}
2 changes: 0 additions & 2 deletions packages/store/test/perf-patterns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import '@endo/init/debug.js';

import { Far, makeTagged } from '@endo/marshal';
import {
makeCopyBag,
Expand Down
2 changes: 0 additions & 2 deletions packages/store/test/prepare-test-env-ava.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import '@endo/init/debug.js';

import { wrapTest } from '@endo/ses-ava';
import rawTest from 'ava';

Expand Down
1 change: 0 additions & 1 deletion packages/store/test/test-AtomicProvider.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-use-before-define */
import '@endo/init/debug.js';

import test from 'ava';
import { Far } from '@endo/marshal';
Expand Down
1 change: 0 additions & 1 deletion packages/store/test/test-store.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-use-before-define */
import '@endo/init/debug.js';

import test from 'ava';

Expand Down
Loading

0 comments on commit 8046ffc

Please sign in to comment.