Skip to content

test: add multi-language source-normalization fixtures #21

Description

@EmersonBraun

test: add multi-language source-normalization fixtures

Why this is useful

AgentsKit Code Review accepts many source languages, including Python and Go, but its checked-in review fixtures currently cover only TypeScript. A small multi-language regression fixture would make that support visible and protect the source-normalization contract without requiring a model or API key.

Scope

Add a focused fixture directory and extend the existing source tests:

  • test/fixtures/sources/example.py — a minimal valid Python file;
  • test/fixtures/sources/example.go — a minimal valid Go file;
  • test/fixtures/sources/README.md — a non-code file that must be ignored; and
  • test/sources.test.mjs — credential-free assertions for path and stdin normalization.

Acceptance criteria

  • Calling loadTargets with the fixture directory returns exactly the Python and Go files.
  • The returned targets report language as py and go, preserve the complete file contents, and set isChanged to false for path-based input.
  • The Markdown fixture is ignored.
  • One stdin assertion using a Python filename verifies language: "py" and isChanged: true.
  • Assertions do not rely on filesystem iteration order.
  • No provider, model, network request, generated snapshot, or production-code change is needed.

If the test exposes a production bug, please describe it in the PR and keep any fix narrowly scoped to agents/code-review/sources.ts rather than expanding the contribution.

Validation

npm run build
node --test test/sources.test.mjs
npm run check

Contribution boundary

Keep the change to the new synthetic fixtures and test/sources.test.mjs, unless the regression test demonstrates a small source-normalization bug. Do not add dependencies or call a hosted model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedExtra attention is neededjavascriptPull requests that update javascript code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions