-
Notifications
You must be signed in to change notification settings - Fork 12
/
messages.proto
592 lines (519 loc) · 21.2 KB
/
messages.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
/*----------------------------------------------------------------
* Copyright (c) ThoughtWorks, Inc.
* Licensed under the Apache License, Version 2.0
* See LICENSE in the project root for license information.
*----------------------------------------------------------------*/
// The comments are exported to Markdown, hence they may contain markdown syntax and cross-refs.
syntax = "proto3";
package gauge.messages;
option csharp_namespace = "Gauge.Messages";
option java_package = "com.thoughtworks.gauge";
option go_package = "github.com/getgauge/gauge-proto/go/gauge_messages";
import "spec.proto";
/// Default request. Tells the runner to shutdown.
message KillProcessRequest {
}
/// Sends to any request which needs a execution status as response
/// usually step execution, hooks etc will return this
message ExecutionStatusResponse {
/// Holds the suite result after suite execution done.
gauge.messages.ProtoExecutionResult executionResult = 1;
}
/// Sent at start of Suite Execution. Tells the runner to execute `before_suite` hook.
message ExecutionStartingRequest {
/// Holds the current suite execution info.
ExecutionInfo currentExecutionInfo = 1;
/// Holds the suite result in execution starting.
/// Some fields will not be populated before execution.
gauge.messages.ProtoSuiteResult suiteResult = 2;
int32 stream = 3;
}
/// Sent at end of Suite Execution. Tells the runner to execute `after_suite` hook.
message ExecutionEndingRequest {
/// Holds the current suite execution info.
ExecutionInfo currentExecutionInfo = 1;
/// Holds the suite result in execution ending.
gauge.messages.ProtoSuiteResult suiteResult = 2;
int32 stream = 3;
}
/// Sent at start of Spec Execution. Tells the runner to execute `before_spec` hook.
message SpecExecutionStartingRequest {
/// Holds the current spec execution info.
ExecutionInfo currentExecutionInfo = 1;
/// Holds the specs result in spec execution starting.
/// Some fields will not be populated before execution.
gauge.messages.ProtoSpecResult specResult = 2;
int32 stream = 3;
}
/// Sent at end of Spec Execution. Tells the runner to execute `after_spec` hook.
message SpecExecutionEndingRequest {
/// Holds the current spec execution info.
ExecutionInfo currentExecutionInfo = 1;
/// Holds the specs result in spec execution ending.
gauge.messages.ProtoSpecResult specResult = 2;
int32 stream = 3;
}
/// Sent at start of Scenario Execution. Tells the runner to execute `before_scenario` hook.
message ScenarioExecutionStartingRequest {
/// Holds the current sceanrio execution info.
ExecutionInfo currentExecutionInfo = 1;
/// Holds the scenarion result in scenarion execution starting.
/// Some fields will not be populated before execution.
gauge.messages.ProtoScenarioResult scenarioResult = 2;
int32 stream = 3;
}
/// Sent at end of Scenario Execution. Tells the runner to execute `after_scenario` hook.
message ScenarioExecutionEndingRequest {
/// Holds the current scenario execution info.
ExecutionInfo currentExecutionInfo = 1;
gauge.messages.ProtoScenarioResult scenarioResult = 2;
int32 stream = 3;
}
/// Sent at start of Step Execution. Tells the runner to execute `before_step` hook.
message StepExecutionStartingRequest {
/// Holds the current step execution info.
ExecutionInfo currentExecutionInfo = 1;
/// Holds step result in step execution starting.
/// Some fields will not be populated before execution.
gauge.messages.ProtoStepResult stepResult = 2;
int32 stream = 3;
}
/// Sent at end of Step Execution. Tells the runner to execute `after_step` hook.
message StepExecutionEndingRequest {
/// Holds the current step execution info.
ExecutionInfo currentExecutionInfo = 1;
/// Holds step result in step execution ending.
gauge.messages.ProtoStepResult stepResult = 2;
int32 stream = 3;
}
/// Sent at start of Concept Execution.
message ConceptExecutionStartingRequest {
/// Holds the current step execution info.
ExecutionInfo currentExecutionInfo = 1;
/// Holds step result in step execution starting.
/// Some fields will not be populated before execution.
gauge.messages.ProtoStepResult stepResult = 2;
int32 stream = 3;
}
/// Sent at end of Concept Execution.
message ConceptExecutionEndingRequest {
/// Holds the current step execution info.
ExecutionInfo currentExecutionInfo = 1;
/// Holds step result in step execution ending.
gauge.messages.ProtoStepResult stepResult = 2;
int32 stream = 3;
}
/// Contains command line arguments which passed by user during execution.
message ExecutionArg {
/// Holds the flag name passed from command line.
string flagName = 1;
/// Holds the flag value passed from command line.
repeated string flagValue = 2;
}
/// Contains details of the execution.
/// Depending on the context (Step, Scenario, Spec or Suite), the respective fields are set.
message ExecutionInfo {
/// Holds the information of the current Spec. Valid in context of Spec execution.
SpecInfo currentSpec = 1;
/// Holds the information of the current Scenario. Valid in context of Scenario execution.
ScenarioInfo currentScenario = 2;
/// Holds the information of the current Step. Valid in context of Step execution.
StepInfo currentStep = 3;
/// Stacktrace of the execution. Valid only if there is an error in execution.
string stacktrace = 4;
/// Holds the project name
string projectName = 5;
/// Holds the command line arguments.
repeated ExecutionArg ExecutionArgs = 6;
/// Holds the number of running execution streams.
int32 numberOfExecutionStreams = 7;
/// Holds the runner id for parallel execution.
int32 runnerId = 8;
}
/// Contains details of the Spec execution.
message SpecInfo {
/// Name of the current Spec being executed.
string name = 1;
/// Full File path containing the current Spec being executed.
string fileName = 2;
/// Flag to indicate if the current Spec execution failed.
bool isFailed = 3;
/// Tags relevant to the current Spec execution.
repeated string tags = 4;
}
/// Contains details of the Scenario execution.
message ScenarioInfo {
/// Name of the current Scenario being executed.
string name = 1;
/// Flag to indicate if the current Scenario execution failed.
bool isFailed = 2;
/// Tags relevant to the current Scenario execution.
repeated string tags = 3;
/// Retries info
ScenarioRetriesInfo retries = 4;
}
/// Contains details of the Scenario repeat execution.
message ScenarioRetriesInfo {
// Maximum retries. Related to '--max-retries-count' run parameter
int32 maxRetries = 1;
// Current retry attempt. It's 0 for the normal first run
int32 currentRetry = 2;
}
/// Contains details of the Step execution.
message StepInfo {
/// The current request to execute Step
ExecuteStepRequest step = 1;
/// Flag to indicate if the current Step execution failed.
bool isFailed = 2;
/// The current stack trace in case of failure
string stackTrace = 3;
/// The error message in case of failure
string errorMessage = 4;
}
/// Request sent ot the runner to Execute a Step
message ExecuteStepRequest {
/// Contains the actual text of the Step being executed.
/// This contains the parameters as defined in the Spec.
string actualStepText = 1;
/// Contains the parsed text of the Step being executed.
/// The paramters are replaced with placeholders.
string parsedStepText = 2;
/// Flag to indicate if the execution of the Scenario, containing the current Step, failed.
bool scenarioFailing = 3;
/// Collection of parameters applicable to the current Step.
repeated gauge.messages.Parameter parameters = 4;
int32 stream = 5;
}
/// Request sent ot the runner to check if given Step is valid.
/// The runner should check if there is an implementation defined for the given Step Text.
message StepValidateRequest {
/// The text is used to lookup Step implementation
string stepText = 1;
/// The number of paramters in the Step
int32 numberOfParameters = 2;
///This is use to generate step implementation template
gauge.messages.ProtoStepValue stepValue = 3;
}
/// Response of StepValidateRequest.
/// The runner tells the caller if the Request was valid,
/// i.e. an implementation exists for given Step text.
/// Returns an error message if it is an error response.
message StepValidateResponse {
enum ErrorType {
STEP_IMPLEMENTATION_NOT_FOUND = 0;
DUPLICATE_STEP_IMPLEMENTATION = 1;
}
bool isValid = 1;
string errorMessage = 2;
ErrorType errorType = 3;
string suggestion = 4;
}
/// Result of the Suite Execution.
message SuiteExecutionResult {
gauge.messages.ProtoSuiteResult suiteResult = 1;
}
message SuiteExecutionResultItem {
gauge.messages.ProtoItem resultItem = 1;
}
/// Requests Gauge to give all Step Names.
message StepNamesRequest {
}
/// Response to StepNamesRequest
message StepNamesResponse {
/// Collection of strings corresponding to Step texts.
repeated string steps = 1;
}
/// Request runner to initialize Scenario DataStore
/// Scenario Datastore is reset after every Scenario execution.
message ScenarioDataStoreInitRequest {
int32 stream = 1;
}
/// Request runner to initialize Spec DataStore
/// Spec Datastore is reset after every Spec execution.
message SpecDataStoreInitRequest {
int32 stream = 1;
}
/// Request runner to initialize Suite DataStore
/// Suite Datastore is reset after every Suite execution.
message SuiteDataStoreInitRequest {
int32 stream = 1;
}
/// Holds the new and old positions of a parameter.
/// Used when refactoring a Step.
message ParameterPosition {
int32 oldPosition = 1;
int32 newPosition = 2;
}
/// Tells the runner to refactor the specified Step.
message RefactorRequest {
/// Old value, used to lookup Step to refactor
gauge.messages.ProtoStepValue oldStepValue = 1;
/// New value, the to-be value of Step being refactored.
gauge.messages.ProtoStepValue newStepValue = 2;
/// Holds parameter positions of all parameters. Contains old and new parameter positions.
repeated ParameterPosition paramPositions = 3;
/// If set to true, the refactored files should be saved to the file system before returning the response.
bool saveChanges = 4;
}
/// Give all file changes to be made to file system
message FileChanges {
string fileName = 1;
string fileContent = 2 [deprecated=true];
repeated TextDiff diffs = 3;
}
/// Response of a RefactorRequest
message RefactorResponse {
/// Flag indicating the success of Refactor operation.
bool success = 1;
/// Error message, valid only if Refactor wasn't successful
string error = 2;
/// List of files that were affected because of the refactoring.
repeated string filesChanged = 3;
/// List of file changes to be made to successfully achieve refactoring.
repeated FileChanges fileChanges = 4;
}
/// Request for details on a Single Step.
message StepNameRequest {
/// Step text to lookup the Step.
/// This is the parsed step value, i.e. with placeholders for parameters.
string stepValue = 1;
}
/// Response to StepNameRequest.
message StepNameResponse {
/// Flag indicating if there is a match for the given Step Text.
bool isStepPresent = 1;
/// The Step name of the given step.
repeated string stepName = 2;
/// Flag indicating if the given Step is an alias.
bool hasAlias = 3;
/// File name in which the step implementation exists
string fileName = 4;
/// Range of step
gauge.messages.Span span = 5;
/// Flag indicating if the given Step defined in some external library and the source code can not be accessed.
bool isExternal = 6;
}
/// Response when a unsupported message request is sent.
message UnsupportedMessageResponse {
string message = 1;
}
/// Request for caching a file.
/// Gauge sends this request when running in LSP mode,
/// so runner can cache file contents present on the client(an editor).
message CacheFileRequest {
enum FileStatus {
/// The file content was changed in the client
CHANGED = 0;
/// The file was closed in the client
CLOSED = 1;
/// The file was created on the client
CREATED = 2;
/// The file was deleted on the client
DELETED = 3;
/// The file is opened in the client
OPENED = 4;
}
/// File content of the file to be cached
string content = 1;
/// File path of the file to be cached
string filePath = 2;
/// Specifies if the file is closed
bool isClosed = 3;
/// Specifies the status of the file
FileStatus status = 4;
}
/// Request for find step positions
message StepPositionsRequest {
/// Get step positions for file path
string filePath = 1;
}
/// Response for find step positions
message StepPositionsResponse {
/// Step position for each step implementation
message StepPosition {
/// Step Value
string stepValue = 1;
/// Range of step
gauge.messages.Span span = 2;
}
/// Step Position
repeated StepPosition stepPositions = 1;
/// Error message
string error = 2;
}
/// Request for getting Implementation file glob pattern
message ImplementationFileGlobPatternRequest {
}
/// Response for getting Implementation file glob pattern
message ImplementationFileGlobPatternResponse {
/// List of implementation file glob patterns
repeated string globPatterns = 1;
}
/// Request for getting Implementation file list
message ImplementationFileListRequest {
}
/// Response for getting Implementation file list
message ImplementationFileListResponse {
/// List of implementation files
repeated string implementationFilePaths = 1;
}
/// Request for injecting code snippet into implementation file
message StubImplementationCodeRequest {
/// Path of the file where the new stub implementation will be added
string implementationFilePath = 1;
/// List of implementation codes to be appended to implementation file.
repeated string codes = 2;
}
/// A Single Replace Diff Element to be applied
message TextDiff {
/// Range of file to be replaced
gauge.messages.Span span = 1;
/// New content to replace the content in the span
string content = 2;
}
/// Diffs to be applied to a file
message FileDiff {
/// File Path where the new content needs to be put in
string filePath = 1;
/// The diffs which need to be applied to this file
repeated TextDiff textDiffs = 2;
}
/// Tell gauge to reset the kill timer, thus extending the life
message KeepAlive {
/// ID of the plugin initiating this request
string pluginId = 1;
}
message SpecDetails {
/// Holds a collection of Spec details.
repeated SpecDetail details = 1;
message SpecDetail {
/// Holds a collection of Specs that are defined in the project.
ProtoSpec spec = 1;
/// Holds a collection of parse errors present in the above spec.
repeated Error parseErrors = 2;
}
}
// Empty is a blank response, to be used when there is no return expected.
message Empty {}
/// This is the message which gets transferred all the time
/// with proper message type set
/// One of the Request/Response fields will have value, depending on the MessageType set.
message Message {
enum MessageType {
ExecutionStarting = 0;
SpecExecutionStarting = 1;
SpecExecutionEnding = 2;
ScenarioExecutionStarting = 3;
ScenarioExecutionEnding = 4;
StepExecutionStarting = 5;
StepExecutionEnding = 6;
ExecuteStep = 7;
ExecutionEnding = 8;
StepValidateRequest = 9;
StepValidateResponse = 10;
ExecutionStatusResponse = 11;
StepNamesRequest = 12;
StepNamesResponse = 13;
KillProcessRequest = 14;
SuiteExecutionResult = 15;
ScenarioDataStoreInit = 16;
SpecDataStoreInit = 17;
SuiteDataStoreInit = 18;
StepNameRequest = 19;
StepNameResponse = 20;
RefactorRequest = 21;
RefactorResponse = 22;
UnsupportedMessageResponse = 23;
CacheFileRequest = 24;
StepPositionsRequest = 25;
StepPositionsResponse = 26;
ImplementationFileListRequest = 27;
ImplementationFileListResponse = 28;
StubImplementationCodeRequest = 29;
FileDiff = 30;
ImplementationFileGlobPatternRequest = 31;
ImplementationFileGlobPatternResponse = 32;
SuiteExecutionResultItem = 33;
KeepAlive = 34;
ConceptExecutionStarting = 35;
ConceptExecutionEnding = 36;
}
MessageType messageType = 1;
/// A unique id to represent this message. A response to the message should copy over this value.
/// This is used to synchronize messages & responses
int64 messageId = 2;
/// [ExecutionStartingRequest](#gauge.messages.ExecutionStartingRequest)
ExecutionStartingRequest executionStartingRequest = 3;
/// [SpecExecutionStartingRequest](#gauge.messages.SpecExecutionStartingRequest)
SpecExecutionStartingRequest specExecutionStartingRequest = 4;
/// [SpecExecutionEndingRequest](#gauge.messages.SpecExecutionEndingRequest)
SpecExecutionEndingRequest specExecutionEndingRequest = 5;
/// [ScenarioExecutionStartingRequest](#gauge.messages.ScenarioExecutionStartingRequest)
ScenarioExecutionStartingRequest scenarioExecutionStartingRequest = 6;
/// [ScenarioExecutionEndingRequest](#gauge.messages.ScenarioExecutionEndingRequest)
ScenarioExecutionEndingRequest scenarioExecutionEndingRequest = 7;
/// [StepExecutionStartingRequest](#gauge.messages.StepExecutionStartingRequest)
StepExecutionStartingRequest stepExecutionStartingRequest = 8;
/// [StepExecutionEndingRequest](#gauge.messages.StepExecutionEndingRequest)
StepExecutionEndingRequest stepExecutionEndingRequest = 9;
/// [ExecuteStepRequest](#gauge.messages.ExecuteStepRequest)
ExecuteStepRequest executeStepRequest = 10;
/// [ExecutionEndingRequest](#gauge.messages.ExecutionEndingRequest)
ExecutionEndingRequest executionEndingRequest = 11;
/// [StepValidateRequest](#gauge.messages.StepValidateRequest)
StepValidateRequest stepValidateRequest = 12;
/// [StepValidateResponse](#gauge.messages.StepValidateResponse)
StepValidateResponse stepValidateResponse = 13;
/// [ExecutionStatusResponse](#gauge.messages.ExecutionStatusResponse)
ExecutionStatusResponse executionStatusResponse = 14;
/// [StepNamesRequest](#gauge.messages.StepNamesRequest)
StepNamesRequest stepNamesRequest = 15;
/// [StepNamesResponse](#gauge.messages.StepNamesResponse)
StepNamesResponse stepNamesResponse = 16;
/// [SuiteExecutionResult ](#gauge.messages.SuiteExecutionResult )
SuiteExecutionResult suiteExecutionResult = 17;
/// [KillProcessRequest](#gauge.messages.KillProcessRequest)
KillProcessRequest killProcessRequest = 18;
/// [ScenarioDataStoreInitRequest](#gauge.messages.ScenarioDataStoreInitRequest)
ScenarioDataStoreInitRequest scenarioDataStoreInitRequest = 19;
/// [SpecDataStoreInitRequest](#gauge.messages.SpecDataStoreInitRequest)
SpecDataStoreInitRequest specDataStoreInitRequest = 20;
/// [SuiteDataStoreInitRequest](#gauge.messages.SuiteDataStoreInitRequest)
SuiteDataStoreInitRequest suiteDataStoreInitRequest = 21;
/// [StepNameRequest](#gauge.messages.StepNameRequest)
StepNameRequest stepNameRequest= 22;
/// [StepNameResponse](#gauge.messages.StepNameResponse)
StepNameResponse stepNameResponse= 23;
/// [RefactorRequest](#gauge.messages.RefactorRequest)
RefactorRequest refactorRequest = 24;
/// [RefactorResponse](#gauge.messages.RefactorResponse)
RefactorResponse refactorResponse = 25;
/// [UnsupportedMessageResponse](#gauge.messages.UnsupportedMessageResponse)
UnsupportedMessageResponse unsupportedMessageResponse = 26;
/// [CacheFileRequest](#gauge.messages.CacheFileRequest)
CacheFileRequest cacheFileRequest = 27;
/// [StepPositionsRequest](#gauge.messages.StepPositionsRequest)
StepPositionsRequest stepPositionsRequest = 28;
/// [StepPositionsResponse](#gauge.messages.StepPositionsResponse)
StepPositionsResponse stepPositionsResponse = 29;
/// [ImplementationFileListRequest](#gauge.messages.ImplementationFileListRequest)
ImplementationFileListRequest implementationFileListRequest = 30;
/// [ImplementationFileListResponse](#gauge.messages.ImplementationFileListResponse)
ImplementationFileListResponse implementationFileListResponse = 31;
/// [StubImplementationCodeRequest](#gauge.messages.StubImplementationCodeRequest)
StubImplementationCodeRequest stubImplementationCodeRequest = 32;
/// [FileDiff](#gauge.messages.FileDiff)
FileDiff fileDiff = 33;
/// [ImplementationFileGlobPatternRequest](#gauge.messages.ImplementationFileGlobPatternRequest)
ImplementationFileGlobPatternRequest implementationFileGlobPatternRequest = 34;
/// [ImplementationFileGlobPatternResponse](#gauge.messages.ImplementationFileGlobPatternResponse)
ImplementationFileGlobPatternResponse implementationFileGlobPatternResponse = 35;
/// [SuiteExecutionResult ](#gauge.messages.SuiteExecutionResult )
SuiteExecutionResultItem suiteExecutionResultItem = 36;
/// [KeepAlive ](#gauge.messages.KeepAlive )
KeepAlive keepAlive = 37;
/// [ConceptExecutionStartingRequest](#gauge.messages.ConceptExecutionStartingRequest)
ConceptExecutionStartingRequest conceptExecutionStartingRequest = 38;
/// [ConceptExecutionEndingRequest](#gauge.messages.ConceptExecutionEndingRequest)
ConceptExecutionEndingRequest conceptExecutionEndingRequest = 39;
}