exercism / kotlin-test-runner

GNU Affero General Public License v3.0
4 stars 11 forks source link

Error running transpose tests #61

Open ErikSchierboom opened 5 months ago

ErikSchierboom commented 5 months ago

When running the tests for the transpose exercise with the following code:

object Transpose {

     fun transpose(input: List<String>): List<String> {
        val longestLength = input.map { it.length }.max()
        return List(longestLength) { index -> 
            input
                .map { it.padEnd(longestLength) }
                .map { it[index] }
                .joinToString(separator = "")
        }.map { it.trimEnd() }
    }
}

The test runner fails with:

Picked up JAVA_TOOL_OPTIONS: -Xss128m -Xms256m -Xmx2G -XX:+UseG1GC
Exception in thread "main" java.lang.NullPointerException: attribute(...) must not be null
    at utils.junit.ParserKt.get(parser.kt:97)
    at utils.junit.ParserKt.asError(parser.kt:51)
    at utils.junit.ParserKt.asTestCase(parser.kt:37)
    at utils.junit.ParserKt.asTestSuit(parser.kt:26)
    at utils.junit.ParserKt.parseJUnit4Results(parser.kt:14)
    at exercism.kotlin.autotests.executor.ExecutorKt.buildExecutionResult(executor.kt:101)
    at exercism.kotlin.autotests.executor.ExecutorKt.executor(executor.kt:12)
    at exercism.kotlin.autotests.runner.MainKt$main$result$1.invoke(main.kt:28)
    at exercism.kotlin.autotests.runner.MainKt$main$result$1.invoke(main.kt:28)
    at exercism.kotlin.autotests.executor.EnvironmentKt.executeOnEnvironment(environment.kt:16)
    at exercism.kotlin.autotests.runner.MainKt.main(main.kt:28)

@ErwinOlie Do you have any idea?

ErwinOlie commented 5 months ago

There seems to be a problem with parsing the junit4 test report. Can you post the content of the TESTsomething.xml file which is produced after running the test?

ErikSchierboom commented 5 months ago

I don't see the test file. Where should that be located?

ErikSchierboom commented 3 months ago

@ErwinOlie I can't see the file. Where is it written to the file system?

ErwinOlie commented 3 months ago

It should be somewhere in the /build/ directory after trying to run the test. I'm not sure about the exact location

ErikSchierboom commented 3 months ago

@ErwinOlie I don't see it. Maybe it isn't created because of the error?