Goby3 3.7.0
2026.11.12
Loading...
Searching...
No Matches
test_tool_config.proto
Go to the documentation of this file.
1// Copyright 2026:
2// GobySoft, LLC (2013-)
3// Community contributors (see AUTHORS file)
4// File authors:
5// Toby Schneider <toby@gobysoft.org>
6//
7//
8// This file is part of the Goby Underwater Autonomy Project Binaries
9// ("The Goby Binaries").
10//
11// The Goby Binaries are free software: you can redistribute them and/or modify
12// them under the terms of the GNU General Public License as published by
13// the Free Software Foundation, either version 2 of the License, or
14// (at your option) any later version.
15//
16// The Goby Binaries are distributed in the hope that they will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with Goby. If not, see <http://www.gnu.org/licenses/>.
23syntax = "proto2";
24import "goby/middleware/protobuf/app_config.proto";
25import "goby/middleware/protobuf/layer.proto";
26import "goby/middleware/protobuf/pubsub_test.proto";
27import "goby/protobuf/option_extensions.proto";
28import "goby/udpm/protobuf/interprocess_config.proto";
29import "goby/zeromq/protobuf/interprocess_config.proto";
30
31package goby.apps.middleware.protobuf;
32
33message TestToolConfig
34{
35 option (goby.msg).cfg.tool = {
36 is_tool: true
37 has_subtools: true
38 has_help_action: true
39 };
40
41 optional goby.middleware.protobuf.AppConfig app = 1
42 [(goby.field) = { cfg { action: DEVELOPER } }];
43
44 enum Action
45 {
46 help = 0 [(goby.ev).cfg = {
47 short_help_msg: "Print usage information",
48 full_help_msg: "Usage: \"goby test help [action]\"\n"
49 }];
50 run = 1 [(goby.ev).cfg = {
51 short_help_msg: "Run a test file against a running (or fixture-launched) system"
52 }];
53 validate = 2 [(goby.ev).cfg = {
54 short_help_msg: "Check a test file without running it"
55 }];
56 visualize = 3 [(goby.ev).cfg = {
57 short_help_msg: "Write the test plan as a Graphviz .dot graph"
58 }];
59 }
60 optional Action action = 2 [
61 default = help,
62 (goby.field) = {
63 description: "The action this tool should take [can omit --action if 1st parameter]",
64 cfg { position: { enable: true }, cli_short: "A", action: HIDDEN }
65 }
66 ];
67}
68
69// Contents of a test file (YAML, JSON or TextFormat)
70
71message TestEndpoint
72{
73 required string name = 1;
74 optional goby.middleware.protobuf.Layer layer = 2 [default = LAYER_INTERPROCESS];
75 oneof transport
76 {
77 goby.zeromq.protobuf.InterProcessPortalConfig zeromq = 3;
78 goby.udpm.protobuf.InterProcessPortalConfig udpm = 4;
79 }
80}
81
82message TestFixture
83{
84 required string name = 1;
85 required string command = 2 [(goby.field).description =
86 "Shell command (run with /bin/sh -c) in its own process group"];
87 optional string cwd = 3 [(goby.field).description =
88 "Working directory; a relative path resolves against the file "
89 "that declares the fixture, which is also the default"];
90 repeated string env = 4 [(goby.field).description = "Extra environment as NAME=value"];
91
92 message Ready
93 {
94 repeated string output_regex = 1 [(goby.field).description =
95 "Ready once each of these has matched a line of "
96 "output (stdout or stderr), in any order"];
97 optional double delay = 2 [
98 default = 0,
99 (goby.field).description = "Then wait this many more seconds"
100 ];
101 optional double timeout = 3 [
102 default = 30,
103 (goby.field).description = "Seconds allowed for every output_regex to match"
104 ];
105 }
106 optional Ready ready = 5 [(goby.field).description =
107 "When the fixture counts as ready; ready immediately if omitted"];
108
109 message Stop
110 {
111 optional string signal = 1 [
112 default = "SIGINT",
113 (goby.field).description = "First signal sent to the fixture's process group"
114 ];
115 optional double grace = 2 [
116 default = 10,
117 (goby.field).description = "Seconds to wait before escalating to SIGTERM, then SIGKILL"
118 ];
119 }
120 optional Stop stop = 6;
121}
122
123message TestFile
124{
125 repeated string include = 1 [(goby.field).description =
126 "Other test files merged before this one, relative to this "
127 "file"];
128 repeated string load_shared_library = 2
129 [(goby.field).description =
130 "Libraries with compiled Protobuf/DCCL messages, relative to this file"];
131 repeated TestEndpoint endpoint = 3
132 [(goby.field).description =
133 "Endpoints referenced by the test. One with neither 'zeromq' nor 'udpm' uses zeromq "
134 "when available, otherwise udpm. If none are declared, one named 'default' is "
135 "created."];
136 repeated TestFixture fixture = 4 [(goby.field).description =
137 "Commands started in order before the test and stopped "
138 "in reverse order after it"];
139 optional goby.middleware.protobuf.PubSubTest test = 5;
140}
141
142// Subcommand configuration
143
144message TestRunConfig
145{
146 option (goby.msg).cfg.tool = {
147 is_tool: true
148 has_subtools: false
149 has_help_action: false
150 };
151
152 optional goby.middleware.protobuf.AppConfig app = 1
153 [(goby.field) = { cfg { action: DEVELOPER } }];
154
155 optional goby.zeromq.protobuf.InterProcessPortalConfig zeromq = 2 [(goby.field) = {
156 description: "Default settings for zeromq endpoints; each endpoint's own 'zeromq' settings are layered on top",
157 cfg { env: "GOBY_INTERPROCESS" }
158 }];
159 optional goby.udpm.protobuf.InterProcessPortalConfig udpm = 3 [(goby.field) = {
160 description: "Default settings for udpm endpoints; each endpoint's own 'udpm' settings are layered on top"
161 }];
162
163 required string test_file = 10 [(goby.field) = {
164 description: "Test file: YAML (.yml/.yaml, when built with yaml-cpp), JSON (.json) or Protobuf TextFormat (other extensions)",
165 cfg { position: { enable: true } }
166 }];
167 repeated string define = 11 [(goby.field) = {
168 description: "Set a variable used as ${NAME} in the test file, as NAME=value; overrides the environment",
169 cfg { cli_short: "D" }
170 }];
171
172 repeated string load_shared_library = 20 [(goby.field) = {
173 description: "Load this shared library containing compiled Protobuf/DCCL messages.",
174 cfg { cli_short: "l" env: "GOBY_TOOL_LOAD_SHARED_LIBRARY" }
175 }];
176
177 enum OutputFormat
178 {
179 HUMAN = 1;
180 JSON = 2;
181 }
182 optional OutputFormat output_format = 30
183 [default = HUMAN, (goby.field) = { cfg { cli_short: "o" } }];
184 optional string output_file = 31
185 [(goby.field).description = "Write the report here instead of stdout"];
186 optional string log_dir = 32
187 [(goby.field).description =
188 "Directory for fixture output logs; a new temporary directory if omitted"];
189 optional uint32 repeat = 33 [
190 default = 1,
191 (goby.field).description =
192 "Run the whole test this many times with the fixtures left running; fails if any pass "
193 "fails"
194 ];
195}
196
197message TestValidateConfig
198{
199 option (goby.msg).cfg.tool = {
200 is_tool: true
201 has_subtools: false
202 has_help_action: false
203 };
204
205 optional goby.middleware.protobuf.AppConfig app = 1
206 [(goby.field) = { cfg { action: DEVELOPER } }];
207
208 required string test_file = 10 [(goby.field) = {
209 description: "Test file to check",
210 cfg { position: { enable: true } }
211 }];
212 repeated string define = 11 [(goby.field) = {
213 description: "Set a variable used as ${NAME} in the test file, as NAME=value; overrides the environment",
214 cfg { cli_short: "D" }
215 }];
216
217 repeated string load_shared_library = 20 [(goby.field) = {
218 description: "Load this shared library containing compiled Protobuf/DCCL messages.",
219 cfg { cli_short: "l" env: "GOBY_TOOL_LOAD_SHARED_LIBRARY" }
220 }];
221
222 optional TestRunConfig.OutputFormat output_format = 30
223 [default = HUMAN, (goby.field) = { cfg { cli_short: "o" } }];
224}
225
226message TestVisualizeConfig
227{
228 option (goby.msg).cfg.tool = {
229 is_tool: true
230 has_subtools: false
231 has_help_action: false
232 };
233
234 optional goby.middleware.protobuf.AppConfig app = 1
235 [(goby.field) = { cfg { action: DEVELOPER } }];
236
237 required string test_file = 10 [(goby.field) = {
238 description: "Test file to draw",
239 cfg { position: { enable: true } }
240 }];
241 repeated string define = 11 [(goby.field) = {
242 description: "Set a variable used as ${NAME} in the test file, as NAME=value; overrides the environment",
243 cfg { cli_short: "D" }
244 }];
245 optional string output_file = 31
246 [(goby.field).description = "Write the .dot graph here instead of stdout"];
247}