-
Notifications
You must be signed in to change notification settings - Fork 432
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
[ink_e2e]
spawn a separate contracts node instance per test
#1642
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
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 |
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!
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-node
running 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-node
per test, so the tests are completely isolated. I have copied the TestNodeProcess fromsubxt
in 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-node
is installed on the PATH. The alternative is to specify theCONTRACTS_NODE
env 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.