diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt index e6ce643a3e..4dab99c334 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt @@ -1,5 +1,6 @@ package ftl.presentation.cli +import ftl.presentation.cli.auth.LoginCommand import ftl.util.PrintHelp import picocli.CommandLine.Command @@ -8,7 +9,7 @@ import picocli.CommandLine.Command synopsisHeading = "%n", header = ["Manage oauth2 credentials for Google Cloud"], subcommands = [ - ftl.presentation.cli.auth.LoginCommand::class + LoginCommand::class ], usageHelpAutoWidth = true ) diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt index 2fbfff75c3..382acc1f87 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt @@ -1,5 +1,6 @@ package ftl.presentation.cli.firebase +import ftl.presentation.cli.firebase.test.AndroidCommand import ftl.presentation.cli.firebase.test.IPBlocksCommand import ftl.presentation.cli.firebase.test.IosCommand import ftl.presentation.cli.firebase.test.NetworkProfilesCommand @@ -11,7 +12,7 @@ import picocli.CommandLine.Command name = "test", synopsisHeading = "", subcommands = [ - ftl.presentation.cli.firebase.test.AndroidCommand::class, + AndroidCommand::class, IosCommand::class, NetworkProfilesCommand::class, ProvidedSoftwareCommand::class, diff --git a/test_runner/src/test/kotlin/Debug.kt b/test_runner/src/test/kotlin/Debug.kt index c026a1edd2..0dee0ecb24 100644 --- a/test_runner/src/test/kotlin/Debug.kt +++ b/test_runner/src/test/kotlin/Debug.kt @@ -18,7 +18,7 @@ fun main() { ?: "YOUR PROJECT ID" withGlobalExceptionHandling { - CommandLine(ftl.presentation.cli.MainCommand()).execute( + CommandLine(MainCommand()).execute( // "--debug", "firebase", "test", diff --git a/test_runner/src/test/kotlin/ftl/MainTest.kt b/test_runner/src/test/kotlin/ftl/MainTest.kt index a084d999e1..7179cc028f 100644 --- a/test_runner/src/test/kotlin/ftl/MainTest.kt +++ b/test_runner/src/test/kotlin/ftl/MainTest.kt @@ -40,7 +40,7 @@ class MainTest { private fun runCommand(vararg args: String): String { systemErrRule.clearLog() systemOutRule.clearLog() - CommandLine(ftl.presentation.cli.MainCommand()).execute(*args) + CommandLine(MainCommand()).execute(*args) return systemOutRule.log.normalizeLineEnding() + systemErrRule.log.normalizeLineEnding() } diff --git a/test_runner/src/test/kotlin/ftl/cli/AuthCommandTest.kt b/test_runner/src/test/kotlin/ftl/cli/AuthCommandTest.kt index de03eea44f..fd54b565e8 100644 --- a/test_runner/src/test/kotlin/ftl/cli/AuthCommandTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/AuthCommandTest.kt @@ -2,6 +2,7 @@ package ftl.cli import com.google.common.truth.Truth.assertThat import flank.common.normalizeLineEnding +import ftl.presentation.cli.AuthCommand import ftl.test.util.FlankTestRunner import org.junit.Rule import org.junit.Test @@ -16,7 +17,7 @@ class AuthCommandTest { @Test fun firebaseCommandPrintsHelp() { - ftl.presentation.cli.AuthCommand().run() + AuthCommand().run() val output = systemOutRule.log.normalizeLineEnding() assertThat(output).startsWith( "Manage oauth2 credentials for Google Cloud\n\n" + diff --git a/test_runner/src/test/kotlin/ftl/cli/FirebaseCommandTest.kt b/test_runner/src/test/kotlin/ftl/cli/FirebaseCommandTest.kt index 720cc1519c..79ccdcebb7 100644 --- a/test_runner/src/test/kotlin/ftl/cli/FirebaseCommandTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/FirebaseCommandTest.kt @@ -2,6 +2,7 @@ package ftl.cli import com.google.common.truth.Truth.assertThat import flank.common.normalizeLineEnding +import ftl.presentation.cli.FirebaseCommand import ftl.test.util.FlankTestRunner import org.junit.Rule import org.junit.Test @@ -16,7 +17,7 @@ class FirebaseCommandTest { @Test fun firebaseCommandPrintsHelp() { - ftl.presentation.cli.FirebaseCommand().run() + FirebaseCommand().run() val output = systemOutRule.log.normalizeLineEnding() assertThat(output).startsWith( "firebase [COMMAND]\n" + diff --git a/test_runner/src/test/kotlin/ftl/cli/auth/LoginCommandTest.kt b/test_runner/src/test/kotlin/ftl/cli/auth/LoginCommandTest.kt index 19fc591672..e9d5a31c98 100644 --- a/test_runner/src/test/kotlin/ftl/cli/auth/LoginCommandTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/auth/LoginCommandTest.kt @@ -2,6 +2,7 @@ package ftl.cli.auth import com.google.common.truth.Truth.assertThat import flank.common.normalizeLineEnding +import ftl.presentation.cli.auth.LoginCommand import ftl.test.util.FlankTestRunner import org.junit.Rule import org.junit.Test @@ -21,7 +22,7 @@ class LoginCommandTest { @Test fun cancelCommandPrintsHelp() { - val command = ftl.presentation.cli.auth.LoginCommand() + val command = LoginCommand() assertThat(command.usageHelpRequested).isFalse() CommandLine(command).execute("-h") @@ -39,12 +40,12 @@ login [-h] @Test fun commandRuns() { - ftl.presentation.cli.auth.LoginCommand().run() + LoginCommand().run() } @Test fun cancelCommandOptions() { - val cmd = ftl.presentation.cli.auth.LoginCommand() + val cmd = LoginCommand() assertThat(cmd.usageHelpRequested).isFalse() cmd.usageHelpRequested = true assertThat(cmd.usageHelpRequested).isTrue() diff --git a/test_runner/src/test/kotlin/ftl/cli/firebase/CancelCommandTest.kt b/test_runner/src/test/kotlin/ftl/cli/firebase/CancelCommandTest.kt index 2cdedd499e..183434ff8f 100644 --- a/test_runner/src/test/kotlin/ftl/cli/firebase/CancelCommandTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/firebase/CancelCommandTest.kt @@ -2,6 +2,7 @@ package ftl.cli.firebase import com.google.common.truth.Truth.assertThat import flank.common.normalizeLineEnding +import ftl.presentation.cli.firebase.CancelCommand import ftl.presentation.cli.firebase.test.android.AndroidRunCommand import ftl.test.util.FlankTestRunner import org.junit.Rule @@ -18,7 +19,7 @@ class CancelCommandTest { @Test fun cancelCommandPrintsHelp() { - val command = ftl.presentation.cli.firebase.CancelCommand() + val command = CancelCommand() assertThat(command.usageHelpRequested).isFalse() CommandLine(command).execute("-h") @@ -46,14 +47,14 @@ class CancelCommandTest { val runCmd = AndroidRunCommand() runCmd.configPath = "./src/test/kotlin/ftl/fixtures/simple-android-flank.yml" runCmd.run() - ftl.presentation.cli.firebase.CancelCommand().run() + CancelCommand().run() val output = systemOutRule.log assertThat(output).contains("No matrices to cancel") } @Test fun cancelCommandOptions() { - val cmd = ftl.presentation.cli.firebase.CancelCommand() + val cmd = CancelCommand() assertThat(cmd.usageHelpRequested).isFalse() cmd.usageHelpRequested = true assertThat(cmd.usageHelpRequested).isTrue() diff --git a/test_runner/src/test/kotlin/ftl/cli/firebase/RefreshCommandTest.kt b/test_runner/src/test/kotlin/ftl/cli/firebase/RefreshCommandTest.kt index 2748bd0985..680d59a053 100644 --- a/test_runner/src/test/kotlin/ftl/cli/firebase/RefreshCommandTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/firebase/RefreshCommandTest.kt @@ -2,6 +2,7 @@ package ftl.cli.firebase import com.google.common.truth.Truth.assertThat import flank.common.normalizeLineEnding +import ftl.presentation.cli.firebase.RefreshCommand import ftl.test.util.FlankTestRunner import org.junit.Rule import org.junit.Test @@ -64,7 +65,7 @@ class RefreshCommandTest { @Test fun refreshCommandPrintsHelp() { - val refresh = ftl.presentation.cli.firebase.RefreshCommand() + val refresh = RefreshCommand() assertThat(refresh.usageHelpRequested).isFalse() CommandLine(refresh).execute("-h") @@ -91,7 +92,7 @@ class RefreshCommandTest { fun refreshCommandRuns() { // TODO: ':' is an illegal character on windows setupResultsDir() - val cmd = ftl.presentation.cli.firebase.RefreshCommand() + val cmd = RefreshCommand() cmd.usageHelpRequested cmd.run() val output = systemOutRule.log @@ -100,7 +101,7 @@ class RefreshCommandTest { @Test fun refreshCommandOptions() { - val cmd = ftl.presentation.cli.firebase.RefreshCommand() + val cmd = RefreshCommand() assertThat(cmd.usageHelpRequested).isFalse() cmd.usageHelpRequested = true assertThat(cmd.usageHelpRequested).isTrue() diff --git a/test_runner/src/test/kotlin/ftl/cli/firebase/TestCommandTest.kt b/test_runner/src/test/kotlin/ftl/cli/firebase/TestCommandTest.kt index 4750a50f80..2a91d1141c 100644 --- a/test_runner/src/test/kotlin/ftl/cli/firebase/TestCommandTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/firebase/TestCommandTest.kt @@ -2,6 +2,7 @@ package ftl.cli.firebase import com.google.common.truth.Truth.assertThat import flank.common.normalizeLineEnding +import ftl.presentation.cli.firebase.TestCommand import ftl.test.util.FlankTestRunner import org.junit.Rule import org.junit.Test @@ -16,7 +17,7 @@ class TestCommandTest { @Test fun testCommandPrintsHelp() { - ftl.presentation.cli.firebase.TestCommand().run() + TestCommand().run() val output = systemOutRule.log.normalizeLineEnding() assertThat(output).startsWith( "test [COMMAND]\n" + diff --git a/test_runner/src/test/kotlin/ftl/test/util/TestHelper.kt b/test_runner/src/test/kotlin/ftl/test/util/TestHelper.kt index cbdd9ad658..f4bf28694b 100644 --- a/test_runner/src/test/kotlin/ftl/test/util/TestHelper.kt +++ b/test_runner/src/test/kotlin/ftl/test/util/TestHelper.kt @@ -66,4 +66,4 @@ internal fun assertThrowsWithMessage(clazz: KClass, message: assertThrows(clazz.java) { block() }.also { assertTrue(it.message?.contains(message) ?: false) } } -internal fun runMainCommand(vararg args: String) = CommandLine(ftl.presentation.cli.MainCommand()).execute(*args) +internal fun runMainCommand(vararg args: String) = CommandLine(MainCommand()).execute(*args)