Author the user story for this feature
As a Flank user, I want to have the output saved to the file so I can easily parse this file on CI or use it in Flank integration tests.
Describe the solution
--output-file-format to determine the output file type.What team think about this proposal?
@bootstraponline @piotradamczyk5 @jan-gogo @pawelpasterz @Sloox @axelzuziak-gogo
I think that we should prepare some output json with information about tests results
What output do we need that鈥檚 not already captured in junit xml?
I thinking about something like Flank console output but in json format. That output could contain
That makes sense. Maybe we should look at how gcloud CLI supports saving output to JSON and implement that?
The default output from describe commands is YAML format, but you can use the --format flag to choose between JSON, YAML, and text output formats. JSON formatted output can be useful if you are parsing the output, while text formatted output puts each property on a separate line.
That makes sense. Maybe we should look at how gcloud CLI supports saving output to JSON and implement that?
The default output from describe commands is YAML format, but you can use the --format flag to choose between JSON, YAML, and text output formats. JSON formatted output can be useful if you are parsing the output, while text formatted output puts each property on a separate line.
https://cloud.google.com/compute/docs/gcloud-compute/tips
Yes, I will check how it's looks.
Save information displayed during executing Flank process as easily parsed json report.
The default output from describe commands is YAML format, but you can use the --format flag to choose between JSON, YAML, and text output formats. JSON formatted output can be useful if you are parsing the output, while text formatted output puts each property on a separate line.
Currently parsing output is not easy. The user gets exit code and plain console output.
Optional json report will allow users to easily parse run information and use them with their needs.
The additional motivation is to improve integrations tests of Flank project by having easily parsed JSON report instead of comparing regex-based files with console output.
After finishing this task parsing integrations tests output could be improved.
enableOutputReport)OutputReport) which generate json report with the following information:~There could be a problem with store errors because Report is designed to use in class ReportManager which runs after finished tests.~
In class CommonFlankConfig add parsing new option:
@set:CommandLine.Option(
names = ["--enable-output-report"],
description = ["Saves output results as parsable json file and optionally upload it to Gcloud."]
)
@set:JsonProperty("enable-output-report")
var enableOutputReport: Boolean? by data
Create new class OutputReport class under ftl.reports package which will be able to take objects
typealias OutputData = Map<String, Any>
object OutputReport {
private val outputData: OutputData = mutableMapOf()
fun addToOutputReport(key: String, reportNode: Any) {..}
private fun generateReport(): File {
val report = outputData.toJson()
report <save to file>
}
private fun OutputData.toJson() {...}
private fun File.uploadToGcloud(args: IArgs) {...}
}
OutputReport will be used in any place in the app and at the end it will be generated, stored and send to gcloud
{
"args":<object>,
"weblinks":<string array>,
"testresults": [
"matrix_id": {
"test_axis_value":<String>,
"passed" : <int>,
"failed": <int>,
"flaky":<int>,
"error" <int>,
"outcome": <String>,
"test_details" : <String>
},
...
],
"cost":<float>,
"error":<String>
}
Flank's run output is saved as JSON file if the user enables this feature. Task for improving parsing integrations tests will be created.
Currently, there are not any blockers for this task. However, the addition of this task should be included in research results for task #1317
I would love to see also the proposition of structured JSON or YAML output. This could help to identify the best way for implementation.