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

Bitbucket Pipelines Test reporting displaying tests incorrectly #68

Closed
taraspos opened this issue Sep 25, 2019 · 6 comments · Fixed by #70
Closed

Bitbucket Pipelines Test reporting displaying tests incorrectly #68

taraspos opened this issue Sep 25, 2019 · 6 comments · Fixed by #70
Labels
enhancement New feature or request

Comments

@taraspos
Copy link

taraspos commented Sep 25, 2019

I'm using this with the Bitbucket Pipelines Test reporting and found an issue that test results displayed incorrectly.

Following input:

    <testsuite tests="14" failures="2" time="1.161" name="github.com/my_org/path/to/pkg">
        <properties>
            <property name="go.version" value="go1.13"></property>
        </properties>
        <testcase classname="github.com/my_org/path/to/pkg" name="TestInMyPkg" time="0.000">
            <failure message="Failed" type="">Example Error Message</failure>
        </testcase>
    </testsuite>

results in following test representation in Bitbucket Pipelines:
Screen Shot 2019-09-25 at 4 28 38 PM

While input with the short package name in the classname property:

    <testsuite tests="14" failures="2" time="1.161" name="github.com/my_org/path/to/pkg">
        <properties>
            <property name="go.version" value="go1.13"></property>
        </properties>
        <testcase classname="pkg" name="TestInMyPkg" time="0.000">
            <failure message="Failed" type="">Example Error Message</failure>
        </testcase>
    </testsuite>

Results in the much better representation on the Bitbucket Pipeliens UI:
Screen Shot 2019-09-25 at 4 31 09 PM

@taraspos
Copy link
Author

taraspos commented Sep 25, 2019

I think it should be fine changing it to use the short package name in the testcase.classname the property, since long package name already present in the testsuite.name. Do you have any concerns regarding this change?

@dnephin
Copy link
Member

dnephin commented Oct 5, 2019

Hi, Thank you for opening this issue!

Making changes to the junit.xml is challenging, because it seems that every CI system uses it in a slightly different way.For example see issue #50, which is still open as well.

I think the proposed change in #69 would make the output worse on other CI systems.

I'd like to find some way that allows everyone to customize the fields as necessary for their CI system, but I'm not exactly sure what that would look like yet.

@dnephin dnephin added the enhancement New feature or request label Oct 5, 2019
@dnephin
Copy link
Member

dnephin commented Oct 5, 2019

#49 also seems relevant, which effectively is the opposite change to this PR. It sounds like the bug here might be in Bitbucket Pipelines Test reporting, it seems to be doing something different from all the other tools.

That said, I am still interested in finding a way to make it work for all tools, by allowing fields to be customized.

@taraspos
Copy link
Author

taraspos commented Oct 6, 2019

hmm... maybe some additional flag something like --short-package-name to cover both cases?

@dnephin
Copy link
Member

dnephin commented Oct 6, 2019

I've added some flags in #70 which should hopefully work for both cases

@taraspos
Copy link
Author

taraspos commented Oct 6, 2019

Thanks, looks cool!

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

Successfully merging a pull request may close this issue.

2 participants