From dda87c9f8740f8b6d738ba7a799e908eb2c67698 Mon Sep 17 00:00:00 2001 From: Sunil-plsr Date: Fri, 1 Feb 2019 17:49:03 -0600 Subject: [PATCH] Issue #484: Name with ':' breaks in windows --- test_runner/src/main/kotlin/ftl/util/Utils.kt | 2 +- test_runner/src/test/kotlin/ftl/util/UtilsTest.kt | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/test_runner/src/main/kotlin/ftl/util/Utils.kt b/test_runner/src/main/kotlin/ftl/util/Utils.kt index b315499cc5..b167140105 100644 --- a/test_runner/src/main/kotlin/ftl/util/Utils.kt +++ b/test_runner/src/main/kotlin/ftl/util/Utils.kt @@ -69,7 +69,7 @@ object Utils { val instant = Instant.now() bucketName.append( - DateTimeFormatter.ofPattern("yyyy-MM-dd_HH:mm:ss.") + DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss.") .withZone(ZoneOffset.UTC) .format(instant) ) diff --git a/test_runner/src/test/kotlin/ftl/util/UtilsTest.kt b/test_runner/src/test/kotlin/ftl/util/UtilsTest.kt index 6a01bffe98..d5c26a1c2f 100644 --- a/test_runner/src/test/kotlin/ftl/util/UtilsTest.kt +++ b/test_runner/src/test/kotlin/ftl/util/UtilsTest.kt @@ -23,6 +23,19 @@ class UtilsTest { assertThat(Utils.readTextResource("version.txt")).isNotNull() } + @Test + fun uniqueObjectName_verifyPattern() { + val randomName = Utils.uniqueObjectName() + assertThat(randomName.length).isEqualTo(32) + assertThat(randomName[4]).isEqualTo('-') + assertThat(randomName[7]).isEqualTo('-') + assertThat(randomName[10]).isEqualTo('_') + assertThat(randomName[13]).isEqualTo('-') + assertThat(randomName[16]).isEqualTo('-') + assertThat(randomName[19]).isEqualTo('.') + assertThat(randomName[26]).isEqualTo('_') + } + @Test fun testExitCodeForFailed() { val testExecutions = listOf(