diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/testing/TCServiceMessagesClient.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/testing/TCServiceMessagesClient.kt index 5cf378e441d..99ffb0ae09e 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/testing/TCServiceMessagesClient.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/testing/TCServiceMessagesClient.kt @@ -130,7 +130,8 @@ internal class TCServiceMessagesClient( results.failure( descriptor.id, KotlinTestFailure( - extractExceptionClassName(parsedStackTrace?.message ?: message.failureMessage), + (parsedStackTrace?.message ?: message.failureMessage)?.let { extractExceptionClassName(it) } + ?: "Unknown", message.failureMessage, stacktrace, patchStackTrace(this, parsedStackTrace?.stackTrace), diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/internal/RewriteSourceMapFilterReader.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/internal/RewriteSourceMapFilterReader.kt index 5196548eb2b..f1b2e00a4ab 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/internal/RewriteSourceMapFilterReader.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/internal/RewriteSourceMapFilterReader.kt @@ -141,7 +141,7 @@ open class RewriteSourceMapFilterReader( log.warn("Cannot rewrite paths in JavaScript source maps: $reason") } - private fun transformString(value: String): String = + protected open fun transformString(value: String): String = File(srcSourceRoot).resolve(value).canonicalFile.relativeToOrSelf(File(targetSourceRoot)).path override fun read(): Int { diff --git a/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/internal/testing/tcsmc/Complex.kt b/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/internal/testing/tcsmc/Complex.kt index 70f0dc4dd0b..d9c9f39b681 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/internal/testing/tcsmc/Complex.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/internal/testing/tcsmc/Complex.kt @@ -11,49 +11,49 @@ class Complex : TCServiceMessagesClientTest() { assertEvents( """ STARTED SUITE jsTest // jsTest - STARTED SUITE jsTest.my.company.product.MyTest // jsTest//my/company/product/MyTest + STARTED SUITE my.company.product.MyTest // jsTest//my/company/product/MyTest STARTED TEST displayName: myTest1, classDisplayName: MyTest, className: my.company.product.MyTest, name: myTest1 // jsTest//my/company/product/MyTest/my.company.product.MyTest.myTest1 COMPLETED SUCCESS // jsTest//my/company/product/MyTest/my.company.product.MyTest.myTest1 STARTED TEST displayName: myTest2, classDisplayName: MyTest, className: my.company.product.MyTest, name: myTest2 // jsTest//my/company/product/MyTest/my.company.product.MyTest.myTest2 - FAILURE null // jsTest//my/company/product/MyTest/my.company.product.MyTest.myTest2 + FAILURE // jsTest//my/company/product/MyTest/my.company.product.MyTest.myTest2 COMPLETED FAILURE // jsTest//my/company/product/MyTest/my.company.product.MyTest.myTest2 STARTED TEST displayName: myTest3, classDisplayName: MyTest, className: my.company.product.MyTest, name: myTest3 // jsTest//my/company/product/MyTest/my.company.product.MyTest.myTest3 COMPLETED SKIPPED // jsTest//my/company/product/MyTest/my.company.product.MyTest.myTest3 - STARTED SUITE jsTest.my.company.product.MyTest.MyTestNested // jsTest//my/company/product/MyTest/MyTestNested + STARTED SUITE my.company.product.MyTest.MyTestNested // jsTest//my/company/product/MyTest/MyTestNested STARTED TEST displayName: myTest4, classDisplayName: MyTestNested, className: my.company.product.MyTest.MyTestNested, name: myTest4 // jsTest//my/company/product/MyTest/MyTestNested/my.company.product.MyTest.MyTestNested.myTest4 COMPLETED SUCCESS // jsTest//my/company/product/MyTest/MyTestNested/my.company.product.MyTest.MyTestNested.myTest4 STARTED TEST displayName: myTest5, classDisplayName: MyTestNested, className: my.company.product.MyTest.MyTestNested, name: myTest5 // jsTest//my/company/product/MyTest/MyTestNested/my.company.product.MyTest.MyTestNested.myTest5 - FAILURE null // jsTest//my/company/product/MyTest/MyTestNested/my.company.product.MyTest.MyTestNested.myTest5 + FAILURE // jsTest//my/company/product/MyTest/MyTestNested/my.company.product.MyTest.MyTestNested.myTest5 COMPLETED FAILURE // jsTest//my/company/product/MyTest/MyTestNested/my.company.product.MyTest.MyTestNested.myTest5 STARTED TEST displayName: myTest6, classDisplayName: MyTestNested, className: my.company.product.MyTest.MyTestNested, name: myTest6 // jsTest//my/company/product/MyTest/MyTestNested/my.company.product.MyTest.MyTestNested.myTest6 COMPLETED SKIPPED // jsTest//my/company/product/MyTest/MyTestNested/my.company.product.MyTest.MyTestNested.myTest6 - STARTED SUITE jsTest.my.company.product.MyTest.MyTestNested.MyTestNestedNested // jsTest//my/company/product/MyTest/MyTestNested/MyTestNestedNested + STARTED SUITE my.company.product.MyTest.MyTestNested.MyTestNestedNested // jsTest//my/company/product/MyTest/MyTestNested/MyTestNestedNested STARTED TEST displayName: myTest7, classDisplayName: MyTestNestedNested, className: my.company.product.MyTest.MyTestNestedNested, name: myTest7 // jsTest//my/company/product/MyTest/MyTestNested/MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest7 COMPLETED SUCCESS // jsTest//my/company/product/MyTest/MyTestNested/MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest7 STARTED TEST displayName: myTest8, classDisplayName: MyTestNestedNested, className: my.company.product.MyTest.MyTestNestedNested, name: myTest8 // jsTest//my/company/product/MyTest/MyTestNested/MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest8 - FAILURE null // jsTest//my/company/product/MyTest/MyTestNested/MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest8 + FAILURE // jsTest//my/company/product/MyTest/MyTestNested/MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest8 COMPLETED FAILURE // jsTest//my/company/product/MyTest/MyTestNested/MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest8 STARTED TEST displayName: myTest9, classDisplayName: MyTestNestedNested, className: my.company.product.MyTest.MyTestNestedNested, name: myTest9 // jsTest//my/company/product/MyTest/MyTestNested/MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest9 COMPLETED SKIPPED // jsTest//my/company/product/MyTest/MyTestNested/MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest9 COMPLETED FAILURE // jsTest//my/company/product/MyTest/MyTestNested/MyTestNestedNested COMPLETED FAILURE // jsTest//my/company/product/MyTest/MyTestNested COMPLETED FAILURE // jsTest//my/company/product/MyTest - STARTED SUITE jsTest.my.company.product.MyTest2 // jsTest//my/company/product/MyTest2 + STARTED SUITE my.company.product.MyTest2 // jsTest//my/company/product/MyTest2 STARTED TEST displayName: myTest10, classDisplayName: MyTest2, className: my.company.product.MyTest2, name: myTest10 // jsTest//my/company/product/MyTest2/my.company.product.MyTest2.myTest10 COMPLETED SUCCESS // jsTest//my/company/product/MyTest2/my.company.product.MyTest2.myTest10 STARTED TEST displayName: myTest11, classDisplayName: MyTest2, className: my.company.product.MyTest2, name: myTest11 // jsTest//my/company/product/MyTest2/my.company.product.MyTest2.myTest11 - FAILURE null // jsTest//my/company/product/MyTest2/my.company.product.MyTest2.myTest11 + FAILURE // jsTest//my/company/product/MyTest2/my.company.product.MyTest2.myTest11 COMPLETED FAILURE // jsTest//my/company/product/MyTest2/my.company.product.MyTest2.myTest11 STARTED TEST displayName: myTest12, classDisplayName: MyTest2, className: my.company.product.MyTest2, name: myTest12 // jsTest//my/company/product/MyTest2/my.company.product.MyTest2.myTest12 COMPLETED SKIPPED // jsTest//my/company/product/MyTest2/my.company.product.MyTest2.myTest12 - STARTED SUITE jsTest.my.company.product.MyTest2.MyTest2Nested // jsTest//my/company/product/MyTest2/MyTest2Nested + STARTED SUITE my.company.product.MyTest2.MyTest2Nested // jsTest//my/company/product/MyTest2/MyTest2Nested STARTED TEST displayName: myTest13, classDisplayName: MyTestNested, className: my.company.product.MyTest2.MyTestNested, name: myTest13 // jsTest//my/company/product/MyTest2/MyTest2Nested/my.company.product.MyTest2.MyTestNested.myTest13 COMPLETED SKIPPED // jsTest//my/company/product/MyTest2/MyTest2Nested/my.company.product.MyTest2.MyTestNested.myTest13 STARTED TEST displayName: myTest14, classDisplayName: MyTestNested, className: my.company.product.MyTest2.MyTestNested, name: myTest14 // jsTest//my/company/product/MyTest2/MyTest2Nested/my.company.product.MyTest2.MyTestNested.myTest14 COMPLETED SKIPPED // jsTest//my/company/product/MyTest2/MyTest2Nested/my.company.product.MyTest2.MyTestNested.myTest14 STARTED TEST displayName: myTest15, classDisplayName: MyTestNested, className: my.company.product.MyTest2.MyTestNested, name: myTest15 // jsTest//my/company/product/MyTest2/MyTest2Nested/my.company.product.MyTest2.MyTestNested.myTest15 COMPLETED SKIPPED // jsTest//my/company/product/MyTest2/MyTest2Nested/my.company.product.MyTest2.MyTestNested.myTest15 - STARTED SUITE jsTest.my.company.product.MyTest2.MyTest2Nested.MyTest2NestedNested // jsTest//my/company/product/MyTest2/MyTest2Nested/MyTest2NestedNested + STARTED SUITE my.company.product.MyTest2.MyTest2Nested.MyTest2NestedNested // jsTest//my/company/product/MyTest2/MyTest2Nested/MyTest2NestedNested STARTED TEST displayName: myTest16, classDisplayName: MyTest2NestedNested, className: my.company.product.MyTest2.MyTest2NestedNested, name: myTest16 // jsTest//my/company/product/MyTest2/MyTest2Nested/MyTest2NestedNested/my.company.product.MyTest2.MyTest2NestedNested.myTest16 COMPLETED SKIPPED // jsTest//my/company/product/MyTest2/MyTest2Nested/MyTest2NestedNested/my.company.product.MyTest2.MyTest2NestedNested.myTest16 STARTED TEST displayName: myTest17, classDisplayName: MyTest2NestedNested, className: my.company.product.MyTest2.MyTest2NestedNested, name: myTest17 // jsTest//my/company/product/MyTest2/MyTest2Nested/MyTest2NestedNested/my.company.product.MyTest2.MyTest2NestedNested.myTest17 @@ -129,33 +129,33 @@ COMPLETED FAILURE // jsTest assertEvents( """ STARTED SUITE iosTest // iosTest - STARTED SUITE iosTest.my.company.product.MyTest // iosTest.my.company.product.MyTest + STARTED SUITE my.company.product.MyTest // iosTest/my.company.product.MyTest STARTED TEST displayName: myTest1, classDisplayName: MyTest, className: my.company.product.MyTest, name: myTest1 // iosTest/my.company.product.MyTest/my.company.product.MyTest.myTest1 COMPLETED SUCCESS // iosTest/my.company.product.MyTest/my.company.product.MyTest.myTest1 STARTED TEST displayName: myTest2, classDisplayName: MyTest, className: my.company.product.MyTest, name: myTest2 // iosTest/my.company.product.MyTest/my.company.product.MyTest.myTest2 - FAILURE null // iosTest/my.company.product.MyTest/my.company.product.MyTest.myTest2 + FAILURE // iosTest/my.company.product.MyTest/my.company.product.MyTest.myTest2 COMPLETED FAILURE // iosTest/my.company.product.MyTest/my.company.product.MyTest.myTest2 STARTED TEST displayName: myTest3, classDisplayName: MyTest, className: my.company.product.MyTest, name: myTest3 // iosTest/my.company.product.MyTest/my.company.product.MyTest.myTest3 COMPLETED SKIPPED // iosTest/my.company.product.MyTest/my.company.product.MyTest.myTest3 - STARTED SUITE iosTest.my.company.product.MyTest.MyTestNested // iosTest/my.company.product.MyTest.MyTestNested + STARTED SUITE my.company.product.MyTest.my.company.product.MyTest.MyTestNested // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested STARTED TEST displayName: myTest4, classDisplayName: MyTestNested, className: my.company.product.MyTest.MyTestNested, name: myTest4 // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.myTest4 COMPLETED SUCCESS // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.myTest4 STARTED TEST displayName: myTest5, classDisplayName: MyTestNested, className: my.company.product.MyTest.MyTestNested, name: myTest5 // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.myTest5 - FAILURE null // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.myTest5 + FAILURE // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.myTest5 COMPLETED FAILURE // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.myTest5 STARTED TEST displayName: myTest6, classDisplayName: MyTestNested, className: my.company.product.MyTest.MyTestNested, name: myTest6 // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.myTest6 COMPLETED SKIPPED // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.myTest6 - STARTED SUITE iosTest.my.company.product.MyTest.MyTestNested.my.company.product.MyTest.MyTestNested.MyTestNestedNested // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested.my.company.product.MyTest.MyTestNested.MyTestNestedNested + STARTED SUITE my.company.product.MyTest.my.company.product.MyTest.MyTestNested.my.company.product.MyTest.MyTestNested.MyTestNestedNested // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.MyTestNestedNested STARTED TEST displayName: myTest7, classDisplayName: MyTestNestedNested, className: my.company.product.MyTest.MyTestNestedNested, name: myTest7 // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest7 COMPLETED SUCCESS // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest7 STARTED TEST displayName: myTest8, classDisplayName: MyTestNestedNested, className: my.company.product.MyTest.MyTestNestedNested, name: myTest8 // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest8 - FAILURE null // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest8 + FAILURE // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest8 COMPLETED FAILURE // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest8 STARTED TEST displayName: myTest9, classDisplayName: MyTestNestedNested, className: my.company.product.MyTest.MyTestNestedNested, name: myTest9 // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest9 COMPLETED SKIPPED // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.MyTestNestedNested/my.company.product.MyTest.MyTestNestedNested.myTest9 - COMPLETED FAILURE // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested.my.company.product.MyTest.MyTestNested.MyTestNestedNested - COMPLETED FAILURE // iosTest/my.company.product.MyTest.MyTestNested - COMPLETED FAILURE // iosTest.my.company.product.MyTest + COMPLETED FAILURE // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.MyTestNestedNested + COMPLETED FAILURE // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested + COMPLETED FAILURE // iosTest/my.company.product.MyTest COMPLETED FAILURE // iosTest """.trimIndent() ) { diff --git a/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/internal/testing/tcsmc/TestFailureTest.kt b/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/internal/testing/tcsmc/TestFailureTest.kt index aaaf1bc40e8..b3c1a452c4b 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/internal/testing/tcsmc/TestFailureTest.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/internal/testing/tcsmc/TestFailureTest.kt @@ -17,8 +17,8 @@ class TestFailureTest : TCServiceMessagesClientTest() { assertEvents( """ STARTED SUITE root // root - STARTED SUITE // root. - STARTED TEST displayName: Test, classDisplayName: , className: , name: Test // root..Test + STARTED SUITE // root/ + STARTED TEST displayName: Test, classDisplayName: , className: , name: Test // root//Test FAILURE AssertionError: Expected value to be true. at AssertionError_init_0 (mpplib2/build/tmp/expandedArchives/kotlin-stdlib-js-1.3-SNAPSHOT.jar_730a1b227513cf16a9b639e009a985fc/kotlin/exceptions.kt:102:37) at DefaultJsAsserter.failWithMessage_0 (mpplib2/build/tmp/expandedArchives/kotlin-test-js-1.3-SNAPSHOT.jar_d60f1e6d0dd94843a03bf98a569bbb73/src/main/kotlin/kotlin/test/DefaultJsAsserter.kt:80:19) @@ -29,9 +29,9 @@ STARTED SUITE root // root at mpplib2/build/js_test_node_modules/mpplib2_test.js:59:38 at Object.fn [as test] (mpplib2/build/tmp/expandedArchives/src/KotlinTestRunner.ts:12:25) at Object.test (mpplib2/build/tmp/expandedArchives/src/KotlinTestTeamCityReporter.ts:80:28) - at test (mpplib2/build/tmp/expandedArchives/kotlin-test-js-1.3-SNAPSHOT.jar_d60f1e6d0dd94843a03bf98a569bbb73/src/main/kotlin/kotlin/test/TestApi.kt:57:15) // root..Test - COMPLETED FAILURE // root..Test - COMPLETED FAILURE // root. + at test (mpplib2/build/tmp/expandedArchives/kotlin-test-js-1.3-SNAPSHOT.jar_d60f1e6d0dd94843a03bf98a569bbb73/src/main/kotlin/kotlin/test/TestApi.kt:57:15) // root//Test + COMPLETED FAILURE // root//Test + COMPLETED FAILURE // root/ COMPLETED FAILURE // root """ ) { @@ -67,22 +67,10 @@ COMPLETED FAILURE // root assertEvents( """ STARTED SUITE root // root - STARTED SUITE // root. - STARTED TEST displayName: Test, classDisplayName: , className: , name: Test // root..Test - StdOut[AssertionError: Expected value to be true. - at AssertionError_init_0 (mpplib2/build/tmp/expandedArchives/kotlin-stdlib-js-1.3-SNAPSHOT.jar_730a1b227513cf16a9b639e009a985fc/kotlin/exceptions.kt:102:37) - at DefaultJsAsserter.failWithMessage_0 (mpplib2/build/tmp/expandedArchives/kotlin-test-js-1.3-SNAPSHOT.jar_d60f1e6d0dd94843a03bf98a569bbb73/src/main/kotlin/kotlin/test/DefaultJsAsserter.kt:80:19) - at DefaultJsAsserter.assertTrue_o10pc4${'$'} (mpplib2/build/tmp/expandedArchives/kotlin-test-js-1.3-SNAPSHOT.jar_d60f1e6d0dd94843a03bf98a569bbb73/src/main/kotlin/kotlin/test/DefaultJsAsserter.kt:60:13) - at DefaultJsAsserter.assertTrue_4mavae${'$'} (mpplib2/build/tmp/expandedArchives/kotlin-test-js-1.3-SNAPSHOT.jar_d60f1e6d0dd94843a03bf98a569bbb73/src/main/kotlin/kotlin/test/DefaultJsAsserter.kt:67:9) - at assertTrue_0 (mpplib2/build/tmp/expandedArchives/kotlin-test-js-1.3-SNAPSHOT.jar_d60f1e6d0dd94843a03bf98a569bbb73/Assertions.kt:36:21) - at SampleTestsJS.testHello (mpplib2/src/jsTest/kotlin/sample/SampleTestsJS.kt:9:9) - at mpplib2/build/js_test_node_modules/mpplib2_test.js:59:38 - at Object.fn [as test] (mpplib2/build/tmp/expandedArchives/src/KotlinTestRunner.ts:12:25) - at Object.test (mpplib2/build/tmp/expandedArchives/src/KotlinTestTeamCityReporter.ts:80:28) - at test (mpplib2/build/tmp/expandedArchives/kotlin-test-js-1.3-SNAPSHOT.jar_d60f1e6d0dd94843a03bf98a569bbb73/src/main/kotlin/kotlin/test/TestApi.kt:57:15) -] // root..Test + STARTED SUITE // root/ + STARTED TEST displayName: Test, classDisplayName: , className: , name: Test // root//Test FAILURE Expected <7>, actual <42> -nullAssertionError: Expected value to be true. +AssertionError: Expected value to be true. at AssertionError_init_0 (mpplib2/build/tmp/expandedArchives/kotlin-stdlib-js-1.3-SNAPSHOT.jar_730a1b227513cf16a9b639e009a985fc/kotlin/exceptions.kt:102:37) at DefaultJsAsserter.failWithMessage_0 (mpplib2/build/tmp/expandedArchives/kotlin-test-js-1.3-SNAPSHOT.jar_d60f1e6d0dd94843a03bf98a569bbb73/src/main/kotlin/kotlin/test/DefaultJsAsserter.kt:80:19) at DefaultJsAsserter.assertTrue_o10pc4${'$'} (mpplib2/build/tmp/expandedArchives/kotlin-test-js-1.3-SNAPSHOT.jar_d60f1e6d0dd94843a03bf98a569bbb73/src/main/kotlin/kotlin/test/DefaultJsAsserter.kt:60:13) @@ -93,9 +81,9 @@ nullAssertionError: Expected value to be true. at Object.fn [as test] (mpplib2/build/tmp/expandedArchives/src/KotlinTestRunner.ts:12:25) at Object.test (mpplib2/build/tmp/expandedArchives/src/KotlinTestTeamCityReporter.ts:80:28) at test (mpplib2/build/tmp/expandedArchives/kotlin-test-js-1.3-SNAPSHOT.jar_d60f1e6d0dd94843a03bf98a569bbb73/src/main/kotlin/kotlin/test/TestApi.kt:57:15) - // root..Test - COMPLETED FAILURE // root..Test - COMPLETED FAILURE // root. + // root//Test + COMPLETED FAILURE // root//Test + COMPLETED FAILURE // root/ COMPLETED FAILURE // root """ ) { diff --git a/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/internal/testing/tcsmc/TestNameParsing.kt b/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/internal/testing/tcsmc/TestNameParsing.kt index 19afc3d8a6c..dfe8ca1dc0b 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/internal/testing/tcsmc/TestNameParsing.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/internal/testing/tcsmc/TestNameParsing.kt @@ -11,8 +11,8 @@ class TestNameParsing: TCServiceMessagesClientTest() { fun testFqn() { assertEvents(""" STARTED SUITE root // root - STARTED TEST displayName: myMethod, classDisplayName: MyTest, className: my.company.product.MyTest, name: myMethod // root.my.company.product.MyTest.myMethod - COMPLETED SUCCESS // root.my.company.product.MyTest.myMethod + STARTED TEST displayName: myMethod, classDisplayName: MyTest, className: my.company.product.MyTest, name: myMethod // root/my.company.product.MyTest.myMethod + COMPLETED SUCCESS // root/my.company.product.MyTest.myMethod COMPLETED SUCCESS // root """) { serviceMessage(TestStarted("my.company.product.MyTest.myMethod", false, null)) @@ -24,8 +24,8 @@ COMPLETED SUCCESS // root fun testSimpleClassName() { assertEvents(""" STARTED SUITE root // root - STARTED TEST displayName: myMethod, classDisplayName: MyTest, className: MyTest, name: myMethod // root.MyTest.myMethod - COMPLETED SUCCESS // root.MyTest.myMethod + STARTED TEST displayName: myMethod, classDisplayName: MyTest, className: MyTest, name: myMethod // root/MyTest.myMethod + COMPLETED SUCCESS // root/MyTest.myMethod COMPLETED SUCCESS // root """) { serviceMessage(TestStarted("MyTest.myMethod", false, null)) @@ -37,10 +37,10 @@ COMPLETED SUCCESS // root fun testParentSuite() { assertEvents(""" STARTED SUITE root // root - STARTED SUITE MyTest // root.MyTest - STARTED TEST displayName: myMethod, classDisplayName: MyTest, className: MyTest, name: myMethod // root.MyTest.myMethod - COMPLETED SUCCESS // root.MyTest.myMethod - COMPLETED SUCCESS // root.MyTest + STARTED SUITE MyTest // root/MyTest + STARTED TEST displayName: myMethod, classDisplayName: MyTest, className: MyTest, name: myMethod // root/MyTest/myMethod + COMPLETED SUCCESS // root/MyTest/myMethod + COMPLETED SUCCESS // root/MyTest COMPLETED SUCCESS // root """) { serviceMessage(TestSuiteStarted("MyTest")) @@ -54,8 +54,8 @@ COMPLETED SUCCESS // root fun testAlone() { assertEvents(""" STARTED SUITE root // root - STARTED TEST displayName: myMethod, classDisplayName: root, className: root, name: myMethod // root.myMethod - COMPLETED SUCCESS // root.myMethod + STARTED TEST displayName: myMethod, classDisplayName: root, className: root, name: myMethod // root/myMethod + COMPLETED SUCCESS // root/myMethod COMPLETED SUCCESS // root """) { serviceMessage(TestStarted("myMethod", false, null)) diff --git a/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/org/jetbrains/kotlin/gradle/targets/js/internal/RewriteSourceMapFilterReaderTest.kt b/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/org/jetbrains/kotlin/gradle/targets/js/internal/RewriteSourceMapFilterReaderTest.kt index efdc31cc18d..542a2788580 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/org/jetbrains/kotlin/gradle/targets/js/internal/RewriteSourceMapFilterReaderTest.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/test/kotlin/org/jetbrains/kotlin/gradle/org/jetbrains/kotlin/gradle/targets/js/internal/RewriteSourceMapFilterReaderTest.kt @@ -33,7 +33,7 @@ class RewriteSourceMapFilterReaderTest { private fun sample(mappings: String, addToProlog: String): String { //language=JSON - return """{"version":3,"file":"single-platform${addToProlog}.js","sources":["../../../../src/main/kotlin/main.kt"],"sourcesContent":[null],"names":[],"mappings":"$mappings"}""" + return """{"version":3,"file":"single-platform${addToProlog}.js","sources":["SOURCE"],"sourcesContent":[null],"names":[],"mappings":"$mappings"}""" } private fun doTest(repeatMappings: Int, addToProlog: String = "") { @@ -43,15 +43,11 @@ class RewriteSourceMapFilterReaderTest { "QACqC,KAAb,WAAhB,oBAAgB,CAAa,UAAK,WAAL,CADrC,C;EAWJ,C;;;;;;;;;" val mappings = mappings0.repeat(repeatMappings) - val filter = RewriteSourceMapFilterReader( - StringReader(sample(mappings, addToProlog)), - "/root/build/classes/kotlin/test/", - "/root/build/test_node_modules/" - ) + val filter = RewriteSourceMapFilterReaderMock(StringReader(sample(mappings, addToProlog)), "", "") assertEquals( //language=JSON - """{"version":3,"file":"single-platform${addToProlog}.js","sources":["../../src/main/kotlin/main.kt"],"sourcesContent":[null],"names":[],"mappings":"$mappings"}""", + """{"version":3,"file":"single-platform${addToProlog}.js","sources":["TRANSFORMED(SOURCE)"],"sourcesContent":[null],"names":[],"mappings":"$mappings"}""", filter.readText() ) } @@ -151,15 +147,11 @@ class RewriteSourceMapFilterReaderTest { override fun warnUnsupported(reason: String) { warning = reason } - } -} -private fun RewriteSourceMapFilterReader( - input: Reader, - srcSourceRoot: String, - targetSourceRoot: String -) = RewriteSourceMapFilterReader(input).also { - setProperties(it, srcSourceRoot, targetSourceRoot) + override fun transformString(value: String): String { + return "TRANSFORMED($value)" + } + } } private fun setProperties(