Skip to content

Keep generated JSON reports separate from configured reports #81

Open

Description

Context and request

Observed behavior: JSON report paths are generated with -replace '\.xml$', '.json'. When a configured Pester output path does not end in .xml, the replacement does nothing and Out-File writes JSON to the original report path, overwriting the Pester report. This becomes directly reachable when configured report paths are honored by #78.

Expected behavior: ReportAsJson: true always writes an additional JSON file and never overwrites the configured Pester report.

Reproduction: Configure an enabled test-result or code-coverage report with an output path that has no .xml suffix, and leave ReportAsJson at its default value of true.

with:
  TestResult_OutputPath: reports/test-results

Environment: GitHub composite action with supported Pester versions.

Regression: The suffix assumption predates #78, but configured paths make the behavior newly reachable through the action inputs.

Workaround: End configured report paths in .xml, or set ReportAsJson: false.

Acceptance criteria

  • Add regression tests for configured paths with .xml, another extension, and no extension.
  • Generate a distinct .json sibling path for every supported configured report path.
  • Never overwrite the Pester-generated report.
  • Keep existing default JSON report names unchanged.
  • Document any output-path extension requirements that remain.

Technical decisions

Prefer path-aware extension handling over a regular-expression suffix assumption. Apply the same behavior to test-result and code-coverage JSON exports.

Implementation plan

  1. Add failing path-variation tests.
  2. Replace suffix substitution with path-aware JSON filename generation.
  3. Verify both report types and the established default layout.
  4. Update the report-path documentation.

Activity

  1. added
    github_actions
    on Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    github_actions

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions