Communication via socket for test child processes' user interruptions
This is a WIP/exploration PR. Some feedback/polishing may be needed.
This addresses the issue where node test child processes can't deal with user input, which e.g. prevents users from typing the keystore master password.
This proposed solution uses a file socket to communicate between child test processes and the main process runner, so when they need user input (requestSecretInput hook for now), it gets forwarded to the main process and the response is sent back.
This implementation is somewhat naive but has room for extension if it's approved. For now I added caching based on interrupter plugin and prompt, so the master password isn't requested once for each child process.
🦋 Changeset detected
Latest commit: f022c7a987ae8612ec24ecbd4f9f40e5d748bc3c
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 21 packages
| Name | Type |
|---|---|
| @nomicfoundation/hardhat-node-test-runner | Patch |
| hardhat | Patch |
| @nomicfoundation/hardhat-errors | Patch |
| @nomicfoundation/hardhat-ethers-chai-matchers | Patch |
| @nomicfoundation/hardhat-ignition | Patch |
| @nomicfoundation/ignition-core | Patch |
| @nomicfoundation/hardhat-ignition-ethers | Patch |
| @nomicfoundation/ignition-ui | Patch |
| @nomicfoundation/hardhat-ignition-viem | Patch |
| @nomicfoundation/hardhat-keystore | Patch |
| @nomicfoundation/hardhat-mocha | Patch |
| @nomicfoundation/hardhat-network-helpers | Patch |
| @nomicfoundation/hardhat-node-test-reporter | Patch |
| @nomicfoundation/hardhat-test-utils | Patch |
| @nomicfoundation/hardhat-typechain | Patch |
| @nomicfoundation/hardhat-utils | Patch |
| @nomicfoundation/hardhat-toolbox-mocha-ethers | Patch |
| @nomicfoundation/hardhat-verify | Patch |
| @nomicfoundation/hardhat-viem | Patch |
| @nomicfoundation/hardhat-viem-assertions | Patch |
| @nomicfoundation/hardhat-zod-utils | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
After discussion, we are going to close this PR - it help us understand the problem, but we intend to take a simpler approach to the child process context for user interruptions (initially just throwing an error).