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
Open
nedsalk
wants to merge
150
commits into
master
Choose a base branch
from
ns/feat/test-node-launcher
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
Coverage report❌ An unexpected error occurred. For more details, check console
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run failedFailed tests: 4/1525. Failed suites: 4/265.
Report generated by 🧪jest coverage report action from 1f47f6c |
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.
nedsalk
requested review from
arboleya,
danielbate,
petertonysmith94,
Torres-ssf and
Dhaiwat10
May 22, 2024 08:25
Dhaiwat10
previously approved these changes
May 23, 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.
Nits - but otherwise solid 🤺
apps/docs-snippets/src/guide/testing/launching-a-test-node.test.ts
Outdated
Show resolved
Hide resolved
apps/docs-snippets/src/guide/testing/launching-a-test-node.test.ts
Outdated
Show resolved
Hide resolved
apps/docs-snippets/src/guide/testing/launching-a-test-node.test.ts
Outdated
Show resolved
Hide resolved
apps/docs-snippets/src/guide/testing/launching-a-test-node.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Peter Smith <peter@blueoceancomputing.co.uk>
petertonysmith94
previously approved these changes
May 24, 2024
Coverage Report:
Changed Files:
|
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.closes #1254