Skip to content

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

@stevk

Description

@stevk

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions