diff --git a/release_notes.md b/release_notes.md index 4e0f477f9a..3265d95ed3 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,5 +1,5 @@ -## v4.1 -- ? +## v4.1 (unreleased) +- `app`, `test`, and `xctestrun-file` now support `~`, environment variables, and globs (`*`, `**`) when resolving paths. #386 ## v4.0.0 diff --git a/test_runner/src/main/kotlin/ftl/args/ArgsFileVisitor.kt b/test_runner/src/main/kotlin/ftl/args/ArgsFileVisitor.kt index 24d0100ac8..3a76311684 100644 --- a/test_runner/src/main/kotlin/ftl/args/ArgsFileVisitor.kt +++ b/test_runner/src/main/kotlin/ftl/args/ArgsFileVisitor.kt @@ -39,15 +39,11 @@ class ArgsFileVisitor(glob: String) : SimpleFileVisitor() { fun walk(searchPath: Path): List { val searchString = searchPath.toString() // /Users/tmp/code/flank/test_app/** => /Users/tmp/code/flank/test_app/ + // /Users/tmp/code/* => /Users/tmp/code/ val beforeGlob = Paths.get(searchString.substringBefore(SINGLE_GLOB)) // must not follow links when resolving paths or /tmp turns into /private/tmp val realPath = beforeGlob.toRealPath(LinkOption.NOFOLLOW_LINKS) - - val searchDepth = if (searchString.contains(RECURSE)) { - Integer.MAX_VALUE - } else { - 1 - } + val searchDepth = if (searchString.contains(RECURSE)) Integer.MAX_VALUE else 1 Files.walkFileTree(realPath, EnumSet.of(FileVisitOption.FOLLOW_LINKS), searchDepth, this) return this.result diff --git a/test_runner/src/test/kotlin/ftl/args/AndroidArgsFileTest.kt b/test_runner/src/test/kotlin/ftl/args/AndroidArgsFileTest.kt index 35f1b63953..6a8152886d 100644 --- a/test_runner/src/test/kotlin/ftl/args/AndroidArgsFileTest.kt +++ b/test_runner/src/test/kotlin/ftl/args/AndroidArgsFileTest.kt @@ -17,7 +17,6 @@ import org.junit.contrib.java.lang.system.SystemErrRule import org.junit.contrib.java.lang.system.SystemOutRule import org.junit.rules.ExpectedException import org.junit.runner.RunWith -import java.io.File import ftl.test.util.TestHelper.absolutePath @RunWith(FlankTestRunner::class) diff --git a/test_runner/src/test/kotlin/ftl/args/ArgsHelperFilePathTest.kt b/test_runner/src/test/kotlin/ftl/args/ArgsHelperFilePathTest.kt index f5e36d07af..95a04c3fb3 100644 --- a/test_runner/src/test/kotlin/ftl/args/ArgsHelperFilePathTest.kt +++ b/test_runner/src/test/kotlin/ftl/args/ArgsHelperFilePathTest.kt @@ -97,7 +97,6 @@ class ArgsHelperFilePathTest { Truth.assertThat(actual).isEqualTo(expected) } - @Test(expected = RuntimeException::class) fun wildCardsInFileNameWithMultipleMatches() { makeTmpFile("/tmp/tmp1/app-debug.apk") @@ -106,7 +105,6 @@ class ArgsHelperFilePathTest { ArgsHelper.evaluateFilePath(inputPath) } - @Test(expected = RuntimeException::class) fun wildCardsInFilePathWithMultipleMatches() { makeTmpFile("/tmp/tmp1/tmp2/tmp3/app-debug.apk")