Fix "st2 action-alias execute" CLI command#5138
Merged
Conversation
There were two bugs: 1. If user it's not specified it will return an error 2. It didn't correctly de-serialize the result so it failed
Member
Author
captured stdout and stderr to display captured stdout + stderr on test failure. This should make troubleshooting those tests much easier and faster.
Member
Author
|
OK, I couldn't stand not having any tests for such a basic functionality so I also added direct tests in 19e2206 (still not ideal since response is mocked, but that's the pattern we use for CLI tests :/). I also pushed a small related improvements which such make troubleshooting CLI tests easier - 75a114c. |
arm4b
approved these changes
Feb 8, 2021
cognifloyd
approved these changes
Feb 8, 2021
Member
cognifloyd
left a comment
There was a problem hiding this comment.
Wow. I didn't know about st2 action-alias execute. Awesome.
Fixes and tests lgtm
Member
Author
|
I'm also working on related functionality - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I tried to use StackStorm after quite a long time and in the first 5 minutes I encountered two exceptions / bugs (like in the good old days - guess I'm always the "lucky" one :D).
There are two bugs in
st2 action-alias executecommand so it doesn't work.userquery param is not specified, it will fail with the error below due to API returning an error due to type mismatch (out of the box behavior with st2-docker).match_and_executeAPI operation is not correctly de-serialized in the client so client returns empty object and the code throws an exception. API returns a container object with a list so we need to handle that correctly.This PR fixes both issues.
TODO