From baf79318ff6ee30f7af470f0035ac997151f718a Mon Sep 17 00:00:00 2001 From: Brandon Fergerson Date: Tue, 23 Aug 2022 11:59:43 +0400 Subject: [PATCH] test: applyImmediately wip --- .../developer/instrument/AddBreakpoint.kt | 5 ++++- .../kotlin/integration/AddBreakpointCLI.kt | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 src/test/kotlin/integration/AddBreakpointCLI.kt diff --git a/src/main/kotlin/spp/cli/commands/developer/instrument/AddBreakpoint.kt b/src/main/kotlin/spp/cli/commands/developer/instrument/AddBreakpoint.kt index d1adb8f..8779575 100644 --- a/src/main/kotlin/spp/cli/commands/developer/instrument/AddBreakpoint.kt +++ b/src/main/kotlin/spp/cli/commands/developer/instrument/AddBreakpoint.kt @@ -22,6 +22,7 @@ import com.apollographql.apollo3.api.json.MapJsonWriter import com.github.ajalt.clikt.core.CliktCommand import com.github.ajalt.clikt.parameters.arguments.argument import com.github.ajalt.clikt.parameters.options.default +import com.github.ajalt.clikt.parameters.options.flag import com.github.ajalt.clikt.parameters.options.option import com.github.ajalt.clikt.parameters.types.enum import com.github.ajalt.clikt.parameters.types.int @@ -49,6 +50,7 @@ class AddBreakpoint : CliktCommand(name = "breakpoint", help = "Add a live break val throttleLimit by option("-throttleLimit", "-t", help = "Trigger throttle limit").int().default(1) val throttleStep by option("-throttleStep", "-s", help = "Trigger throttle step").enum() .default(ThrottleStep.SECOND) + val applyImmediately by option("-applyImmediately", "-a", help = "Apply immediately").flag() override fun run() = runBlocking { val input = LiveBreakpointInput( @@ -60,7 +62,8 @@ class AddBreakpoint : CliktCommand(name = "breakpoint", help = "Add a live break InstrumentThrottleInput( throttleLimit, spp.cli.protocol.type.ThrottleStep.valueOf(throttleStep.toString()) ) - ) + ), + applyImmediately = Optional.Present(applyImmediately) ) val response = try { apolloClient.mutation(AddLiveBreakpointMutation(input)).execute() diff --git a/src/test/kotlin/integration/AddBreakpointCLI.kt b/src/test/kotlin/integration/AddBreakpointCLI.kt new file mode 100644 index 0000000..9026f84 --- /dev/null +++ b/src/test/kotlin/integration/AddBreakpointCLI.kt @@ -0,0 +1,20 @@ +/* + * Source++, the open-source live coding platform. + * Copyright (C) 2022 CodeBrig, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package integration + +class AddBreakpointCLI : CLIIntegrationTest() { +}