Skip to content

chatcops test: JUnit reporter and --output #416

Open

Description

@anurag629

CI systems (GitLab, Jenkins, Azure, the GitHub test report actions) read JUnit XML. This adds --reporter junit.

How reporters work
Reporters are registered in REPORTERS (packages/cli/src/test/reporters/index.ts:32). A Reporter has onResult(result), called as each test finishes, and onEnd(results, summary), called once with all of them and a RunSummary (mode, judge, cost). reporters/json.ts is the shortest example and reporters/pretty.ts the default. They get a ReporterOutput to write to, which is stdout today.

What to add

  • reporters/junit.ts: one <testsuite> per eval file and one <testcase> per test, with classname the file and name the test name, the time in seconds from the turns' latencyMs, and a <failure> with the failed reasons and the reply for failed tests. Escape XML properly.
  • --output <file> in packages/cli/src/main.ts (next to reporter, around line 136). With one --reporter, write to the file instead of stdout. With several, --reporter junit=evals.xml style is clearer, so support name=file per reporter and make --output the shortcut for a single one. Pick what you think reads best and explain it in the PR.

Acceptance criteria

  • Tests: the XML for passing, failing and errored tests, escaping of <, & and quotes, writing to a file
  • Documented in website/src/content/docs/core/testing.mdx, with a changeset for @chatcops/cli (minor)
  • pnpm test:coverage and pnpm lint pass

Activity

  1. kachamsiddarth commented on Oct 28, 2026

    @kachamsiddarth
    Contributor

    Hi @anurag629, i would like to work on this issue can you assign me?

  2. anurag2787 commented on Oct 28, 2026

    @anurag2787
    Collaborator

    Hi @anurag629 can i work on it

  3. anurag629 commented on Oct 28, 2026

    @anurag629
    MemberAuthor

    @kachamsiddarth it's yours. Reporters are registered in REPORTERS (packages/cli/src/test/reporters/index.ts:32), and reporters/json.ts is the shortest one to copy from.

    @anurag2787 kachamsiddarth asked first; you've got #415.

  4. ashutoshpalhare commented on Oct 29, 2026

    @ashutoshpalhare

    Hi! I'd like to work on this issue for Hacktoberfest 2026. I plan to add the JUnit XML reporter, support output files, cover XML escaping and pass/fail/error cases with tests, and update the testing docs and changeset. Could you please assign this issue to me before I start?

  5. anurag629 commented on Oct 29, 2026

    @anurag629
    MemberAuthor

    @ashutoshpalhare thanks, but this one is already assigned to @kachamsiddarth. #452, which you filed, is free and I've assigned it to you, see my note there.

  6. anurag629 commented on Nov 5, 2026

    @anurag629
    MemberAuthor

    @kachamsiddarth checking in on this one. It's been eight days since I assigned it and there's no PR yet. If you're working on it locally, push your branch and open a PR, even as a draft, so I can see where it stands. If there's no update by Nov 8, I'll free it so someone else can pick it up. You're welcome to ask for it again later.

  7. bhushan4work commented on Nov 5, 2026

    @bhushan4work
    Collaborator

    I would like to work on this one , if theres no response till 8 nov then willl self assign and write a fix .

  8. anurag629 commented on Nov 6, 2026

    @anurag629
    MemberAuthor

    @bhushan4work kachamsiddarth opened #590 for this one, so it stays with them. #417 still opens up on Nov 8 if there's no update there.

  9. bhushan4work commented on Nov 6, 2026

    @bhushan4work
    Collaborator

    works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions