Skip to content

Commit

Permalink
Mac fixes (#548)
Browse files Browse the repository at this point in the history
* Update FtlConstants.kt

* Fix flank cancel
  • Loading branch information
bootstraponline authored Apr 26, 2019
1 parent 9839cfa commit 7adfc8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions test_runner/src/main/kotlin/ftl/config/FtlConstants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion test_runner/src/main/kotlin/ftl/run/TestRunner.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7adfc8a

Please sign in to comment.