goss-org / goss

Quick and Easy server testing/validation
https://goss.rocks
Apache License 2.0
5.6k stars 472 forks source link

Piping to goss render #691

Closed surskitt closed 3 years ago

surskitt commented 3 years ago

Describe the feature: Just like how useful it is to be able to pipe a file to goss validate, especially when running tests over ssh, it would be extremely useful to be able to generate a gossfile for goss render to use.

Describe the solution you'd like I'd expect to just be able to generate my own gossfile and pipe to goss render. Imagine a script like this:

for h in host; do
    (
        echo "gossfile:"
        echo "  common.yaml:{}"
        if [[ -f "${h}.yaml" ]]; then
            echo "  ${h}.yaml: {}"
        fi
    ) | goss render -g - | ssh "${h}" goss -g - validate
done

To include the .yaml tests if they exist but only common.yaml if they don't.

Describe alternatives you've considered I tried looking into the templating engine included, but I think checking for the existence of files and things like that is outside of its feature set.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.