Skip to content

upgrade test2json converter#2855

Closed
dududko wants to merge 1 commit intobazel-contrib:masterfrom
dududko:upgrade-test2json
Closed

upgrade test2json converter#2855
dududko wants to merge 1 commit intobazel-contrib:masterfrom
dududko:upgrade-test2json

Conversation

@dududko
Copy link
Copy Markdown
Contributor

@dududko dududko commented Mar 24, 2021

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

This PR includes the upgrade of the source code of test2json converter.

Current version of test2json ignores panic and os.Exit in the counter header of the xml report. In the latest version of test2json convertor this issue is fixed.

Other notes for review
Example:

package example

import (
	"testing"
)

func TestError(t *testing.T) {
	t.Error("err")
}

func TestPanic(t *testing.T) {
	panic(1)
}

Old xml report

<testsuites>
        <testsuite errors="0" failures="1" skipped="0" tests="2" time="" name="example/go_default_test">
                <testcase classname="go_default_test" name="TestError" time="0.000">
                        <failure message="Failed" type="">--- FAIL: TestError (0.00s)&#xA;    example_test.go:8: err&#xA;</failure>
                </testcase>
                <testcase classname="go_default_test" name="TestPanic" time="0.008"></testcase>
        </testsuite>
</testsuites>

New xml report

<testsuites>
        <testsuite errors="1" failures="1" skipped="0" tests="2" time="" name="example/go_default_test">
                <testcase classname="go_default_test" name="TestError" time="0.000">
                        <failure message="Failed" type="">=== RUN   TestError&#xA;    example_test.go:8: err&#xA;--- FAIL: TestError (0.00s)&#xA;</failure>
                </testcase>
                <testcase classname="go_default_test" name="TestPanic" time="">
                        <error message="No pass/skip/fail event found for test" type="">=== RUN   TestPanic&#xA;--- FAIL: TestPanic (0.00s)&#xA;</error>
                </testcase>
        </testsuite>
</testsuites>

@dududko dududko requested a review from jayconrod as a code owner March 24, 2021 21:54
@google-cla google-cla bot added the cla: yes label Mar 24, 2021
@excavador
Copy link
Copy Markdown

any updates?

@jayconrod
Copy link
Copy Markdown
Collaborator

It looks like #2873 also upgraded test2json.go, so I'll close this.

@jayconrod jayconrod closed this May 10, 2021
yushan26 pushed a commit to yushan26/rules_go that referenced this pull request Jun 16, 2025
This is a flag to start leveraging of the new code paths. The Starlark
implementation has been added in 1.4 and has been reverted in the latest
release candidates. The `env` variable will be a good way to roll it out
more
gradually and get more testing.

For now we are switching only the `whl_library` internals as the
`requirements.txt` files from `uv` may use `*` in `python_full_version`
and
`platform_version` that are not yet fully supported (bazel-contrib#2826).

Main goals for this is to start using Starlark implementation so that we
don't
have any hidden variables. What is more, having this in Starlark is the
most
maintainable long-term solution for supporting cross-platform builds.

Work towards bazel-contrib#260

---------

Co-authored-by: Richard Levasseur <richardlev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants