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

Add Junit report #107

Closed
nirtal85 opened this issue Jun 21, 2018 · 10 comments
Closed

Add Junit report #107

nirtal85 opened this issue Jun 21, 2018 · 10 comments

Comments

@nirtal85
Copy link

nirtal85 commented Jun 21, 2018

Hi,
please add a junit report option,
as a flag to the run:
should be like bats (test files/folder) --junit

@jasonkarns
Copy link
Member

jasonkarns commented Jun 21, 2018

TAP is a very common, cross-language test output format. Due to being a pseudo lingua-franca of test report outputs, there are dozens of converters from TAP to other formats. Simply piping the TAP output to other formats will get you junit output without any modification to bats.

For instance: https://github.com/aghassemi/tap-xunit via bin/bats --tap test | tap-xunit would generate xunit output.

As it stands, the current formatter could be shipped as a standalone TAP converter that just receives Bats' TAP output. Creating a separate bats-xunit project would be a fine repo for future inclusion in a potential bats-core github org. I just don't think it should necessarily be bundled within bats itself.

related upstream issue: sstephenson/bats#161

@DarwinJS
Copy link

We use Gitlab CI and it has recently gained JUNIT test results import and display - but this is the only format it supports so far. (https://gitlab.com/gitlab-org/gitlab-ce/issues/17081)

Very interested in following where this goes.

@filmil
Copy link

filmil commented Aug 14, 2018

I think it's valuable to produce jUnit output right here in bats:

@jakub-bochenski
Copy link

jakub-bochenski commented Jun 21, 2019

FTR there is no JUnit Schema (XSD or otherwise). The XML format originates from Ant and there was no strict schema defined at the time.
Windy Road Technology Pty. Limited, which you link to, has no authority to define the schema for it. It's only their opinion and it's not normative.

I still think a native JUnit report would be useful for sake of timing though.

Another reason is that installing node just to convert the output format seems excessive

@filmil
Copy link

filmil commented Jun 21, 2019

FTR there is no JUnit Schema (XSD or otherwise). The XML format originates from Ant and there was no strict schema defined at the time.
Windy Road Technology Pty. Limited, which you link to, has no authority to define the schema for it. It's only their opinion and it's not normative.

True. But either way, people do use timing information in their jUnit test results.

I still think a native JUnit report would be useful for sake of timing though.
Another reason is that installing node just to convert the output format seems excessive

I'm with you there. However, in the end I rolled my own post-processor: https://github.com/filmil/tap2junit. I'm not a big fan of more bash. :)

@jakub-bochenski
Copy link

I'm with you there. However, in the end I rolled my own post-processor: https://github.com/filmil/tap2junit. I'm not a big fan of more bash. :)

Nice. Unfortunately go is yet another dependency.
Would you consider publishing this as a container to Dockerhub so that it can be used more easily (like jq or shellcheck etc.)?

@bmarwell
Copy link

Unfortunately go is yet another dependency.

It is not. Go is not an interpreted language. tap2junit is a binary.

@MatthiasScholzTW
Copy link

It seems this feature request is solved since the release of bats-core 1.2.1 it is now possible to just run bats --formatter junit ....

@martin-schulze-vireso
Copy link
Member

martin-schulze-vireso commented Sep 13, 2020

It seems this feature request is solved since the release of bats-core 1.2.1 it is now possible to just run bats --formatter junit ....

The bulk of this feature is done but details like the output and cli options have not settled yet.

@martin-schulze-vireso
Copy link
Member

There is still some movement on the details but I think the issue here is done.

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

Successfully merging a pull request may close this issue.

8 participants