Skip to content

ci: run the existing test suite on push and PR - #103

Open
hozantaher wants to merge 2 commits into
standardagents:mainfrom
hozantaher:ci/run-tests
Open

ci: run the existing test suite on push and PR#103
hozantaher wants to merge 2 commits into
standardagents:mainfrom
hozantaher:ci/run-tests

Conversation

@hozantaher

Copy link
Copy Markdown

The repo has 92 test files and vitest.config.ts, but .github/workflows/ only contains publish.yml — nothing runs them. Pull requests therefore land with no checks at all (#102 is currently sitting at zero).

This adds a Test workflow mirroring the conventions already in publish.yml (macos-latest, pnpm/action-setup@v4, Node 22.14.0 with pnpm cache, --frozen-lockfile) and running pnpm typecheck then pnpm test. The e2e specs gate themselves behind DMUX_E2E=1 and stay skipped, since they drive a real tmux server.

One test had to be fixed first

main is not currently green. __tests__/integration/gitOperations.test.ts calls:

await generateCommitMessage('diff content here', '/test');

but the function takes a single argument (src/utils/aiMerge.ts:150), which is how production callers use it (mergePopup.tsx:117, commitMessageHandler.ts:25). The first argument was being used as repoPath.

The assertion also never reached the mocked fetch: callOpenRouter returns null when OPENROUTER_API_KEY is unset (aiMerge.ts:36-37), so the flow fell through to callClaudeCode, whose execSync is mocked in that file — the test was asserting against '[main abc123] Test commit'. The fix passes the real signature and sets a dummy key around the call so the OpenRouter branch is actually exercised, restoring the previous value afterwards.

Verified locally: 109 passed | 1 skipped, 652 tests, pnpm typecheck clean.

Unrelated finding

src/components/panes/MergePane.tsx:143 calls generateCommitMessage() with no argument at all, so repoPath is undefined. Left alone here to keep this PR reviewable — happy to file it separately.

The test passed (diff, repoPath) but the function takes (repoPath) only, and
without OPENROUTER_API_KEY it silently asserted against the callClaudeCode
fallback instead of the mocked fetch.
The suite of 92 test files had no workflow running it; only publish.yml existed.
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