2// GobySoft, LLC (2013-)
3// Community contributors (see AUTHORS file)
5// Toby Schneider <toby@gobysoft.org>
8// This file is part of the Goby Underwater Autonomy Project Binaries
9// ("The Goby Binaries").
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.
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.
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/>.
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";
31package goby.apps.middleware.protobuf;
35 option (goby.msg).cfg.tool = {
41 optional goby.middleware.protobuf.AppConfig app = 1
42 [(goby.field) = { cfg { action: DEVELOPER } }];
46 help = 0 [(goby.ev).cfg = {
47 short_help_msg: "Print usage information",
48 full_help_msg: "Usage: \"goby test help [action]\"\n"
50 run = 1 [(goby.ev).cfg = {
51 short_help_msg: "Run a test file against a running (or fixture-launched) system"
53 validate = 2 [(goby.ev).cfg = {
54 short_help_msg: "Check a test file without running it"
56 visualize = 3 [(goby.ev).cfg = {
57 short_help_msg: "Write the test plan as a Graphviz .dot graph"
60 optional Action action = 2 [
63 description: "The action this tool should take [can omit --action if 1st parameter]",
64 cfg { position: { enable: true }, cli_short: "A", action: HIDDEN }
69// Contents of a test file (YAML, JSON or TextFormat)
73 required string name = 1;
74 optional goby.middleware.protobuf.Layer layer = 2 [default = LAYER_INTERPROCESS];
77 goby.zeromq.protobuf.InterProcessPortalConfig zeromq = 3;
78 goby.udpm.protobuf.InterProcessPortalConfig udpm = 4;
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"];
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 [
99 (goby.field).description = "Then wait this many more seconds"
101 optional double timeout = 3 [
103 (goby.field).description = "Seconds allowed for every output_regex to match"
106 optional Ready ready = 5 [(goby.field).description =
107 "When the fixture counts as ready; ready immediately if omitted"];
111 optional string signal = 1 [
113 (goby.field).description = "First signal sent to the fixture's process group"
115 optional double grace = 2 [
117 (goby.field).description = "Seconds to wait before escalating to SIGTERM, then SIGKILL"
120 optional Stop stop = 6;
125 repeated string include = 1 [(goby.field).description =
126 "Other test files merged before this one, relative to this "
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 "
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;
142// Subcommand configuration
146 option (goby.msg).cfg.tool = {
149 has_help_action: false
152 optional goby.middleware.protobuf.AppConfig app = 1
153 [(goby.field) = { cfg { action: DEVELOPER } }];
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" }
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"
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 } }
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" }
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" }
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 [
191 (goby.field).description =
192 "Run the whole test this many times with the fixtures left running; fails if any pass "
197message TestValidateConfig
199 option (goby.msg).cfg.tool = {
202 has_help_action: false
205 optional goby.middleware.protobuf.AppConfig app = 1
206 [(goby.field) = { cfg { action: DEVELOPER } }];
208 required string test_file = 10 [(goby.field) = {
209 description: "Test file to check",
210 cfg { position: { enable: true } }
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" }
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" }
222 optional TestRunConfig.OutputFormat output_format = 30
223 [default = HUMAN, (goby.field) = { cfg { cli_short: "o" } }];
226message TestVisualizeConfig
228 option (goby.msg).cfg.tool = {
231 has_help_action: false
234 optional goby.middleware.protobuf.AppConfig app = 1
235 [(goby.field) = { cfg { action: DEVELOPER } }];
237 required string test_file = 10 [(goby.field) = {
238 description: "Test file to draw",
239 cfg { position: { enable: true } }
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" }
245 optional string output_file = 31
246 [(goby.field).description = "Write the .dot graph here instead of stdout"];