-
Notifications
You must be signed in to change notification settings - Fork 20
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
MalformedInputException seen when running forked JUnit5 tests. #100
Comments
Excerpt from Test / testOptions += Tests.Argument(jupiterTestFramework, "-q"),
Test / testGrouping := {
val tests = (Test / definedTests).value
tests
.groupBy(_.name)
.map { case (groupName, group) =>
new Group(
groupName,
group,
SubProcess(
(Test / forkOptions).value
.withRunJVMOptions(
Vector(
s"-Dtrials.runDatabase=trialsRunDatabaseForGroup$groupName"
)
)
.withOutputStrategy(
OutputStrategy.CustomOutput(OutputStream.nullOutputStream)
)
)
)
}
.toSeq
},
Global / concurrentRestrictions := Seq(Tags.limit(Tags.ForkedTestGroup, 6)),
Test / fork := true,
Test / testForkedParallel := false,
....
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.19" % Test,
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.18.0" % Test,
libraryDependencies += "org.scalatestplus" %% "scalacheck-1-16" % "3.2.14.0" % Test,
libraryDependencies += "org.mockito" % "mockito-core" % "5.12.0" % Test,
libraryDependencies += "org.mockito" % "mockito-junit-jupiter" % "5.12.0" % Test,
libraryDependencies += "com.github.seregamorph" % "hamcrest-more-matchers" % "0.1" % Test,
libraryDependencies += "com.github.sbt.junit" % "jupiter-interface" % JupiterKeys.jupiterVersion.value % Test,
libraryDependencies ++= Seq(
"org.junit.platform" % "junit-platform-runner" % "1.11.0" % Test,
"org.junit.jupiter" % "junit-jupiter-engine" % "5.11.0" % Test
),
libraryDependencies += "org.hamcrest" % "hamcrest" % "3.0" % Test,
libraryDependencies += "com.eed3si9n.expecty" %% "expecty" % "0.16.0" % Test
addDependencyTreePlugin
addSbtPlugin("com.github.sbt.junit" % "sbt-jupiter-interface" % "0.13.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.11.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.1.0") |
Also seen in version 0.12.0. I shall try to debug into this with a local build / minimize the failure. |
This is being thrown as part of saving the XML for the test suite result. An excerpt from this shows: <testcase classname="com.sageserpent.americium.java.examples.junit5.DemonstrateJUnit5Integration" name="casesUsingACountedStrategy(long):20" time="0.001">
</testcase>
<testcase classname="com.sageserpent.americium.java.examples.junit5.DemonstrateJUnit5Integration" name="casesUsingACountedStrategy(long):21" time="0.001">
</testcase>
<testcase classname="com.sageserpent.americium.java.examples.junit5.DemonstrateJUnit5Integration" name="casesUsingACountedStrategy(long):22" time="0.001">
</testcase>
<testcase classname="com.sageserpent.americium.java.examples.junit5.DemonstrateJUnit5Integration" name="casesUsingACountedStrategy(long):23" time="0.001">
</testcase>
<system-out/>
<system-err/>
</testsuite> The exception is thrown down in Looking at the char buffer being encoded, we have:
The dynamic test names generated include test parameter values that are non UTF-8 strings; I'm assuming this is causing the problem. |
Presumably the changes made in https://github.com/sbt/sbt-jupiter-interface/pull/94/files#diff-114898290f2f9ece1e9a21ec71f569775778ad0464e713a10ec28771a4f9ca29 as part of the 0.12.0 release started passing the full test names down to saving the XML? This would then expose them to the invocation here: https://github.com/sbt/sbt/blob/aaa68883aab4b3eb65de954253e9765cd09d7c36/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala#L262 using UTF-8. |
Tweaking the project definition in I'll leave this issue open in case it's of wider interest, but feel free to close it otherwise. |
Bug first seen in upgrade to version 0.13.0 (was 0.11.4 for last successful build).
Repository - Americium
Observed in Git commit SHA: 36f61a49a58c29fa083385924bf372334b2ba42f
Log of failing build: https://github.com/sageserpent-open/americium/runs/28895471763
This is also reproducible locally.
The text was updated successfully, but these errors were encountered: