-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complex file logic #107
Comments
Interesting use case. Unfortunately, support for this does not currently exist in It would be easy to add this feature if it's defined as: "If resource does not exist, skip ALL other tests." If the feature requested is to do more complex logic like: "If the file is mode 0755, then ensure content X otherwise ensure content Y" that might be much more complex. |
I'd be fine with "skip if file does not exist" :) Any more complex logic than that and I would agree that it's totally out of
|
JFYI, we have moved all such logic on the layer before the goss execution. We are using templates toolkit to build the server specific goss.json file (IP, services, server role, server configuration) and then trigger goss with plain goss.json, like:
You can find our repo here https://github.com/sipwise/system-tests ;-) |
So, this will have to wait for the next release of goss. I had some time to work on it today, but prioritized fixing bugs over enhancements. This change is a bit more work than I initially thought since currently tests have only a "Successful" boolean. I need to add a "Status" or "Result" which allows for success, failed, skipped and update the outputs to support that format. |
* Skip optional tests for non existing system resources * Skipped tests do not count as a failure on their own, but are almost always accompanied with a failing test, the only exception is when the exists test is made optional through matchers (see #107): ```yaml exists: or: - true - false ``` * Undefined required attributes will now result in an error
* Skip optional tests for non existing system resources * Skipped tests do not count as a failure on their own, but are almost always accompanied with a failing test, the only exception is when the exists test is made optional through matchers (see #107): ```yaml exists: or: - true - false ``` * Undefined required attributes will now result in an error
Released in v0.1.10 |
Hey, I'm attempting to write a test that will pass if:
Is this possible? I've tried various combinations of putting "or" at different levels in my goss.yaml but I'm getting the impression that it doesn't work like that... a simple test case with:
doesn't appear to work.
Is this something that is expected to work in the current version, and if not is it something that you consider to be within the scope of the project?
Thanks :)
The text was updated successfully, but these errors were encountered: