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

Expose skipped message #40

Closed
paddatrapper opened this issue Feb 3, 2021 · 3 comments · Fixed by #41
Closed

Expose skipped message #40

paddatrapper opened this issue Feb 3, 2021 · 3 comments · Fixed by #41

Comments

@paddatrapper
Copy link

The Junit schema allows results to present a message as a child of a skipped element. It would be useful to be able to access that through go-junit. An example is below:

<testsuites>
    <testsuite tests="1" failures="0" time="" name="demo">
        <testcase classname="demo.case" name="test">
            <skipped message="reason"></skipped>
        </testcase>
    </testsuite>
</testsuites>

The source for this is line 335 of http:https://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java

@joshdk
Copy link
Owner

joshdk commented Feb 24, 2021

👋🏻 Hello @paddatrapper!

So sorry I didn't see this issue, great find by the way. I went and created #41 to implement this, so please take a look and let me know if it works for your use-case!

Is there an example of such a test XML file available on the internet that I can link to? I always like to link to its origin if possible.

Also, do you have any more information on what exact piece of tooling you were using to generate such an XML? I included your test case in my PR as ant.xml, but this isn't a very descriptive name 😁

Thank you again!

@paddatrapper
Copy link
Author

I'll give it a test, thanks! A brief glance at the PR now looks like it would work for us.

Any of the test-result from https://github.com/flanksource/karina/actions/workflows/kind.yml should include the skipped message. For example https://github.com/flanksource/karina/suites/2111872017/artifacts/42987817

It is a tool called Karina, though the actual XML generation happens commons (struct). go-junit is used as the library to process test results after CI/unit tests are run.

@joshdk
Copy link
Owner

joshdk commented Feb 26, 2021

@paddatrapper #41 has been merged, so please update on your end. Thank you again for the issue! 😁

I also appreciate the details you gave above. I went and grabbed one of the xml files from go-junit-report that contains a skipped message, and used that as a test case.

Cheers!

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.

2 participants