Repository navigation
fix: propagate project env into suite options so spawns use configured env - #35
Merged
Merged
Conversation
…e options getRootSuite resolved env/workspacePath/userHomePath per project but dropped them when constructing project and file Suite options, so config-level use.env never reached the spawned pty and node-pty fell back to the worker's ambient process.env. Include all three resolved fields in the suite options so tests without a beforeSpawn hook run with the configured environment. Also fixes a pre-existing prettier violation in the projects type annotation. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
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.
Summary
Follow-up to #34. That PR made
loadConfig()preserve config-leveluse.env, but the value still never reached the spawned pty:getRootSuiteresolvesenv,workspacePath, anduserHomePathper project and then drops all three when constructing the project and fileSuiteoptions. The worker'sresolvedOptionstherefore hadenv: undefined, and node-pty fell back to the worker's ambientprocess.env.This PR includes the three resolved fields in the project and file suite options, so tests without a
beforeSpawnhook run with the configured environment. Tests that do registerbeforeSpawnhooks (like factory-mono'suseFixture) are unaffected: they replace these options wholesale.Proven by a fixture-less guard test in factory-mono that spawns an env probe and asserts the config-level env values: it fails against the current runner and passes with this fix.
Also fixes a pre-existing prettier violation in the
projectstype annotation (npm run lintwas failing on main).Testing
npm run build(tsc) passesnpm run lint(eslint + prettier) passes