-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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!: add launchTestNode
utility
#1356
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nedsalk
commented
Oct 17, 2023
This comment was marked as outdated.
This comment was marked as outdated.
nedsalk
requested review from
digorithm,
arboleya,
camsjams,
Torres-ssf,
Dhaiwat10 and
danielbate
as code owners
October 23, 2023 18:21
nedsalk
changed the base branch from
master
to
ns/chore/update-formatting-packages
October 24, 2023 07:16
This comment was marked as outdated.
This comment was marked as outdated.
Base automatically changed from
ns/chore/update-formatting-packages
to
master
October 30, 2023 21:08
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
maschad
previously approved these changes
Jun 6, 2024
Torres-ssf
previously approved these changes
Jun 6, 2024
Dhaiwat10
previously approved these changes
Jun 6, 2024
nedsalk
dismissed stale reviews from Dhaiwat10, Torres-ssf, and maschad
via
June 6, 2024 16:12
dedf24e
Dhaiwat10
approved these changes
Jun 6, 2024
maschad
approved these changes
Jun 6, 2024
Torres-ssf
approved these changes
Jun 6, 2024
petertonysmith94
approved these changes
Jun 6, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍏
arboleya
approved these changes
Jun 6, 2024
danielbate
approved these changes
Jun 6, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage Report:
Changed Files:
|
This was referenced Jun 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the
launchTestNode
utility. The idea is for it to be the way to setup tests for interacting with sway programs, both internally and for our users. It allows for full test isolation by creating a node for each test and disposing of it at the end of the test. Besides the main benefit of test isolation (which is ideal for defending against flaky tests), this tool would also speed up our test suite.It makes use of TS 5.2 explicit resource management to automatically kill the node it launches and provides a way to tweak wallet states in the genesis block, deploy contracts, as well as lower level settings like the provider options and node options.
This builds on the great work done in #1204.
Usage example:
This could be nicely tied into #1330 where a sample test file that's testing the contract can be added, demonstrating the preferred way of testing sway programs. We can add e.g.
vitest
as the default framework in the scaffold just so that the developer can run the tests immediately.Breaking changes
account
package is not exporting thesleep
utility anymore and it has now been moved into theutils
package.closes #1254