Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SES shim testing on XS: "tiny ava" #535

Closed
dckc opened this issue Dec 3, 2020 · 5 comments
Closed

SES shim testing on XS: "tiny ava" #535

dckc opened this issue Dec 3, 2020 · 5 comments
Assignees
Milestone

Comments

@dckc
Copy link
Contributor

dckc commented Dec 3, 2020

@kriskowal , @erights , my previous work is https://github.com/agoric-labs/tape-xs last revised Jan 27 0fbe38c

Fortunately, I was on my game back then and made a nice README, complete with limitations and such. I think I even got @michaelfig to review it, so he may remember a little bit about it.

(for my reference: see also Agoric/agoric-sdk#370 , Agoric/agoric-sdk#49 )

@dckc
Copy link
Contributor Author

dckc commented Apr 12, 2021

ava-xs from agoric-sdk modified to run SES tests in pre-lockdown compartment

ava-xs runs test scripts each in its own Compartment. It was originally developed to run tests in agoric-sdk. It intercepts import 'ses' and provides basically a noop, since it loaded the xsnap SES bootstrap into each compartment before starting the test script:

import './console-shim';
import './text-shim';
import '@agoric/eventual-send/shim';
import './lockdown-shim';

harden(console);

(We run this thru rollup and then xsnap.evaluate() it.)

In #650, I copied ava-xs from to the endo repo, planning to eventually move it.

But running the SES tests in a locked down SES compartment was a mess.

So after bouncing ideas around with @kriskowal , I came up with ses-test-env-debug.js:

import './console-shim';
import './text-shim';
import 'ses/lockdown';

Note in particular that import 'ses/lockdown' does not call lockdown() the way import './lockdown-shim' does in the agoric-sdk SES bootstrap above.

This allows us to run SES tests that only need ses/lockdown; i.e. those that don't need module-shim, which depends on babel. (#508 (comment) has details on why we currently exclude some others)

Running agoric-sdk tests in a pre-lockdown compartment

This seems relatively straightforward in theory, but I'm leery of taking it on as it was no mean feat to satisfy the constraints to run the current set of agoric-sdk tests on ava-xs and I can imagine various practical details turning up as we shift the constraints under the whole set of tests.

In particular, I expect import 'ses' should be replaced by import 'ses/lockdown' in dozens of places, and @agoric/import-ses may need to split into layers depending on whether module-shim is required.

cc @erights @kriskowal @warner @michaelfig

@erights
Copy link
Contributor

erights commented Jun 25, 2021

Hi @dckc is this done?

@erights
Copy link
Contributor

erights commented Jun 25, 2021

If the point is the pre-lockdown, nevermind. Is this something we need?

@dckc
Copy link
Contributor Author

dckc commented Jun 28, 2021

I believe we want to run the SES test suite on XS (#508); for that, we need something like ava-xs in the endo repo. Most likely by moving it from agoric-sdk as part of #681 . I'm using this issue to track that need.

@kriskowal
Copy link
Member

We’re pursuing XS parity testing with test262 style tests instead of Ava. #812 #1847.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants