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

junit output for out tests #703

Closed
alenkacz opened this issue Aug 6, 2019 · 6 comments · Fixed by #773
Closed

junit output for out tests #703

alenkacz opened this issue Aug 6, 2019 · 6 comments · Fixed by #773

Comments

@alenkacz
Copy link
Contributor

alenkacz commented Aug 6, 2019

What would you like to be added:
Lots of tools and CI tools are used to work with junit xml output. Would be cool if our tests could produce that as well.

Why is this needed:

@alenkacz
Copy link
Contributor Author

alenkacz commented Aug 6, 2019

I think @zmalik requested this feature as well

@zmalik
Copy link
Member

zmalik commented Aug 7, 2019

thanks @alenkacz! yeah, that's right. This feature will be a lot of help running kudo test and gaining a lot more visibility of what's going on with tests in a build.

@jbarrick-mesosphere
Copy link
Member

Aha, looks like Go test can output as json - we can collect that output, present it nicely to the user, and also generate junit reports from that.

https://golang.org/cmd/go/#hdr-Test_packages

@nfnt
Copy link
Member

nfnt commented Sep 10, 2019

I've used https://github.com/jstemmer/go-junit-report for this purpose before. Worked great for reporting test results in a Jenkins pipeline.

I'll take a look on how this can be integrated into kubectl kudo test.

@nfnt
Copy link
Member

nfnt commented Sep 10, 2019

To support something like kubectl kudo test -junit, the current testing implementation will have to be refactored to not give up all control to go test in https://github.com/kudobuilder/kudo/blob/master/pkg/test/utils/testing.go#L33. Test output needs to be captured then transformed with https://github.com/jstemmer/go-junit-report/blob/master/formatter/formatter.go#L63.
As a simple workaround running

kubectl kudo test 2>&1 | go-junit-report > report.xml

should work right now.

@alenkacz
Copy link
Contributor Author

@nfnt nice! I am fine with that - if we adjust the circle CI to do that as well and collect the output, that is good enough solution for me. Thanks for investigating! I would actually love this feature so we can collect some stats around our builds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants