Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac fixes #548

Merged
merged 2 commits into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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