From 562433c8d02e8fa2f11990a087f77c4bab3693fd Mon Sep 17 00:00:00 2001 From: Joseph Brothers Date: Tue, 3 Sep 2024 16:53:15 -0600 Subject: [PATCH] fix newest test, rename a function and correct a comment --- .github/workflows/cli.yml | 2 +- openc3/bin/openc3cli | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index c1d105b704..bcc0a525ca 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -108,7 +108,7 @@ jobs: # list of script filenames on server contains a target folder name ./openc3.sh cliroot script list | grep -q "INST2" # spawning a script in a subfolder returns 0 and prints only a PID - ./openc3.sh cliroot script spawn INST/procedures/checks.rb | grep -q "^\s*\d+\s*$" + ./openc3.sh cliroot script spawn INST/procedures/checks.rb | grep -qv "^\s*\d+\s*$" # running a known good script with a wait value returns 0 and prints a success message ./openc3.sh cliroot script run --wait 10 INST/procedures/checks.rb | grep -q "script complete" - name: openc3.sh util save,load diff --git a/openc3/bin/openc3cli b/openc3/bin/openc3cli index 17be7fbb17..952241032f 100755 --- a/openc3/bin/openc3cli +++ b/openc3/bin/openc3cli @@ -660,7 +660,7 @@ def run_bridge(filename, params) end end -def script_monitor(script_id) +def cli_script_monitor(script_id) ret_code = ERROR_CODE require 'openc3/script' OpenC3::RunningScriptWebSocketApi.new(id: script_id) do |api| @@ -744,12 +744,12 @@ def cli_script_run(disconnect=false, environment={}, args=[]) id = script_run(args[0], disconnect: disconnect, environment: environment, scope: scope) # could raise $script_interrupt_text = " Script #{args[0]} still running remotely.\n" # for Ctrl-C if (wait_limit < 1) then - ret_code = script_monitor(id) + ret_code = cli_script_monitor(id) else Timeout::timeout(wait_limit, nil, "--wait #{wait_limit} exceeded") do - ret_code = script_monitor(id) + ret_code = cli_script_monitor(id) rescue Timeout::ExitException, Timeout::Error => tmoexcp - # Timeout exceptions are also thrown by the Websocket API, so we check + # Timeout exceptions are also raised by the Websocket API, so we check if tmoexcp.message =~ /^--wait / puts tmoexcp.message + ", detaching from running script #{args[0]}" else