Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@ jobs:
./openc3.sh cli script running | tee /dev/tty | grep -q "INST/procedures/checks.rb"
# run a script that will complete successfully
./openc3.sh cli script run INST/procedures/stash.rb | tee /dev/tty | grep "script complete"
# run a suite
./openc3.sh cli script run INST/procedures/my_script_suite.rb --suite MySuite | tee /dev/tty | grep "script complete"
# run a group
./openc3.sh cli script run INST2/procedures/my_script_suite.py --suite MySuite --group ExampleGroup | tee /dev/tty | grep "script complete"
# run a group setup
./openc3.sh cli script run INST/procedures/my_script_suite.rb --suite MySuite --group ExampleGroup --method setup | tee /dev/tty | grep "script complete"
# run a group teardown
./openc3.sh cli script run INST2/procedures/my_script_suite.py --suite MySuite --group ExampleGroup --method teardown | tee /dev/tty | grep "script complete"
# run a script
./openc3.sh cli script run INST/procedures/my_script_suite.rb --suite MySuite --group ExampleGroup --script script_2 | tee /dev/tty | grep "script complete"
# Removing due to write tmp/.docker_temp_3200699358: no space left on device
# - name: openc3.sh util save,load
# shell: 'script -q -e -c "bash {0}"'
Expand Down
61 changes: 60 additions & 1 deletion docs.openc3.com/docs/getting-started/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ EXAMPLE/cmd_tlm/example_tlm.txt

### Spawn

The ID of the spawned script is returned. You can connect to it in Script Runner by visiting `http://localhost:2900/tools/scriptrunner/1` where the final value is the ID.
The ID of the spawned script is returned. You can connect to it in Script Runner by visiting `http://localhost:2900/tools/scriptrunner/1` where the final value is the ID. For available options see `Run`.

```bash
% openc3.sh cli script spawn INST/procedures/checks.rb
Expand Down Expand Up @@ -140,6 +140,65 @@ script complete
%
```

You can also run Test Runner suites by passing the `--suite SUITE`, `--group GROUP`, and `--script SCRIPT` options as shown below. Pass the `--method` option to run `--method setup` or `--method teardown`. The default is `--method start`. In addition you can pass an `--options` argument to control the flags set in the Test Runner GUI. See the CLI help for more information.

```bash
% openc3.sh cli script run INST2/procedures/my_script_suite.py --suite MySuite --group ExampleGroup --script script_2
Filename INST2/procedures/my_script_suite.py scope DEFAULT
Filename INST2/procedures/my_script_suite.py scope
Filename INST2/procedures/utilities/clear.py scope
Filename INST2/procedures/my_script_suite.py scope
At [INST2/procedures/my_script_suite.py:48] state [running]
At [INST2/procedures/my_script_suite.py:49] state [running]
2025-07-31T04:45:31.284707Z (SCRIPTRUNNER): Script config/DEFAULT/targets/INST2/procedures/my_script_suite.py spawned in 0.0043256282806396484 seconds <python 3.12.11 (main, Jun 9 2025, 08:58:11) [GCC 14.2.0]>
2025-07-31T04:45:31.310253Z (SCRIPTRUNNER): Starting script: my_script_suite.py, line_delay = 0.1
2025-07-31T04:45:31.310949Z (my_script_suite.py:0): 2025-07-31T04:45:31.310253Z (SCRIPTRUNNER): Starting script: my_script_suite.py, line_delay = 0.1
Filename INST2/procedures/my_script_suite.py scope
At [INST2/procedures/my_script_suite.py:21] state [running]
2025-07-31T04:45:31.415640Z (my_script_suite.py:21): Running None:ExampleGroup:script_2
At [INST2/procedures/my_script_suite.py:24] state [running]
2025-07-31T04:45:31.516645Z (my_script_suite.py:24): This test verifies requirement 2
At [INST2/procedures/my_script_suite.py:25] state [running]
At [INST2/procedures/my_script_suite.py:35] state [running]
At [INST2/procedures/my_script_suite.py:36] state [running]
2025-07-31T04:45:31.822472Z (my_script_suite.py:36): help
At [INST2/procedures/my_script_suite.py:37] state [running]
At [INST2/procedures/my_script_suite.py:40] state [running]
At [INST2/procedures/my_script_suite.py:26] state [running]
At [INST2/procedures/my_script_suite.py:26] state [waiting]
At [INST2/procedures/my_script_suite.py:26] state [waiting]
2025-07-31T04:45:34.129293Z (my_script_suite.py:26): WAIT: 2.0 seconds with actual time of 2.001 seconds
2025-07-31T04:45:34.131468Z (SCRIPTRUNNER): Script completed: INST2/procedures/my_script_suite.py
At [INST2/procedures/my_script_suite.py:0] state [completed]
{"report"=>
"--- Script Report ---\n" +
"\n" +
"Settings:\n" +
"Manual = False\n" +
"Pause on Error = False\n" +
"Continue After Error = True\n" +
"Abort After Error = False\n" +
"Loop = False\n" +
"Break Loop On Error = False\n" +
"\n" +
"Results:\n" +
"2025-07-31T04:45:31.314286Z: Executing MySuite:ExampleGroup:script_2 \n" +
"2025-07-31T04:45:34.130958Z: ExampleGroup:script_2:PASS\n" +
" This test verifies requirement 2\n" +
" \n" +
"2025-07-31T04:45:34.132814Z: Completed MySuite:ExampleGroup:script_2 \n" +
"\n" +
"--- Test Summary ---\n" +
"\n" +
"Run Time: 2.8185291290283203\n" +
"Total Tests: 1\n" +
"Pass: 1\n" +
"Skip: 0\n" +
"Fail: 0\n",
"type"=>"report"}
script complete
```

### Running (since 6.5.0)

List all the running scripts. Add the --verbose option to print the raw output.
Expand Down
Loading
Loading