Hello, I have a question on junit test reporting a...
# general
h
Hello, I have a question on junit test reporting and merge conflict errors on duplicate names. We have some cucumber tests (specifically with Background test cases), and these are triggering Junit HTML report merge conflict errors because they have the same name. For instance, in the feature file we may have a background as follows
Copy code
Background: Some prerequisite
   Given some data is generated for an account
running the the test gives the following result:
Copy code
Exception caught: (<class 'pants.backend.jvm.tasks.reports.junit_html_report.MergeError'>)

Exception message: Refusing to merge duplicate test cases in suite '| test_account | service-provider | account-administrator |' from files /Users/repo/.pants.d/test/junit/_runs/020fa8b5e62094bc27295509e7056c5fdf0c8234/combined/all/TEST---test_service_user---service-provider---account-administrator--.xml:
    ReportTestCase(name=Given some data is generated for an account, time=0.0, failure=None, error=None, skipped=False)
    ReportTestCase(name=Given some data is generated for an account, time=8.3e-05, failure=None, error=None, skipped=False)
Is there something I can do to still get the results generated?
e
I don't think so as things stand. I don't know cucumber, but the duplicate names definitely violate core assumptions. I think an issue / feature request that explains what to do is the next step. Presumably we'd need an option that tells the junit runner how to handle a dup name. Sum the times perhaps if all pass, fail if any one fails ... not really sure what to do with that.
h
Sure, I expected that to be the case. Will need to evaluate our testing and usage of cucumber.
Thanks for reply!