Skip to content

fix(shell test): resolve config file dynamically for smoke tests#2364

Merged
TalZaccai merged 3 commits into
mainfrom
talzacc/fix-smoke-yaml-config
May 19, 2026
Merged

fix(shell test): resolve config file dynamically for smoke tests#2364
TalZaccai merged 3 commits into
mainfrom
talzacc/fix-smoke-yaml-config

Conversation

@TalZaccai
Copy link
Copy Markdown
Contributor

Problem

The smoke-tests workflow has been failing on every PR (and on main itself) since #2342 merged on 2026-05-14. Symptom in CI:

  • Worker teardown timeout of 600000ms exceeded on simple.spec.ts:simple
  • Failed to close instance ... Operation timed out and Unable to find chat view...timeout (10 retry attempts) on the remaining tests

Root cause

PR #2342 changed tools/scripts/getKeys.mjs to default to YAML output (config.local.yaml); the legacy .env is only written when --dotenv is explicitly passed. The smoke workflow (.github/workflows/smoke-tests.yml) calls:

node tools/scripts/getKeys.mjs --vault build-pipeline-kv --commit

— no --dotenv, so it now writes ts/config.local.yaml and no .env is produced in CI.

But ts/packages/shell/test/testHelper.ts hard-coded the env path:

const args = [appPath, ""--test"", ""--env"", path.resolve(appPath, ""../../.env"")];

In --test mode, initializeKeys calls loadKeysFromEnvFile(envFile) which throws Env 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 getLaunchArgs prefer config.local.yaml when present and fall back to .env so smoke works in both CI (YAML-only) and local developer environments that still have a .env. shell/keys.ts's parseConfigFileContent already routes by file extension, so the same code path handles both formats.

Verification

  • pnpm --filter agent-shell build
  • Local npx playwright test simple.spec.ts --workers 1: 5/5 passed in 3.2m

Awaiting CI confirmation.

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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yaml when present and fall back to .env.
  • Update Electron launch arguments to pass the resolved config path via --env, preventing Shell startup failures in --test mode.

💡 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>
@TalZaccai TalZaccai deployed to development-fork May 19, 2026 05:47 — with GitHub Actions Active
@TalZaccai TalZaccai added this pull request to the merge queue May 19, 2026
Merged via the queue into main with commit 13df871 May 19, 2026
21 of 23 checks passed
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.

2 participants