Skip to content

Commit

Permalink
Fix json (#841)
Browse files Browse the repository at this point in the history
* Added ctx object to all system struct's constructors

The idea behind this commit is to set the stage for adding aditional
logging metadata.

* Changed: Improved logging

* Added new flags `--log-level` and `-l` to be consistent with other goss
flags.
  * `--loglevel` and `-L` will be deprecated in a future release
* Log level accepts any casing, so DEBUG and debug are both valid cli opts
* Add log level support for `add` and `autoadd` commands

* Changed log time format to RFC3339

* Fixed: json result[].successful to match goss 3.X behavior

fixes #840
  • Loading branch information
aelsabbahy authored Sep 14, 2023
1 parent b98798e commit b1ffb25
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions outputs/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (r Json) Output(w io.Writer, results <-chan []resource.TestResult,
skipped++
}
m := struct2map(testResult)
m["successful"] = testResult.Result != resource.FAIL
m["summary-line"] = humanizeResult(testResult, false, includeRaw)
m["summary-line-compact"] = humanizeResult(testResult, true, includeRaw)
m["duration"] = int64(m["duration"].(float64))
Expand Down

0 comments on commit b1ffb25

Please sign in to comment.