Skip to content

sbt.JUnitXmlTestsListener removes part of test name if test name contains dot #5114

@margussipria

Description

@margussipria

steps

sbt version: 1.3.0, 1.3.1, 1.3.2 (probably earlier)

problem

After spending hours figuring out why upgrade from 1.1.6 mangled our tests (scalatest/scalatest#1427 - really there should be migration info when JUnitXmlReportPlugin was added) I stared to test should run sbt's reporter or ScalaTest's.

  • When running with 1.1.6 our CI reported that we have 1318 tests, it combined both reports with TEST- and without and removed duplicates.
  • When disabled sbt's writer test count dropped to 1235 (which is correct).
  • When running only sbt.JUnitXmlTestsListener test count dropped to 1233.

Problem is is that test names having dot in them are splitted and only last part is written to XML, and couple of test names ended in domain name and only net was written to file. (and again CI removes duplicates).

There is quite many test classes containing dot and caused previously extra 83 tests reported as names where different.

expectation

Test names in JUnitXmlTestsListener not to be truncated.

notes

https://github.com/sbt/sbt/blob/develop/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala#L117

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions