Skip to content
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

Passing args to post run command #239

Closed
TripleC1986 opened this issue Apr 4, 2022 · 3 comments
Closed

Passing args to post run command #239

TripleC1986 opened this issue Apr 4, 2022 · 3 comments
Labels
docs Update or add documentation question Further information is requested

Comments

@TripleC1986
Copy link

Hello, I am using gotestsum to run my tests and the postruncommand to parse the junitxml.dule produced. The binary execution is working, but I was wondering if there is anyway to pass args to the post run binary. I have tried with no success, any help would be appreciated.

@TripleC1986
Copy link
Author

cmd := exec.Command(command[0], command[1:]...)
looks like you can but I get parsing errors when trying to run gotestsum --post-run-command command --param=value

@dnephin dnephin added the docs Update or add documentation label Apr 9, 2022
@dnephin
Copy link
Member

dnephin commented Apr 9, 2022

Thank you for opening this issue! Looking at the docs I notice we don't have any example of passing multiple args or other flags to --post-run-command. I'll get the docs updated.

If you provide the full error message I can help debug, but this seems to work for me:

gotestsum --post-run-command "post-run --foo --bar"

As long as the full command is quoted the flags should get passed to the post run command properly.

@dnephin dnephin added the question Further information is requested label Apr 9, 2022
@TripleC1986
Copy link
Author

That makes sense, I wasn't wrapping the post run command in double quotes. Closing... Thanks for updating the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Update or add documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants