bruno icon indicating copy to clipboard operation
bruno copied to clipboard

Support multiple output file with single bruno cli say both json and junit same time

Open rshidling opened this issue 2 years ago • 3 comments

I have checked the following:

  • [X] I use the newest version of bruno.
  • [X] I've searched existing issues and found nothing related to my issue.

Describe the bug

Bru CLI 1.3.0 Support multiple output file with single bruno cli say both json and junit same time

bru run "GET configuration" -r --env ati002 --output res.json --output res1.json

error when we use above example

Something went wrong
The "path" argument must be of type string. Received an instance of Array

.bru file to reproduce the bug

No response

Screenshots/Live demo link

image

rshidling avatar Apr 09 '24 13:04 rshidling

Have created an issue on passing multiple reporters in the command line https://github.com/usebruno/bruno/discussions/1068#discussioncomment-8718094

sushmithasv avatar Apr 10 '24 06:04 sushmithasv

I think it would be useful too. However, contrary to https://github.com/usebruno/bruno/discussions/1068#discussioncomment-8718094, I suggest different Parameters:

  • bru run --junit junit.xml --json result.json --html result.html --text result.txt support multiple reporters
  • bru run --output result.json --format json legacy single output file (might already be used in scripts...)
  • bru run --stdout=json choose your stdout format, possible values: json, junit, html, text (default), none
  • Combining them should be possible: bru run --output result.json --format json --junit junit.xml --stdout text

PS: I think the label bug doesn't belong here, since the readme/--help doesn't even say multiple reporters are supported at the same time. Isn't it a feature request?

marfranke avatar Apr 26 '24 13:04 marfranke

I think it would be useful too. However, contrary to #1068 (comment), I suggest different Parameters:

  • bru run --junit junit.xml --json result.json --html result.html --text result.txt support multiple reporters
  • bru run --output result.json --format json legacy single output file (might already be used in scripts...)
  • bru run --stdout=json choose your stdout format, possible values: json, junit, html, text (default), none
  • Combining them should be possible: bru run --output result.json --format json --junit junit.xml --stdout text

PS: I think the label bug doesn't belong here, since the readme/--help doesn't even say multiple reporters are supported at the same time. Isn't it a feature request?

Yes, even I feel its feature request. Not sure how can Iabel this as feature.

rshidling avatar Apr 27 '24 06:04 rshidling

I threw together a PR that maintains back compat with the existing --format and --output but allows you to pass multiple --format options for using multiple reporters.

You can set the reporter specific output using --output.reporter.

iamdavidfrancis avatar Aug 24 '24 06:08 iamdavidfrancis

Closing this issue as its a duplicate of #2918

helloanoop avatar Aug 26 '24 06:08 helloanoop