move fake-vat-data test helper to @agoric/vat-data #6834
Labels
enhancement
New feature or request
hygiene
Tidying up around the house
liveslots
requires vat-upgrade to deploy changes
SwingSet
package: SwingSet
vaults_triage
DO NOT USE
What is the Problem Being Solved?
To reduce a few dependency cycles (and improve lerna/CI q.v. #6823), we'd like to rearrange the way our test helpers are hosted.
In agoric-sdk, we roughly have three (or four) categories of unit tests:
harden
andassert
in almost everything@agoric/assert
, or uses the globalassert
orharden
, since these get added to the global environment as part of@endo/init
import '@endo/init'; import test from 'ava';
@agoric/vat-data
, which uses aVatData
globaldefineKind
, and the various virtual collections@agoric/swingset-vat
, callbuildVatController()
, and define some vatsSo far, most tests in the first and second categories do:
which provides all of SES, AVA, and VatData. However A: it's overkill, and B: it causes cyclic dependencies, which apparently interfere with some cleverness that
lerna
can apply when the dependency graph is a DAG.Description of the Design
First, we're thinking of moving the VatData (
fakeVirtualStuff
) helpers out ofpackages/SwingSet/
and intopackages/vat-data
. So all tests in the second category could do something like `import test from '@agoric/vat-data/tools/prepare-vatdata-ava.js``.This would be facilitated by moving liveslots out of
packages/SwingSet/
and into its own package, tenatively namedpackages/swingset-liveslots/
. I've been working on this as part of #6596, since each worker type will have its own package, and they'll all need to import liveslots. With this complete,packages/vat-data
does not depend upon swingset, it only depends upon liveslots. Swingset depends upon liveslots, until 6596 is done and swingset depends on the worker packages instead.Then, we'd like to make a new tool that satisfies the first category of tests. This might want to live in the https://github.com/endojs/ monorepo, in a package speculatively named
@endo/ava
. This would move it out of swingset, thus allowing tests that need SES+AVA but not VatData or swingset to avoid any dependencies on either.Test Plan
Unit tests would need updating, but then the fact that they continue to work will be test enough.
The text was updated successfully, but these errors were encountered: