test(tests): migrate claude CLI task tests from Python to TypeScript#261
Open
m-golovchin wants to merge 6 commits into
Open
test(tests): migrate claude CLI task tests from Python to TypeScript#261m-golovchin wants to merge 6 commits into
m-golovchin wants to merge 6 commits into
Conversation
Port test_codemie_cli_claude.py to Vitest with Zod schema validation for session, metrics, and conversation JSONL files. Fix cross-platform ESLint glob pattern and scope lint-staged vitest to src/ only so integration tests don't run on pre-commit. Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
…test Replace broad src/**/*.ts lint-staged scope with targeted --exclude on the claude-cli-task test which requires live infrastructure to run. Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
Replace lint-staged --exclude hack with describe.runIf(INCLUDE_SSO_TESTS) so the test is skipped by default and only runs when explicitly enabled. Add .env.test.local.example documenting required env vars. Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
Replace global codemie-claude binary invocation with node ./bin/codemie-claude.js so the test always runs against the current branch source. Add auto-rebuild in beforeAll to guarantee dist/ is up to date. Remove installation steps for @codemieai/code and claude provider that required manual user setup. Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
Claude fires "codemie hook" via hooks.json during session lifecycle. Without a global binary in PATH the hooks silently fail and no session files are written. Running npm link after build makes the local binaries globally available, replacing any previously installed version. Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
Owner
|
[AUTO_CLOSE_WARNING] ⏰ This pull request is older than 14 days and will be automatically closed in 16 more days (when it reaches 30 days old)! To maintain this PR, either convert it to Draft or complete your changes and merge. |
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
Migrates
test_codemie_cli_claude.pyfrom the Python test harness to a TypeScript/Vitest integration test suite. Adds Zod schema validation for the three session file types written bycodemie-claude(session JSON, metrics JSONL, conversation JSONL). Also fixes two pre-existing issues inpackage.json.Changes
tests/integration/claude-cli-task.test.ts— Full port of the Python E2E test: installs codemie/Claude (skipped by default via env flags), writes ansso-autotestprofile, runscodemie-claude --task, then polls for and validates all three session files using Zod schemas.tests/integration/models/— Three new Zod schema files (session.ts,metrics.ts,conversation.ts) modelling the session data structures with.passthrough()for forward compatibility.package.json— lint script fix: replaced single-quoted glob'{src,tests}/**/*.ts'with"src/**/*.ts" "tests/**/*.ts"— single quotes are treated as literal characters bycmd.exeon Windows, breaking ESLint.package.json— lint-staged fix: scopedvitest related --runtosrc/**/*.tsonly, so integration tests (which require live infrastructure) are not executed on every pre-commit.Impact
Before: ESLint
lintscript failed on Windows with "No files matching the pattern '{src,tests}/**/*.ts' were found".After: ESLint works cross-platform; integration tests only run in CI (
npm run test:integration), not on pre-commit.Checklist