-
Notifications
You must be signed in to change notification settings - Fork 472
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
Commands are not executed in the order they defined #455
Comments
This is related to my #485 feature request, to add before/after attributes to tests to enforce ordering Normally all tests run in parallel... |
command:
python_example:
exec: |
python3 << EOF
import sys
print('example output')
for i in range(3):
print(i)
sys.exit(15)
EOF
stdout:
- 'example'
- '0'
- '1'
- '2'
exit-status: 15
timeout: 10000
I know it's not the most ideal syntax, but.. putting code in yaml is less than ideal. That said, in its current state it butchers the output when using more verbose formatters. I have a PR open #495 but will wait on @sshipway to understand the rationale behind the original change better. @Mad-ness Does this meet your needs? |
The original change moved the command from the Key to the exec attribute, leaving the Key to just be a symbol. For backwards compatibility, the Key would be used as the command if no exec attribute existed. The ide behind this was to make the yaml clearer, but mosty to allow a deep merge (such as if the config were managed by a tool like Puppet) to override just the command but leave the other items the same. In order to keep the logs as similar as possible, the ID function was modified to output the exec attribute as well as the key, if it exists (otherwise it would be just the key which would conceal the command to run). However, I did not consider that someone could now put a whole script into the exec attribute, which would make the log display look wrong. I like the idea of putting a script into the exec parameter, but if you're doing this, then for readability you would probably want to change the ID function (IE, the logging prefix) to output only the Key value, regardless of if an exec attribute exists or not. |
'exec' with different 'key' values solves the issue with putting multiline commands in goss files. Of course, tens of lines of scripts in yaml files will not add readability but this is a prefect feature when you need to execute only a few commands. Thank you |
Awesome, let me know if it's okay to close this issue. The cleaner output has been merged in #495 and will be in the next Goss release |
Do we know when the release will be available
…On Fri, Nov 15, 2019, 9:07 PM Ahmed Elsabbahy ***@***.***> wrote:
Awesome, let me know if it's okay to close this issue.
The cleaner output has been merged in #495
<#495> and will be in the next
Goss release
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#455>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AITSLFW53KF3MVPEVHUSZMTQT5PV5ANCNFSM4HVCTJYA>
.
|
I'll have it out sometime this week assuming the open PRs don't cause any issues when merged |
Sorry schedule slipped a little bit on the release, should have the release out tomorrow. Hoping to have the http header (request/response) support in this goss release. |
@milind69 Just released a new version with the command ID change |
Hi,
I've two ideas.
Example of commands:
It would be great if it possible to define either order of execution (maybe add an option "priority") or just follow the order the commands are defined in goss.yml.
I know I can put needed scripts on a target host/image and execute it using command but the powerfull side of Goss is a simplicity. I wouldn't like to split a simple configuration into multiple pieces.
Thanks,
Dmitrii
The text was updated successfully, but these errors were encountered: