jstemmer / go-junit-report

Convert Go test output to JUnit XML
MIT License
764 stars 222 forks source link

parser: support stdout parsing for parallel tests #115

Closed ialcor-zz closed 2 years ago

ialcor-zz commented 3 years ago

Output for parallel tests is not well parsed in some cases #114 because of the order in which the outputs are printed.

If the logging methods provided by testing library are used, stdout will name the current test before the output message.

=== RUN   TestUpdateUser/update_mask_paths_empty
    TestUpdateUser/update_mask_paths_empty: user_test.go:330: some random error message 

This MR ads a regex that will update the current test "cur" if this structure is found.

ialcor-zz commented 3 years ago

Probably it will only solve partially #114 and is not a really clean solution. However it is working for my test cases.

Open to any refactor or changing suggestion 😄

jstemmer commented 2 years ago

Thanks for proposing a possible fix! The recently released v2 update supports parallel tests, so this will no longer be necessary.