[ink_e2e] spawn a separate contracts node instance per test#1642
Merged
[ink_e2e] spawn a separate contracts node instance per test#1642
[ink_e2e] spawn a separate contracts node instance per test#1642Conversation
SkymanOne
approved these changes
Feb 4, 2023
| @@ -1,11 +0,0 @@ | |||
| #[tokio::test] | |||
Contributor
There was a problem hiding this comment.
Maybe worth replacing this with a test on launching the test node
SkymanOne
suggested changes
Feb 4, 2023
Contributor
SkymanOne
left a comment
There was a problem hiding this comment.
Can you please add CHANGELOG entry?
Codecov Report
@@ Coverage Diff @@
## master #1642 +/- ##
===========================================
- Coverage 70.49% 45.87% -24.62%
===========================================
Files 207 206 -1
Lines 6388 6393 +5
===========================================
- Hits 4503 2933 -1570
- Misses 1885 3460 +1575
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Merged
Closed
This was referenced Feb 13, 2023
Merged
This file contains hidden or 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
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.
Currently the E2E tests depend on a shared instance of
substrate-contracts-noderunning in the background. This can cause issues where tests are not independent, and can be non deterministic when different tests share account ids. See #1615.This PR spawns a unique instance of
substrate-contracts-nodeper test, so the tests are completely isolated. I have copied the TestNodeProcess fromsubxtin order to manage the spawning of the node process and retrieving the unique ports which allow them to run in parallel. This also ensures that the processes are killed on drop.The default is assuming
substrate-contracts-nodeis installed on the PATH. The alternative is to specify theCONTRACTS_NODEenv variable.This is also a quality of life improvement, because it does not depend on the user or the CI environment starting up a contracts node in the background.