-
Notifications
You must be signed in to change notification settings - Fork 168
Description
Tested on these test suites: https://github.com/Thiht/vscode-venom/tree/master/sample
With the following command: /tmp/venom-v1.1.0-beta.5 run --format=json --output-dir=/tmp/out '**/*.venom.yml'
Venom creates 1 report per test suite:
$ ls -1
test_results.error.venom.yml.json
test_results.failure.venom.yml.json
test_results.success.venom.yml.json
That's a bit annoying to parse, is it possible to get back to a unique file?
Also there's a bug, because I have 2 test suites named success.venom.yml (sample/success.venom.yml and sample/nested/success.venom.yml) but it generates only one report because of the naming scheme test_results.<filename>.json (can be fixed if you go back to a unique file :p )
Last bug I see is that in the line numbering is broken in the error value message.
Before:
"failures": [
{
"value": "\u001b[33mTestcase \"Sample test case #2\", step #0: Assertion \"result.systemout ShouldEqual \\\"Good Bye\\\"\" failed. expected: Good Bye got: Hello (failure.venom.yml:13)\u001b[0m",
"type": "",
"message": ""
}
],
(note the failure.venom.yml:13 at the end of the message)
After:
"errors": [
{
"value": "Testcase \"Sample test case #2\", step #0-0: Assertion \"result.systemout ShouldEqual \\\"Good Bye\\\"\" failed. expected: Good Bye got: Hello (:0)"
}
],
If not in the error message, can you include the line number in the assertion itself? If you use gopkg.in/yaml.v3 it's possible to get the line number at parse time with a custom unmarshaller:
func (a *Assertion) UnmarshalYAML(value *yaml.Node) error {
if err := value.Decode(&a.Raw); err != nil {
return err
}
a.LineNumber = value.Line
// ...see: https://github.com/go-yaml/yaml/blob/v3.0.1/yaml.go#L372