From b9b2570222e24b7ea998c07c905226b4cc883143 Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Fri, 26 Apr 2019 03:56:48 -0400 Subject: [PATCH 1/2] Update FtlConstants.kt --- test_runner/src/main/kotlin/ftl/config/FtlConstants.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test_runner/src/main/kotlin/ftl/config/FtlConstants.kt b/test_runner/src/main/kotlin/ftl/config/FtlConstants.kt index 9e752bea5f..e6f420bd48 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 isMac = osName.toLowerCase().indexOf("mac") >= 0 + println("isMacOS = $isMac ($osName)") + isMac + } const val localhost = "http://localhost:8080" const val defaultLocale = "en" From 30f9028cde739f44e82a7f8e80c57d4413c58faf Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Fri, 26 Apr 2019 04:03:34 -0400 Subject: [PATCH 2/2] Fix flank cancel --- test_runner/src/main/kotlin/ftl/config/FtlConstants.kt | 6 +++--- test_runner/src/main/kotlin/ftl/run/TestRunner.kt | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test_runner/src/main/kotlin/ftl/config/FtlConstants.kt b/test_runner/src/main/kotlin/ftl/config/FtlConstants.kt index e6f420bd48..b72c6e9972 100644 --- a/test_runner/src/main/kotlin/ftl/config/FtlConstants.kt +++ b/test_runner/src/main/kotlin/ftl/config/FtlConstants.kt @@ -30,9 +30,9 @@ object FtlConstants { val macOS: Boolean by lazy { val osName = System.getProperty("os.name") ?: "" - val isMac = osName.toLowerCase().indexOf("mac") >= 0 - println("isMacOS = $isMac ($osName)") - isMac + val isMacOS = osName.toLowerCase().indexOf("mac") >= 0 + println("isMacOS = $isMacOS ($osName)") + isMacOS } const val localhost = "http://localhost:8080" 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