fix(shell test): resolve config file dynamically for smoke tests#2364
Merged
Conversation
After #2342, tools/scripts/getKeys.mjs defaults to writing config.local.yaml (YAML) instead of .env unless --dotenv is passed. The CI smoke workflow calls getKeys without --dotenv, so no .env is produced — but testHelper.ts hard-coded --env <repo>/ts/.env, causing loadKeysFromEnvFile to throw `Env file not found` at shell startup. Every subsequent attempt failed with `Unable to find chat view`. Make getLaunchArgs prefer config.local.yaml when present and fall back to .env for legacy local dev environments. shell/keys.ts's parseConfigFileContent already routes by extension, so passing the YAML path Just Works. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the Shell Playwright smoke tests by making the test launcher dynamically choose the correct key/config file format after the repo-wide move from legacy .env to config.local.yaml.
Changes:
- Add logic in the Shell Playwright test helper to prefer
config.local.yamlwhen present and fall back to.env. - Update Electron launch arguments to pass the resolved config path via
--env, preventing Shell startup failures in--testmode.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@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.
Problem
The smoke-tests workflow has been failing on every PR (and on
mainitself) since #2342 merged on 2026-05-14. Symptom in CI:Worker teardown timeout of 600000ms exceededonsimple.spec.ts:simpleFailed to close instance ... Operation timed outandUnable to find chat view...timeout(10 retry attempts) on the remaining testsRoot cause
PR #2342 changed
tools/scripts/getKeys.mjsto default to YAML output (config.local.yaml); the legacy.envis only written when--dotenvis explicitly passed. The smoke workflow (.github/workflows/smoke-tests.yml) calls:— no
--dotenv, so it now writests/config.local.yamland no.envis produced in CI.But
ts/packages/shell/test/testHelper.tshard-coded the env path:In
--testmode,initializeKeyscallsloadKeysFromEnvFile(envFile)which throwsEnv file <path> not found. Shell startup fails before the chat view ever loads → every Playwright test fails the same way.I confirmed the chain by inspecting #2342's own pre-merge smoke run (25881071116) — it shows the exact same failure signature and was merged with the failure visible.
Fix
Make
getLaunchArgspreferconfig.local.yamlwhen present and fall back to.envso smoke works in both CI (YAML-only) and local developer environments that still have a.env.shell/keys.ts'sparseConfigFileContentalready routes by file extension, so the same code path handles both formats.Verification
pnpm --filter agent-shell build✓npx playwright test simple.spec.ts --workers 1: 5/5 passed in 3.2mAwaiting CI confirmation.