Propagate executed command's exit code #212
Replies: 9 comments
-
|
I think it would be possible. However the question is, should we return exit code which says "recording succeeded, regardless of command that was recorded" or "command that was recorded succeeded". I'm not sure what's the good answer here. |
Beta Was this translation helpful? Give feedback.
-
|
@sickill I think it depends on the use case, I would like to record a command output (a functional test which prints a table by re-printing it every time something changes) and then propagate the exit code to let jenkins know if the test passed or not that's why I was asking |
Beta Was this translation helpful? Give feedback.
-
|
That's a good use case. We could either propagate that by default or via switch. |
Beta Was this translation helpful? Give feedback.
-
|
probably it would be better to implement a specific switch, this way it's backwards-compatible |
Beta Was this translation helpful? Give feedback.
-
|
@sickill Hi, any chance this feature will be implemented? If not could you please give us a hint on where/how to modifiy asciinema to implement this feature? |
Beta Was this translation helpful? Give feedback.
-
|
I don't have ETA for this, sorry. As for how to approach this... The child process is started via execvpe: https://github.com/asciinema/asciinema/blob/develop/asciinema/pty_recorder.py#L114 Not sure how to catch its exit status... The parent process catches SIGCHLD signal: https://github.com/asciinema/asciinema/blob/develop/asciinema/pty_recorder.py#L105 But I don't know if there's any extra info we can get about exiting child process when handling this signal. |
Beta Was this translation helpful? Give feedback.
-
|
Yep, we tried to get it too but got stuck Usually to get the exit code of a child you use the wait() syscall but I'm not sure if it's possible with python |
Beta Was this translation helpful? Give feedback.
-
|
I have a draft PR implementing this here asciinema/asciinema#488 . Needs more testing on different OSes though. |
Beta Was this translation helpful? Give feedback.
-
|
FYI there's new |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to propagate the executed command's ( -c flag) exit code?
Beta Was this translation helpful? Give feedback.
All reactions