Skip to content

Separate exit code for test parsing errors? #317

@Hoodoo

Description

@Hoodoo

Thanks for all the hard work on this utility, I've found it really easy to use.

I use a simple bash script to run tests depending on different facter facts on hosts. However, I'd like to be able to tell failing tests from synctactically incorrect tests, e.g.:

#============ The test which should fail:
lan1:~ # cat goss_incorrect.yaml
port:
  tcp:22:
listening: false

lan1:~ # goss --gossfile goss_incorrect.yaml validate -f tap
Error: Could not parse resource Port:tcp:22

lan1:~ # echo $?
1

#============ The incorrect test:
lan1:~ # cat goss_failing.yaml 
port:
  tcp:22:
    listening: false

lan1:~ # goss --gossfile goss_failing.yaml validate -f tap
1..1
not ok 1 - Port: tcp:22: listening: doesn't match, expect: [false] found: [true]

lan1:~ # echo $?
1

I believe having a separate exit code for YAML parsing/template rendering would make scripting easier.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions