ctrf-io / ctrf-io/github-test-reporter

Bug: Integration with junit-to-ctrf does not use arguments

Open
#207 5 comments 0 reactions 1 assignee View on GitHub

@Ma11hewThomas is already working on this.

Since Aug 23, 2025.

Dominant language
TypeScript
Stars
376
Forks
42
PR merge metrics
No merged PRs in 30d

Description

I've been unable to get the JUnit to CTRF Integration to generate a report with a provided env appName and buildUrl. Regardless of input from the integration config json, those values are set by the github context via enrichCurrentReportWithRunDetails()

Github yaml:

- name: Publish Github Test Report
  if: success() || failure()
  uses: ctrf-io/github-test-reporter@v1
  with:
    report-path: 'test/${{ inputs.app }}/**/*_junit.xml'
    template-path: '.github/actions/run-tests/ctrf-template-job.hbs'
    custom-report: true
    summary: true
    write-ctrf-to-file: 'test-results/${{ steps.prepare_paths.outputs.name }}/ctrf-report.json'
    integrations-config: |
      {
        "junit-to-ctrf": {
          "enabled": true,
          "action": "convert",
          "options": {
            "output": "./test-results/${{ steps.prepare_paths.outputs.name }}/ctrf-report.json",
            "toolname": "junit-to-ctrf",
            "useSuiteName": false,
            "env": {
              "appName": "Unit: Shared",
              "buildUrl": "https://github.com/<REPO>/actions/runs/<RUN_ID/job/<JOB_ID>"
            }
          }
        }
      }

Resulting CTRF report:

{
  "reportFormat": "CTRF",
  "specVersion": "0.0.0",
  "generatedBy": "junit-to-ctrf",
  "timestamp": "2025-08-22T21:51:11.791Z",
  "results": {
    ....,
    "environment": {
        "buildName": "unit-tests",
        "buildNumber": "1",
        "buildUrl": "https://github.com/<REPO>/actions/runs/<RUN_ID>#summary",
        "buildId": "<BUILD_ID>",
        "branchName": "refs/pull/<PULL_ID>/merge"
    }
  }
}

The example in the JUnit to CTRF Integration documentation in this project includes setting appName, so I'd expect this to be possible.

It looks like this was planned but not implemented?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.