diff --git a/test_runner/src/main/kotlin/ftl/config/FtlConstants.kt b/test_runner/src/main/kotlin/ftl/config/FtlConstants.kt index 9e752bea5f..b72c6e9972 100644 --- a/test_runner/src/main/kotlin/ftl/config/FtlConstants.kt +++ b/test_runner/src/main/kotlin/ftl/config/FtlConstants.kt @@ -27,8 +27,13 @@ import org.slf4j.LoggerFactory object FtlConstants { var useMock = false - // depending on environment, it's not always "Mac OS X" - val macOS: Boolean = (System.getProperty("os.name") ?: "").toLowerCase().indexOf("mac") >= 0 + + val macOS: Boolean by lazy { + val osName = System.getProperty("os.name") ?: "" + val isMacOS = osName.toLowerCase().indexOf("mac") >= 0 + println("isMacOS = $isMacOS ($osName)") + isMacOS + } const val localhost = "http://localhost:8080" const val defaultLocale = "en" diff --git a/test_runner/src/main/kotlin/ftl/run/TestRunner.kt b/test_runner/src/main/kotlin/ftl/run/TestRunner.kt index d6c7378cc6..69a3842bf1 100644 --- a/test_runner/src/main/kotlin/ftl/run/TestRunner.kt +++ b/test_runner/src/main/kotlin/ftl/run/TestRunner.kt @@ -143,7 +143,9 @@ object TestRunner { val resultsFile = Paths.get(args.localResultDir).toFile() if (!resultsFile.exists()) return null - val scheduledRuns = resultsFile.listFiles().filter { it.isDirectory }.sortedBy { it.lastModified() } + val scheduledRuns = resultsFile.listFiles() + .filter { it.isDirectory } + .sortedByDescending { it.lastModified() } if (scheduledRuns.isEmpty()) return null return scheduledRuns.first().name