Skip to content

Commit

Permalink
test: snapshot of runtime exports (#10202)
Browse files Browse the repository at this point in the history
closes: #10086

## Description

#10086 has been fixed by other PRs but still needed a regression test showing that runtime importing from `@agoric/orchestration` does not fail.

This goes a step further and snapshots the list of exports, so that any changes are seen in code review.

It also does it for a number of other active packages that tend to be imported outside the repo.

### Security Considerations
none

### Scaling Considerations
none

### Documentation Considerations
none

### Testing Considerations
It's a fast test. I also considered making a test in `boot` that iterated over the whole workspace, but I thought this would be an easier workflow and allow for more local tailoring.

### Upgrade Considerations
none
  • Loading branch information
mergify[bot] authored Oct 3, 2024
2 parents 437c03b + 636b357 commit 5b3e4d0
Show file tree
Hide file tree
Showing 28 changed files with 283 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/async-flow/test/exports.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable import/no-extraneous-dependencies -- requiring the package itself to check exports map */
import test from 'ava';

import * as index from '@agoric/async-flow';

test('index', t => {
t.snapshot(Object.keys(index).sort());
});
14 changes: 14 additions & 0 deletions packages/async-flow/test/snapshots/exports.test.js.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Snapshot report for `test/exports.test.js`

The actual snapshot is saved in `exports.test.js.snap`.

Generated by [AVA](https://avajs.dev).

## index

> Snapshot 1
[
'empty',
'prepareAsyncFlowTools',
]
Binary file not shown.
8 changes: 8 additions & 0 deletions packages/inter-protocol/test/exports.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable import/no-extraneous-dependencies -- requiring the package itself to check exports map */
import test from 'ava';

import * as index from '@agoric/inter-protocol';

test('index', t => {
t.snapshot(Object.keys(index).sort());
});
13 changes: 13 additions & 0 deletions packages/inter-protocol/test/snapshots/exports.test.js.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Snapshot report for `test/exports.test.js`

The actual snapshot is saved in `exports.test.js.snap`.

Generated by [AVA](https://avajs.dev).

## index

> Snapshot 1
[
'calculateCurrentDebt',
]
Binary file not shown.
8 changes: 8 additions & 0 deletions packages/internal/test/exports.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable import/no-extraneous-dependencies -- requiring the package itself to check exports map */
import test from 'ava';

import * as index from '@agoric/internal';

test('index', t => {
t.snapshot(Object.keys(index).sort());
});
42 changes: 42 additions & 0 deletions packages/internal/test/snapshots/exports.test.js.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Snapshot report for `test/exports.test.js`

The actual snapshot is saved in `exports.test.js.snap`.

Generated by [AVA](https://avajs.dev).

## index

> Snapshot 1
[
'BASIS_POINTS',
'BridgeId',
'CosmosInitKeyToBridgeId',
'NonNullish',
'PromiseAllOrErrors',
'StorageNodeShape',
'UnguardedHelperI',
'VBankAccount',
'WalletName',
'aggregateTryFinally',
'allValues',
'assertAllDefined',
'bindAllMethods',
'cast',
'deepMapObject',
'deeplyFulfilledObject',
'forever',
'fromUniqueEntries',
'getMethodNames',
'getStringMethodNames',
'makeMeasureSeconds',
'makeTracer',
'mustMatch',
'objectMap',
'objectMetaMap',
'synchronizedTee',
'untilTrue',
'whileTrue',
'withDeferredCleanup',
'zip',
]
Binary file not shown.
8 changes: 8 additions & 0 deletions packages/notifier/test/exports.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable import/no-extraneous-dependencies -- requiring the package itself to check exports map */
import test from 'ava';

import * as index from '@agoric/network';

test('index', t => {
t.snapshot(Object.keys(index).sort());
});
32 changes: 32 additions & 0 deletions packages/notifier/test/snapshots/exports.test.js.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Snapshot report for `test/exports.test.js`

The actual snapshot is saved in `exports.test.js.snap`.

Generated by [AVA](https://avajs.dev).

## index

> Snapshot 1
[
'CLOSE_REASON_FINALIZER',
'ENDPOINT_SEPARATOR',
'Shape',
'base64ToBytes',
'byteSourceToBase64',
'bytesToString',
'coerceToByteSource',
'crossoverConnection',
'getPrefixes',
'parse',
'prepareEchoConnectionKit',
'prepareLoopbackProtocolHandler',
'prepareNetworkPowers',
'prepareNetworkProtocol',
'preparePortAllocator',
'prepareRouter',
'prepareRouterProtocol',
'rethrowUnlessMissing',
'toBytes',
'unparse',
]
Binary file not shown.
8 changes: 8 additions & 0 deletions packages/orchestration/test/exports.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable import/no-extraneous-dependencies -- requiring the package itself to check exports map */
import test from 'ava';

import * as index from '@agoric/orchestration';

test('index', t => {
t.snapshot(Object.keys(index).sort());
});
39 changes: 39 additions & 0 deletions packages/orchestration/test/snapshots/exports.test.ts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Snapshot report for `test/exports.test.ts`

The actual snapshot is saved in `exports.test.ts.snap`.

Generated by [AVA](https://avajs.dev).

## index

> Snapshot 1
[
'AmountArgShape',
'AnyNatAmountShape',
'AnyNatAmountsRecord',
'ChainAddressShape',
'ChainInfoShape',
'CosmosAssetInfoShape',
'CosmosChainInfoShape',
'DelegationShape',
'DenomAmountShape',
'DenomInfoShape',
'DenomShape',
'IBCChannelIDShape',
'IBCChannelInfoShape',
'IBCConnectionIDShape',
'IBCConnectionInfoShape',
'IBCTransferOptionsShape',
'ICQMsgShape',
'LocalChainAccountShape',
'OutboundConnectionHandlerI',
'Proto3Shape',
'TimestampProtoShape',
'TxBodyOptsShape',
'TypedJsonShape',
'chainFacadeMethods',
'prepareChainHubAdmin',
'prepareCosmosInterchainService',
'withOrchestration',
]
Binary file not shown.
8 changes: 8 additions & 0 deletions packages/smart-wallet/test/exports.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable import/no-extraneous-dependencies -- requiring the package itself to check exports map */
import test from 'ava';

import * as index from '@agoric/smart-wallet';

test('index', t => {
t.snapshot(Object.keys(index).sort());
});
11 changes: 11 additions & 0 deletions packages/smart-wallet/test/snapshots/exports.test.js.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Snapshot report for `test/exports.test.js`

The actual snapshot is saved in `exports.test.js.snap`.

Generated by [AVA](https://avajs.dev).

## index

> Snapshot 1
[]
Binary file not shown.
8 changes: 8 additions & 0 deletions packages/vats/test/exports.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable import/no-extraneous-dependencies -- requiring the package itself to check exports map */
import test from 'ava';

import * as index from '@agoric/vats';

test('index', t => {
t.snapshot(Object.keys(index).sort());
});
23 changes: 23 additions & 0 deletions packages/vats/test/snapshots/exports.test.js.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Snapshot report for `test/exports.test.js`

The actual snapshot is saved in `exports.test.js.snap`.

Generated by [AVA](https://avajs.dev).

## index

> Snapshot 1
[
'BridgeHandlerI',
'BridgeManagerI',
'BridgeScopedManagerI',
'NameHubIKit',
'makeAgoricNamesAccess',
'makeNameHubKit',
'makePromiseSpace',
'makeScopedBridge',
'prepareBridgeManager',
'prepareMixinMyAddress',
'prepareNameHubKit',
]
Binary file added packages/vats/test/snapshots/exports.test.js.snap
Binary file not shown.
8 changes: 8 additions & 0 deletions packages/vow/test/exports.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable import/no-extraneous-dependencies -- requiring the package itself to check exports map */
import test from 'ava';

import * as index from '@agoric/vow';

test('index', t => {
t.snapshot(Object.keys(index).sort());
});
20 changes: 20 additions & 0 deletions packages/vow/test/snapshots/exports.test.js.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Snapshot report for `test/exports.test.js`

The actual snapshot is saved in `exports.test.js.snap`.

Generated by [AVA](https://avajs.dev).

## index

> Snapshot 1
[
'VowShape',
'defaultPowers',
'heapVowE',
'heapVowTools',
'makeE',
'prepareSwingsetVowTools',
'prepareVowTools',
'toPassableCap',
]
Binary file added packages/vow/test/snapshots/exports.test.js.snap
Binary file not shown.
3 changes: 3 additions & 0 deletions packages/zoe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
"test/unitTests/scriptedOracle.test.js",
"test/unitTests/zoe.test.js",
"test/unitTests/zcf/allStagedSeatsUsed.test.js",
"# t.snapshot",
"test/exports.test.js",
"test/snapshots",
"# We use SWINGSET_WORKER_TYPE=xs ava to run these...",
"swingsetTests"
]
Expand Down
8 changes: 8 additions & 0 deletions packages/zoe/test/exports.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable import/no-extraneous-dependencies -- requiring the package itself to check exports map */
import test from 'ava';

import * as index from '@agoric/zoe';

test('index', t => {
t.snapshot(Object.keys(index).sort());
});
14 changes: 14 additions & 0 deletions packages/zoe/test/snapshots/exports.test.js.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Snapshot report for `test/exports.test.js`

The actual snapshot is saved in `exports.test.js.snap`.

Generated by [AVA](https://avajs.dev).

## index

> Snapshot 1
[
'makeDurableZoeKit',
'makeZoeKit',
]
Binary file added packages/zoe/test/snapshots/exports.test.js.snap
Binary file not shown.

0 comments on commit 5b3e4d0

Please sign in to comment.