watch: reload env file for --env-file-if-exists#56643
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #56643 +/- ##
==========================================
- Coverage 89.21% 89.20% -0.01%
==========================================
Files 662 662
Lines 191968 191968
Branches 36955 36949 -6
==========================================
- Hits 171269 171253 -16
- Misses 13535 13551 +16
Partials 7164 7164 🚀 New features to boost your workflow:
|
6e3bc49 to
055d0ca
Compare
|
@jasnell my knowledge of the test runner is not great here, but I believe the tests were failing here due to sync loop and inner async test definition, which may have caused the first test completion to delete the file that the second test was relying on. I have split the two tests (duplicated code aside from --env cmd) and ran them manually to confirm they pass. |
Failed to start CI⚠ Something was pushed to the Pull Request branch since the last approving review. ✘ Refusing to run CI on potentially unsafe PRhttps://github.com/nodejs/node/actions/runs/12894525741 |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
let's hope the flakiness is gone now... |
|
One more and it'll work, I promise |
055d0ca to
9122c4b
Compare
|
Landed in 59b3a8b |
| const kKillSignal = 'SIGTERM'; | ||
| const kShouldFilterModules = getOptionValue('--watch-path').length === 0; | ||
| const kEnvFile = getOptionValue('--env-file'); | ||
| const kEnvFile = getOptionValue('--env-file') || getOptionValue('--env-file-if-exists'); |
There was a problem hiding this comment.
@JonasBa If I'm reading this right, this just makes it so that one file referenced in --env-file-if-exists would be watched only if there is no file provided with --env-file. But the bug we still have is that you wouldn't be able to specify both an --env-file and an --env-file-if-exists argument and have both be watched.
|
This commit requires manual backport to land on v20.x |
While using watch mode with --env-file-if-exists, reload env correctly
ref: #49148 (comment)