Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow 'format' to be specified when calling pact-ruby-standalone #84

Closed
joshhendo opened this issue Apr 5, 2018 · 2 comments
Closed

Comments

@joshhendo
Copy link
Contributor

joshhendo commented Apr 5, 2018

In my provider project, I'm interested in presenting the results in a different format (e.g. having multiple mocha tests for each thing tested, rather than a large single test).

Taking a look at how I could parse the output from verifyProvider, I noticed that the underlying binary (pact-ruby-standalone) allows a --format flag to be passed, with JSON available as one of the outputs.

I have quickly put together a proof of concept here: #86 . By not appending the stderr output to the string (due to it adding INFO lines), and by specifying the format to be json, I was able to parse the JSON response.

I'd be happy to work on implementing this feature fully beyond the proof of concept (e.g. agree on what the options should be called, adding in tests etc.)

@mboudreau
Copy link
Contributor

Closing this as it's been pushed out with version 6.18.0.

@mboudreau
Copy link
Contributor

@joshhendo I'm going to do another release (6.18.1) that instead of using "RspecJunitFormatter" for format, just uses "xml" instead, so the option is either "json" or "xml". I feel like the abstraction is needed and better reflects what the binary is actually doing. Hope that's alright.

New version going out now.

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

No branches or pull requests

2 participants