-
Notifications
You must be signed in to change notification settings - Fork 497
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
Add switch to log results to JSON file #630
base: master
Are you sure you want to change the base?
Conversation
The --consolidated-results switch causes results like tests per process, time taken, and total failures to be logged to a JSON file at the path supplied.
end | ||
|
||
def write_consolidated_results(consolidated_results, options) | ||
return if options[:consolidated_results].nil? || options[:consolidated_results].empty? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a big fan of supporting ""
... can simplify to return unless options[:consolidated_results]
@@ -216,6 +236,7 @@ def parse_options!(argv) | |||
opts.on("--unknown-runtime [FLOAT]", Float, "Use given number as unknown runtime (otherwise use average time)") { |time| options[:unknown_runtime] = time } | |||
opts.on("--first-is-1", "Use \"1\" as TEST_ENV_NUMBER to not reuse the default test environment") { options[:first_is_1] = true } | |||
opts.on("--verbose", "Print more output") { options[:verbose] = true } | |||
opts.on("--consolidated-results [PATH]", "Location to write consolidated test results") { |path| options[:consolidated_results] = path } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe json-summary
or so ?
hmm idk overall looks like a fair bit of added complexity to write a format that won't be useful to very many ... also missing any tests |
seconds = ParallelTests.delta { yield }.to_i | ||
puts "\nTook #{seconds} seconds#{detailed_duration(seconds)}" | ||
message = "Took #{seconds} seconds#{detailed_duration(seconds)}" | ||
consolidated_results[:time_taken] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how long the command took is easily gathered by whatever process runs the parallel_tests command
also time_taken: seconds
might be good enough, don't really need the custom format if this goes through post-processing anyway
@@ -28,7 +28,11 @@ def summarize_results(results) | |||
|
|||
output << super | |||
|
|||
output.join("\n\n") | |||
consolidated_results[:summary] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
output is everything the command prints, not sure why it needs to be in the json ... will make kit so much bigger ...
The --consolidated-results switch causes results like tests per process, time taken, and total failures
to be logged to a JSON file at the path supplied.
This is useful for us because we'd like to take these results and post them to our Github status checks.