Add --json option to save collector payload to JSON#36
Merged
Conversation
zhming0
approved these changes
Mar 25, 2025
Comment on lines
52
to
56
| def save_payload(self, path): | ||
| """ Save payload into a json file """ |
Contributor
There was a problem hiding this comment.
[nit] the comment looks like a better method name
Suggested change
| def save_payload(self, path): | |
| """ Save payload into a json file """ | |
| def save_payload_as_json(self, path): | |
| """ Save payload into a json file """ |
5c59e59 to
195c3d6
Compare
195c3d6 to
5d1db20
Compare
Contributor
Author
|
@zhming0 I made some changes to this PR to only save test data. we save Let me know what you think |
Contributor
|
Looks good with the format change. Overall, I do have a bit concern around the fact that this looks like a "one-way door"-ish. But this is bound to be a problem with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We’re integrating bktec with pytest, which requires reading the output from pytest. While pytest has native JUnit XML, it lacks certain information required by
bktec. Sincebktecrelies on this collector, it’s more convenient to save the JSON output from this collector, sobkteccan read it.To save json payload to a file, you need to add
--json=pathoption to thepytest command. For example