redhat-cop / openshift-applier

Used to apply OpenShift objects to an OpenShift Cluster
Apache License 2.0
102 stars 61 forks source link

Can we use molecule to test for expected failures? #98

Open etsauer opened 5 years ago

etsauer commented 5 years ago

@sabre1041 @oybed after doing troubleshooting for #91, i realized that we were basically swallowing errors that we should expect to be thrown. I'm wondering if we can incorporate "expected failures" to our molecule suite. Some examples:

If I pass:

template: "https://nonexistantdomain.com/template.ym"

I should expect ansible to throw:

urllib.error.URLError: <urlopen error [Errno -2] Name or service not known>

If I pass:

template: "https://raw.githubusercontent.com/file/missing.yml"

I should expect:

urllib.error.HTTPError: HTTP Error 404: Not Found