-
Notifications
You must be signed in to change notification settings - Fork 480
[ink_e2e] spawn a separate contracts node instance per test
#1642
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
Conversation
| @@ -1,11 +0,0 @@ | |||
| #[tokio::test] | |||
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.
Maybe worth replacing this with a test on launching the test node
SkymanOne
left a comment
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.
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 |
SkymanOne
left a comment
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!
cmichi
left a comment
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.
Thanks, it's good!
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.