diff --git a/common/src/main/kotlin/flank/common/PathHelper.kt b/common/src/main/kotlin/flank/common/PathHelper.kt index 52d0852a69..00fc869d1b 100644 --- a/common/src/main/kotlin/flank/common/PathHelper.kt +++ b/common/src/main/kotlin/flank/common/PathHelper.kt @@ -8,8 +8,11 @@ val currentPath = Paths.get("") val rootDirectoryPath = goToRoot(currentPath) val rootDirectoryPathString = rootDirectoryPath.toString() -fun goToRoot(startPath: Path): Path = - if (startPath.isRoot()) startPath.toAbsolutePath() else goToRoot(startPath.toAbsolutePath().parent) +tailrec fun goToRoot(startPath: Path): Path = when { + startPath.isRoot() -> startPath.toAbsolutePath() + startPath.toAbsolutePath().parent == null -> startPath.toAbsolutePath() + else -> goToRoot(startPath.toAbsolutePath().parent) +} fun Path.isRoot() = Files.exists(Paths.get(toString(), "settings.gradle.kts")) diff --git a/test_runner/src/main/kotlin/ftl/run/exception/ExceptionHandler.kt b/test_runner/src/main/kotlin/ftl/run/exception/ExceptionHandler.kt index 0775c36901..a72f6986b0 100644 --- a/test_runner/src/main/kotlin/ftl/run/exception/ExceptionHandler.kt +++ b/test_runner/src/main/kotlin/ftl/run/exception/ExceptionHandler.kt @@ -75,8 +75,8 @@ internal fun withGlobalExceptionHandling(block: () -> Int, exitProcessFunction: // We need to cover the case where some component in the call stack starts a non-daemon // thread, and then throws an Error that kills the main thread. This is extra safe implementation else -> { - t.report() t.printStackTrace() + t.report() exitProcessFunction(UNEXPECTED_ERROR) } } diff --git a/test_runner/src/main/kotlin/ftl/util/CrashReporter.kt b/test_runner/src/main/kotlin/ftl/util/CrashReporter.kt index 6029e451db..a999755ede 100644 --- a/test_runner/src/main/kotlin/ftl/util/CrashReporter.kt +++ b/test_runner/src/main/kotlin/ftl/util/CrashReporter.kt @@ -1,7 +1,6 @@ package ftl.util import flank.common.config.isTest -import ftl.log.setDebugLogging import io.sentry.Sentry import java.io.File import java.util.UUID @@ -50,7 +49,6 @@ private fun initializeCrashReportWrapper() { Sentry.init { it.dsn = FLANK_API_KEY it.release = readRevision() - setDebugLogging(true) } setCrashReportTag( SESSION_ID to sessionId,