Skip to content

fix: propagate project env into suite options so spawns use configured env - #35

Merged
factory-davidgu merged 1 commit into
mainfrom
factory/propagate-suite-env
Aug 22, 2026
Merged

factory-davidgu merged 1 commit into
mainfrom
factory/propagate-suite-env

Conversation

@factory-davidgu

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #34. That PR made loadConfig() preserve config-level use.env, but the value still never reached the spawned pty: getRootSuite resolves env, workspacePath, and userHomePath per project and then drops all three when constructing the project and file Suite options. The worker's resolvedOptions therefore had env: undefined, and node-pty fell back to the worker's ambient process.env.

This PR includes the three resolved fields in the project and file suite options, so tests without a beforeSpawn hook run with the configured environment. Tests that do register beforeSpawn hooks (like factory-mono's useFixture) 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 projects type annotation (npm run lint was failing on main).

Testing

  • npm run build (tsc) passes
  • npm run lint (eslint + prettier) passes
  • factory-mono fixture-less guard e2e test: red before, green after

…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>
@factory-davidgu
factory-davidgu merged commit 439a5c3 into main Aug 22, 2026
2 of 17 checks passed
@factory-davidgu
factory-davidgu deleted the factory/propagate-suite-env branch August 22, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant