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

feat(ses-ava): import test from @endo/ses-ava/prepare-endo.js #2133

Merged
merged 9 commits into from
Mar 12, 2024

Conversation

erights
Copy link
Contributor

@erights erights commented Mar 11, 2024

closes: #XXXX
refs: #XXXX

Description

At Agoric/agoric-sdk#9026 (comment) @turadg suggested that rather than scatter redundant prepare-test-env-ava.js test files in each test directory, that @endo/ses-ava should just export a test that most ses-ava users can just use directly. This PR attempts to provide that.

To do so, I had to change the layering so that the new @endo/ses-ava/prepare-test-env-ava.js can do the endo initialization that most clients expect, which includes setting up both ses and @endo/eventual-send with various options set up appropriately for debugging. Thus, for all those packages that @endo/ses-ava now depends on, directly or indirectly, I changed them to use 'ava' rather than @endo/ses-ava to avoid circular build dependencies.

I also had to move @endo/ses-ava's dependency on 'ava' from "devDependencies": "dependencies":. This creates a hazard that bundlers might try to bundle 'ava', which would be bad. To avoid that, all packages using @endo/ses-ava must depend on it as a "devDependencies":, which they should do anyway.

From a pair debugging session with @Chris-Hibbert just now, I think the options set up by this new @endo/ses-ava/prepare-test-env-ava.js are adequate for him to get the stack traces he needed.

Security Considerations

none

Scaling Considerations

none

Documentation Considerations

easier to document how to set up tests in a test directory.

Testing Considerations

The point. This should both make it easier to set up a test directory, and to get more options set right to support debugging.

Compatibility Considerations

This PR mades a coordinated change between various endo packages, without trying to tolerate version slippage among them. This is all in preparation for a new endo release, and effects on tests, so should be fine. Should have no compat impact on any existing clients of anything in endo.

Upgrade Considerations

none

Nothing breaking. NEWSworthy.

  • [ ] Includes *BREAKING*: in the commit message with migration instructions for any breaking change.
  • Updates NEWS.md for user-facing changes.

@erights erights self-assigned this Mar 11, 2024
@erights erights force-pushed the markm-importable-ses-ava-prepare branch from b2d5a7b to 5756ce5 Compare March 11, 2024 21:51
@erights erights marked this pull request as ready for review March 11, 2024 21:51
packages/bundle-source/test/test-bigint-transform.js Outdated Show resolved Hide resolved
packages/ses-ava/package.json Show resolved Hide resolved
@Chris-Hibbert
Copy link
Contributor

I've looked at the changes. I approve of the goal, but I leave it to others to approve the PR.

@erights
Copy link
Contributor Author

erights commented Mar 11, 2024

At Agoric/agoric-sdk#9026 (comment) @turadg suggested removing the unneeded lint suppression. With this change, I was able to remove all unneeded

// eslint-disable-next-line import/order

Good riddance! Done.

@erights
Copy link
Contributor Author

erights commented Mar 12, 2024

@turadg , I acted on all suggestions as well as possible and got @kriskowal 's approval. PTAL.

Thanks for the great suggestions! It really is much better now.

@erights erights requested a review from turadg March 12, 2024 00:54
@erights erights changed the title feat(ses-ava): import { test } from @endo/ses-ava/prepare-test-env-av… feat(ses-ava): import test from @endo/ses-ava/prepare-endo.js Mar 12, 2024
@erights erights force-pushed the markm-importable-ses-ava-prepare branch from 306c408 to abb93e5 Compare March 12, 2024 01:11
Copy link
Member

@turadg turadg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better!

We had planned,

but I think this is a good solution to the side-effect surprises and boilerplate. @gibson042 should this PR close that issue?

@erights erights force-pushed the markm-importable-ses-ava-prepare branch from abb93e5 to 92253c1 Compare March 12, 2024 18:40
@erights erights force-pushed the markm-importable-ses-ava-prepare branch from e32627a to ce3ac11 Compare March 12, 2024 21:30
@erights erights merged commit 9d3a7ce into master Mar 12, 2024
28 checks passed
@erights erights deleted the markm-importable-ses-ava-prepare branch March 12, 2024 21:39
@gibson042
Copy link
Contributor

We had planned,

but I think this is a good solution to the side-effect surprises and boilerplate. @gibson042 should this PR close that issue?

Yes, I would say so. This is great!

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

Successfully merging this pull request may close these issues.

5 participants