Skip to content

fix: --reporter flag to support multiple values#1243

Merged
timohuovinen merged 2 commits intomainfrom
timohuovinen/RED-242-multiple-reporters-flag
Mar 10, 2026
Merged

fix: --reporter flag to support multiple values#1243
timohuovinen merged 2 commits intomainfrom
timohuovinen/RED-242-multiple-reporters-flag

Conversation

@timohuovinen
Copy link
Copy Markdown
Contributor

@timohuovinen timohuovinen commented Mar 5, 2026

Affected Components

  • CLI
  • Create CLI
  • Test
  • Docs
  • Examples
  • Other

Notes for the Reviewer

This allows the reporter flag to support multiple params
normally in the form

npx checkly test --reporter list --reporter json
npx checkly test -r dot -r json

This is also consistent with our existing -e and -i flag usage.

I've decided to use the existing flag parsing library function multiple: true to keep things consistent, instead of the suggested npx checkly test --reporter list,json, which would have affected a lot more code and made flag usage within the CLI inconsistent

Resolves #RED-242

Reasoning for multiple reporters:

The --reporter (-r) flag previously only accepted a single value. Users who wanted both human-readable terminal output and machine-parseable output in the same run had no way to achieve this, they'd have to choose one or the other

The code was already built to support multiple reporters, and looks like the flag was always intended to support multiple reporters, but not fully implemented, so generally this is mostly a fix for a missing but expected feature.

i.e. the createReporters already returned an array of Reporter instances and the runner iterated all of them, the limitation was purely in how the CLI flag was parsed and passed through.

Note that playwright's --reporter flag, which also supports multiple reporters, uses a CSV approach, as in --reporter list,json. https://playwright.dev/docs/test-reporters

@hwartig hwartig requested a review from sorccu March 5, 2026 12:57
@timohuovinen timohuovinen force-pushed the timohuovinen/RED-242-multiple-reporters-flag branch from b9254be to 2d3638e Compare March 5, 2026 14:33
@timohuovinen timohuovinen self-assigned this Mar 5, 2026
@timohuovinen timohuovinen force-pushed the timohuovinen/RED-242-multiple-reporters-flag branch from 2d3638e to c374059 Compare March 5, 2026 15:58
Copy link
Copy Markdown
Contributor

@ferrandiaz ferrandiaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@sorccu sorccu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what the reasoning for needing multiple reporters is, and how it will affect the output? What is the intended use case? Add to PR description please.

@timohuovinen
Copy link
Copy Markdown
Contributor Author

@sorccu added as much detail as I can, good now?

@hwartig hwartig requested a review from sorccu March 6, 2026 09:12
@sorccu
Copy link
Copy Markdown
Member

sorccu commented Mar 6, 2026

Alright. If you also want to release, look at contributing.md.

@timohuovinen timohuovinen force-pushed the timohuovinen/RED-242-multiple-reporters-flag branch from c374059 to 612aeaf Compare March 10, 2026 07:56
@timohuovinen timohuovinen merged commit 6dbe890 into main Mar 10, 2026
4 checks passed
@timohuovinen timohuovinen deleted the timohuovinen/RED-242-multiple-reporters-flag branch March 10, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants