-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
Add test reporter for Kotlin/JS #3757
Add test reporter for Kotlin/JS #3757
Conversation
056e76e
to
a2e69e5
Compare
Yes let's give the new method a new name to preserve binary compatibility. The old one returning |
acbacdd
to
0eb561c
Compare
Seems like some of the |
0eb561c
to
6d4a4fb
Compare
Oh, yeah, indeed, thank for spotting it. I was thinking it was a flaky test from This is the case where type safety cannot be checked during the compile time, because Fixed now. |
} | ||
|
||
val moduleKind = this.moduleKind() | ||
protected[js] def runJsBinary( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer the name runKotlinJsBinary
, since chances are high the user project may also have some Scala.JS or other JS modules.
@@ -457,7 +475,9 @@ trait KotlinJsModule extends KotlinModule { outer => | |||
|
|||
override def testFramework = "" | |||
|
|||
override def kotlinJSBinaryKind: T[Option[BinaryKind]] = Some(BinaryKind.Executable) | |||
override def kotlinJSRunTarget: T[Option[RunTarget]] = outer.kotlinJSRunTarget() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
override def kotlinJSRunTarget: T[Option[RunTarget]] = outer.kotlinJSRunTarget() | |
override def kotlinJsRunTarget: T[Option[RunTarget]] = outer.kotlinJsRunTarget() |
@@ -20,6 +22,7 @@ object KotlinJsKotlinTestPackageModuleTests extends TestSuite { | |||
|
|||
object foo extends KotlinJsModule { | |||
def kotlinVersion = KotlinJsKotlinTestPackageModuleTests.kotlinVersion | |||
override def kotlinJSRunTarget = Some(RunTarget.Node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
override def kotlinJSRunTarget = Some(RunTarget.Node) | |
override def kotlinJsRunTarget = Some(RunTarget.Node) |
This PR adds test reporter for Kotlin/JS. It is based on XUnit reporter provided by Mocha - XML will be generated anyway, irrespective of the
TestModule.testReportXml
option, because structured output is needed in order to be able to parse it.So as a result it will be XML file + test result message, which can be seen in the tests.
Adding HTML reporter is not yet possible without using 3rd party packages, because the one provided OOTB by Mocha is not intended for CLI usage.
I also had to modify the
Jvm.runSubprocess
method, so it doesn't throw if exit code is not 0, but returns result. To comply with the old behavior, all the old call sites will just callgetOrThrow
on the result.This change is needed, because if there is a test failure,
node
process will exit with code 1, but we still need to process and catching genericException
is not an option (because maybe it is not because of the exit code).Upd: Binary compatibility check now complains that
Jvm.runSubprocess
has a different return type, but I'm not sure if it should be a problem, because before it was simply returningUnit
. But if it is a problem, I can introduce a new method instead.