This repository has been archived by the owner on Sep 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
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
kratico
reviewed
Oct 14, 2022
kratico
reviewed
Oct 14, 2022
kratico
previously approved these changes
Oct 14, 2022
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.
LGTM 🚀
Co-authored-by: Matias Volpe <[email protected]>
kratico
approved these changes
Oct 14, 2022
kratico
previously approved these changes
Oct 14, 2022
kratico
approved these changes
Oct 14, 2022
harrysolovay
added a commit
that referenced
this pull request
Oct 19, 2022
Co-authored-by: Matias Volpe <[email protected]>
harrysolovay
added a commit
that referenced
this pull request
Oct 19, 2022
Co-authored-by: Matias Volpe <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Reworks our approach to spawning test chains. Before, we were spawning in the same place that we were using. This excessive spawn/kill slowed down test execution. For our testing purposes, isolated test networks don't necessarily matter. If/when this becomes a requirement, we can manage this within
test_ctx
as well.To run a network-dependent command, prefix the command with usage of the
test_ctx
CLI.The test_ctx.ts starts a server, which is responsible for opening polkadot CLI processes on-demand. It also runs your command, passing in the server's hostname and port as env vars. Configs within
test_util/configs
use these env vars to request their respective runtimes' dev net ports. The subprocess then uses the config as normal. Upon the subprocess's exit, the test ctx process kills all polkadot process instances.Sounds like a mouthful, I know. So why this approach?
The main reason is to support our codegen vision #226. Developers will be able to test their code with ease.
main.ts
Normally, the developer would run this with something such as
deno run -A main.ts
To make use of the test env and configs, they need not touch the actual code:
Related changes:
test_ctx.ts
CLI as wellt
->T
(was conflicting witht
context exposed from Deno.test)