Protobuf Schema
These are the protobuf definitions for
parigot itself and the built in services.
Protocol Documentation
Table of Contents
Top
file/v1/file.proto
CloseRequest
CloseResponse
CloseResponse is not empty because it can return an error. However, there is no
action that the receiver of this response can take other than perhaps issuing a warning
to the system operators.
CreateRequest
CreateResponse
DeleteRequest
Field | Type | Label | Description |
---|
path | string | | |
DeleteResponse
FileInfo
Define the FileInfo struct
LoadTestDataRequest
LoadTestDataRequest loads the contents of given directory from the host file system into the /app directory
of the test filesystem (in memory). This is only intended to be use for test code.
Field | Type | Label | Description |
---|
dir_path | string | | path is a path to a directory on the host filesystem that is to be loaded in /app |
mount_location | string | | where this new file will exist in the in-memory filesystem… this path will be cleaned lexically and then joined to /app. Note that it is possible create paths with this parameter that cannot be opened because of restrictions on the path in open. |
return_on_fail | bool | | returnOnFail should be set to true if you do NOT want the normal behavior of using panic on error. If this value is set to true, the paths that cause an error on import are return in the TestDataResponse. |
LoadTestDataResponse
LoadTestDataResponse contains a list of paths that caused an error during loading. This value is only
returned if the LoadRequest has the returnOnFail set to true. If LoadDataRequest.return_on_fail is
false since by definition the error_path will be empty.
Field | Type | Label | Description |
---|
error_path | string | repeated | |
OpenRequest
Field | Type | Label | Description |
---|
path | string | | |
OpenResponse
ReadRequest
ReadResponse
StatRequest
StatRequest asks for the information about a file
Field | Type | Label | Description |
---|
path | string | | |
StatResponse
Use the FileInfo struct in the StatResponse message
Field | Type | Label | Description |
---|
file_info | FileInfo | | |
WriteRequest
WriteResponse
FileErr
Name | Number | Description |
---|
NoError | 0 | mandatory |
DispatchError | 1 | mandatory |
UnmarshalError | 2 | mandatory |
MarshalError | 3 | mandatory |
InvalidPathError | 4 | InvalidPathError: Provided path name is not valid based on following rules: 1. The separator should be "/" 2. It should start with specific prefix -> '/parigot/app/' 3. It should not contain any "." or ".." in the path 4. It should not exceed a specific value for the number (max is 20) of parts in the path 5. It should avoid certain special characters, including: Asterisk (*) Question mark (?) Greater than (>) Less than (<) Pipe symbol ( |
Invalid example:
'/parigot/app/..' -> '..' is not allowed '/parigot/app/./' -> '.' is not allowed '/parigot/app/foo\bar' -> '\' is not allowed '//parigot/app/foo', '/parigot/app' -> prefix should be '/parigot/app/' |
| AlreadyInUseError | 5 | File status related errors
The file is already being used. |
| NotExistError | 6 | The file/path does not exist |
| FileClosedError | 7 | The file status is CLOSED, cannot be accessed by a read or write request |
| EOFError | 8 | The file is at the end of the file |
| ReadError | 9 | Some error happened during reading a file |
| WriteError | 10 | Some error happened during writing a file |
| OpenError | 11 | Some error happened during opening a file |
| DeleteError | 12 | Some error happened during deleting a file |
| CreateError | 13 | Some error happened during creating a file |
| NoDataFoundError | 14 | No data file found in the directory |
| LargeBufError | 15 | The buffer for the file is too large |
| InternalError | 16 | There are internal issues with the file service |
File
Top
syscall/v1/syscall.proto
BindMethodRequest
BindMethodRequest is used to tell parigot that the given service_id (located
at host_id) has an implementation for the given method name. This will create
the mapping to a method_id, which is in the response. The direction parameter
is either METHOD_DIRECTION_IN, OUT, or BOTH. IN means thath the method has
no output parameter (the result is ignored), OUT means the method has no input
parameters, and BOTH means that both input and output parameters are used.
BindMethodResponse
BindMethodResponse is the method_id of the service and method name provided
in the request.
BlockUntilCallRequest
Field | Type | Label | Description |
---|
can_timeout | bool | | |
BlockUntilCallResponse
DependencyExistsRequest
DependencyExistsRequest is used to check if there a dependency
path from source to destination. Callers should use either
a target service or a target service name, not both.
The semantics are slightly different. When you ask about the
name of a service, it is a question about what the service
has declared with require calls. When you ask about a specific
service you are asking if a dependency path between the two services
exists and thus the dest service must be started before the
source.
DependencyExistsResponse
DependencyExistsResponse has the exists field set to
true if there exists a sequence of dependencies that
join source and dest (from the request).
Field | Type | Label | Description |
---|
exists | bool | | |
DispatchRequest
DispatchRequest is a request by a client to invoke a particular method with the parameters provided.
DispatchResponse
DispatchResponse sent by the server back to a client. This what is returned
as the intermediate value to the caller, because the caller
cannot block. This call_id value can be used on the client side
to map to additional info about the call.
ExitPair
ExitPair is a structure that is a service that is requesting
an exit and the exit code desired. The service can be empty
if the caller wants the entire suite of services to be exited.
Code will be in the "allowed" range of 0 to 192.
ExitRequest
ExitRequest is how you can request for your wasm program, or the whole system
to exit. This will not terminate the process immediately as there may be other
services running that need to be notified.
Field | Type | Label | Description |
---|
pair | ExitPair | | For the code in the ExitPair, the valid values here are 0…192 and values>192 or <0 will be set to 192. The valid values for the service are a service id (typically the service making this request) or an zero valued service, indicating that the entire system should be brought down. |
call_id | protosupport.v1.IdRaw | | reserved for internal use |
host_id | protosupport.v1.IdRaw | | reserved for internal use |
method_id | protosupport.v1.IdRaw | | reserved for internal use |
shutdown_all | bool | | |
ExitResponse
ExitResponse will not happen. The stack will unwind before this
message could be received.
ExportRequest
ExportRequest informs the kernel that the given
service id implements the named services on the
host given. Note that the services provided must be
distinct.
ExportResponse
Nothing to return.
FullyQualifiedService
FullyQualified service is the complete (protobuf) name of a service as a
a string. This is typically something like "foo.v1" for the package and
the service name is "Foo". These are the names used by the export, require,
and locate calls.
HostBinding
HostBinding is the mapping between a service and a host. Note that a given
host may be bound to many services, but a single service is always bound
to exactly one host.
LaunchRequest
LaunchRequest is used to block a service until its depnedencies are ready.
It returns a future to the guest that can be used to take action once
launch is completed.
LaunchResponse
LaunchResponse has nothing in it because the action will be handled by
a future created as a result of LaunchRequest.
LocateRequest
LocateRequest is a read from the kernel of the service id associated with a package, service pair.
Field | Type | Label | Description |
---|
package_name | string | | |
service_name | string | | |
called_by | protosupport.v1.IdRaw | | called_by is only needed for true clients. If you are doing a call to locate with a service that you did not and could not have known beforehand you should leave this empty. |
LocateResponse
LocateResponse hands back the service Id of the package_name and service_name supplied in the request.
A service id can be thought of as a (network hostname,port) pair that defines which
service's "location".
MethodBinding
MethodBundle
MessageBundle tells the receiver all the necessary info to make a call
on a method. Note that when this is sent to a particular server, the HostId
is the host id of the caller not the place where the service is implemented.
ReadOneRequest
ReadOneRequest gives a set of service/method pairs
that should be considered for a read. The ReadOne
operation returns a single service/method pair that
has received a call. If the timeout expires, only
the timeout bool is returned. If the timeout value
is 0, then an instanteous sample is returned. If
the timeout value is negative, it means wait forever.
In addition to potential calls on the service who
requests this read, it is also possible that the
return value represents a completed call from a previous
point in the execution of the calling program.
ReadOneResponse
ReadOneResponse is returned when the control
is turned over to parigot for a period of time via
a call to ReadOne.
ReadOneResponse returns timeout = true if a timeout
has occurred. If timeout is true, all the other fields
should be ignored. There are two types of results and
these are mutually exclusive.
If resolved is not nil, then this a notification that a
call made by this program have completed. The
resolved field holds information about the completed call,
and that data needs to be matched with the appropriate call ids
and the promises resolved.
If resolved is nil, then the call is a call
on a service and method exposed by this server.
In that case the pair indicates the method and service
being invoked, and the param and call id should be
to create a matching ReturnValueRequest.
Note that if the method denoted by the pair does not
take input, the value of param should be ignored and
it may be nil.
RegisterRequest
Register informs the kernel you are one of the running services
and you want a service id.
RegisterResponse
RegisterResponse indicates if the registering caller has created
the new service or not.
RequireRequest
Require establishes that the source given is going to import the service
given by dest. It is not required that the source locate the dest, although
if one does call locate, a check is done to insure require was called previously.
This check is done to prevent a common programming mistake.
RequireResponse
RequireResponse is currently empty.
ResolvedCall
ResolvedCall is used to hold the output of a service/method call while we
are waiting for the future to be resolved. Note that the host_id here is the
host id of the SENDER of this message, so the place that the result was
calculated.
ReturnValueRequest
ReturnValueRequest is used to return the result of a
function back to the caller. It is the result information
of a call to a service/method function.
ReturnValueResponse
ReturnValueResponse is currently empty.
ServiceByIdRequest
ServiceByIdRequest looks up the given service by
its string representation. This is probably only
useful for passing service objects over the wire.
Field | Type | Label | Description |
---|
service_id | string | | |
ServiceByIdResponse
ServiceByIdResponse returns host binding for the
service or nothing.
ServiceByNameRequest
ServiceByName looks up the given service and returns all
the host bindings associated with it. This does
change the internal data structures, only reports on them.
ServiceByNameResponse
ServiceByNameResponse returns the list, possibly empty,
that has all the host bindings for the named service.
ServiceMethodCall
ServiceMethodCall is the structure that holds "what's been called" in a service.
KernelErr
Name | Number | Description |
---|
NoError | 0 | |
LocateError | 1 | LocateError is return when the kernel cannot find the requested service, given by a package name and service name pair. |
UnmarshalFailed | 2 | UnmarshalFailed is used to indicate that in unmarshaling a request or result, the protobuf layer returned an error. |
IdDispatch | 3 | IdDispatch means that a dispatch call failed due to an MethodId or ServiceId was not found. This is also used when binding a method if the name is invalid. |
NamespaceExhausted | 4 | NamespaceExhausted is returned when the kernel can no along accept additional packages, services, or methods. This is used primarily to thwart attempts at DOS attacks. |
NotFound | 5 | NotFound means that a package, service, or method that was requested could not be found. |
DataTooLarge | 6 | DataTooLarge means that the size of some part of method call was bigger than the buffer allocated to receive it. This could be a problem either on the call side or the return side. |
MarshalFailed | 7 | Marshal means that a marshal of a protobuf has failed. |
CallerUnavailable | 8 | CallerUnavailable means that the kernel could not find the original caller that requested the computation for which results have been provided. It is most likely because the caller was killed, exited or timed out. |
ServiceAlreadyClosedOrExported | 9 | KernelServiceAlreadyClosedOrExported means that some process has already reported the service in question as closed or has already expressed that it is exporting (implementing this service). This is very likely a case where there are two servers that think they are or should be implementing the same service. |
ServiceAlreadyRequired | 10 | ServiceAlreadyRequired means that this same process has already required the given service. |
DependencyCycle | 11 | DependencyCycle means that no deterministic startup ordering exists for the set of exports and requires in use. In other words, you must refactor your program so that you do not have a cyle to make it come up cleanly. |
NetworkFailed | 12 | NetworkFailed means that we successfully connected to the nameserver, but failed during the communication process itself. |
NetworkConnectionLost | 13 | NetworkConnectionLost means that our internal connection to the remote nameserver was either still working but has lost "sync" in the protocol or the connection has become entirely broken. The kernel will close the connection to remote nameserver and reestablish it after this error. |
DataTooSmall | 14 | DataTooSmall means that the kernel was speaking some protocol with a remote server, such as a remote nameserver, and data read from the remote said was smaller than the protocol dictated, e.g. it did not contain a checksum after a data block. |
KernelConnectionFailed | 15 | ConnectionFailed means that the attempt to open a connection to a remote service has failed to connect. |
NSRetryFailed | 16 | NSRetryFailed means that we tried twice to reach the nameserver with the given request, but both times could not do so. |
DecodeError | 17 | DecodeError indicates that an attempt to extract a protobuf object from an encoded set of bytes has failed. Typically, this means that the encoder was not called. |
ExecError | 18 | ExecError means that we received a response from the implenter of a particular service's function and the execution of that function failed. |
KernelDependencyFailure | 19 | DependencyFailure means that the dependency infrastructure has failed. This is different than when a user creates bad set of depedencies (KernelDependencyCycle). This an internal to the kernel error. |
AbortRequest | 20 | AbortRequest indicates that the program that receives this error should exit because the nameserver has asked it to do so. This means that some other program has failed to start correctly, so this deployment cannot succeed. |
EncodeError | 22 | EncodeError indicates that an attempt encode a protobuf with header and CRC has failed. |
ClosedErr | 23 | ClosedErr indicates that that object is now closed. This is used as a signal when writing data between the guest and host. |
GuestReadFailed | 24 | GuestReadFailed indicates that we did not successfully read from guest memory. This is usually caused by the proposed address to read from being out of bounds. |
GuestWriteFailed | 25 | GuestWriteFailed indicates that we did not successfully write to guest memory. This is usually caused by the proposed address for writing to being out of bounds. |
BadId | 26 | BadId indicates that you passed the zero value or the empty value of a an id type into a system call. This usually means that you did not properly initialize a protobuf. |
NotReady | 27 | NotReady that the service that was trying to start was aborted because it returned false from Ready(). Usually this error indicates that the program has no way to continue running. |
NotRequired | 28 | NotRequired that a service has tried to Locate() another service that that the first service did not Require() previously. |
RunTimeout | 29 | RunTimeout means that the programs timeout has expired when waiting for all the required dependencies to be fulfilled. |
ReadOneTimeout | 30 | ReadOneTimeout means that the program was trying to request a service/method pair to invoke, but the request timed out. |
WriteTimeout | 31 | WriteTimeout means that the program was trying to send a request to another service, but timed out before it could do so. |
BadCallId | 32 | BadCallId is returned when trying to match up the results and the call of a function resulting in a promise. It is returned if either there is no such cid registered yet or the cid is already in use. |
ChannelClosed | 33 | ChannelClosed indicates that one of the internal channels used in waiting for input has been closed unexpectedly. is already in use. |
ExitFailed | 34 | ExitFailed means that we were tyring to send an orderly shutdown but could not reach all the of the hosts that we needed to notify. |
MethodDirection
Name | Number | Description |
---|
METHOD_DIRECTION_UNSPECIFIED | 0 | |
METHOD_DIRECTION_IN | 1 | |
METHOD_DIRECTION_OUT | 2 | |
METHOD_DIRECTION_BOTH | 3 | |
Top
queue/v1/queue.proto
CreateQueueRequest
Create creates a queue or returns an error. Note that this is usually used
only once to set up the operating environment.
Field | Type | Label | Description |
---|
queue_name | string | | |
CreateQueueResponse
CreateQueueResponse returns the queue just created.
Errors are passed back out of band.
DeleteQueueRequest
Delete queue deletes a queue and returns the queue id deleted, or sends
an error out of band.
DeleteQueueResponse
DeleteQueueResponse returns the (now invalid) queue id of what
was just deleted.
LengthRequest
Length requests and approximation of the number of elements in the queue
LengthResponse
LengthResponse returns the queue id identifying the queue we
computed the length for.
LocateRequest
LocateRequest is request to access a given queue.
Field | Type | Label | Description |
---|
queue_name | string | | |
LocateResponse
LocateResponse returns the queue id corresponding to the name
provided. It returns errors out of band.
MarkDoneRequest
MarkDone request indicates that the caller has finished processing
each message in
MarkDoneResponse
MarkDone returns the list of unmodified (not marked done) messages
remaining. In the normal case, this will be empty. If there was an error
trying to mark items as done, it returns the error and
puts the unmarked elements in the list unmodified
QueueMsg
QueueMsg represents an object returned by a call to Receive.
ReceiveRequest
Receive pulls the available messages from the queue and returns
them. Note that if multiple copies of the caller exist, the
caller must be prepared to receive the same message multiple
times.
Field | Type | Label | Description |
---|
id | protosupport.v1.IdRaw | | |
message_limit | int32 | | it is expected that you can process all received messages inside the time limit |
1 is usually the right choice here |
ReceiveResponse
Receive response hands the caller a list of messages to
process. If you need to return an error, do so out of band.
SendRequest
Send requests enqueues the queue messages provided.
SendResponse
If the queue msg id is an error then we are using the error_detail_msg to
return the value. Note that the message id you provide here will
changed once we send you the success notification using your id.
QueueErr
Name | Number | Description |
---|
NoError | 0 | mandatory |
DispatchError | 1 | mandatory |
UnmarshalError | 2 | mandatory |
MarshalError | 3 | mandatory |
InvalidName | 4 | InvalidName means that the given queue name is a not a valid identifier. Identifiers must contain only ascii alphanumeric characters and the symbols ".", ",","_" and "-". The first letter of a queue name must be an alphabetic character. |
InternalError | 5 | InternalError means that the queue's implementation (not the values) passed to it) is the problem. This is roughly a 500 not a 401. This is usually caused by a problem with the internal database used to store the queue items. |
NoPayload | 6 | NoPayload is an error that means that an attempt was made to create a message a nil payload. Payloads are mandatory and senders are optional. |
NotFound | 7 | NotFound means that the Queue name requested could not be found. This the queue equivalent of 404. |
AlreadyExists | 8 | AlreadyExists means that the Queue name is already in use. |
UnmarshalFailed | 9 | Unmarshal error means that we could not use the protobuf unmarshal successfully for a payload or sender. |
Queue
Queue supports a reliable source of messages. Messages
may be delivered out of order or delivered multiple times.
Method Name | Request Type | Response Type | Description |
---|
CreateQueue | CreateQueueRequest | CreateQueueResponse | CreateQueue creates a new named queue. This is useful primarily in preparing for a deployment, not during normal execution. See LocateQueue to find an already existing queue. |
Locate | LocateRequest | LocateResponse | Locate finds the named queue and returns the id. |
DeleteQueue | DeleteQueueRequest | DeleteQueueResponse | DeleteQueue deletes a named queue. This request will return a specific error code if the queue does not exist. |
Receive | ReceiveRequest | ReceiveResponse | Receive a queued message. Just receiving a message does not imply that it is fully processed. You need to call delete or the message will be redelivered at a future point. Messages are not guaranteed to be received in the order sent. If there are no messages ready, the response will be returned with a nil message. |
MarkDone | MarkDoneRequest | MarkDoneResponse | Mark a message as done and delete. This should only be done after the processing is completed. If you are worried about idempotentency in your processing,you will need to keep a record of which message Ids you have processed. |
Length | LengthRequest | LengthResponse | Length returns the approximate number of items in the queue. |
Send | SendRequest | SendResponse | Send a message for later delivery. |
Top
protosupport/v1/protosupport.proto
IdRaw
File-level Extensions
Extension | Type | Base | Number | Description |
---|
parigot_error | bool | .google.protobuf.EnumOptions | 543211 | |
host_func_name | string | .google.protobuf.MethodOptions | 543212 | |
error_id_name | string | .google.protobuf.ServiceOptions | 543213 | |
implements_reverse_api | string | .google.protobuf.ServiceOptions | 543215 | |
is_reverse_api | bool | .google.protobuf.ServiceOptions | 543214 | |
Top
queue/v1/queue.proto
CreateQueueRequest
Create creates a queue or returns an error. Note that this is usually used
only once to set up the operating environment.
Field | Type | Label | Description |
---|
queue_name | string | | |
CreateQueueResponse
CreateQueueResponse returns the queue just created.
Errors are passed back out of band.
DeleteQueueRequest
Delete queue deletes a queue and returns the queue id deleted, or sends
an error out of band.
DeleteQueueResponse
DeleteQueueResponse returns the (now invalid) queue id of what
was just deleted.
LengthRequest
Length requests and approximation of the number of elements in the queue
LengthResponse
LengthResponse returns the queue id identifying the queue we
computed the length for.
LocateRequest
LocateRequest is request to access a given queue.
Field | Type | Label | Description |
---|
queue_name | string | | |
LocateResponse
LocateResponse returns the queue id corresponding to the name
provided. It returns errors out of band.
MarkDoneRequest
MarkDone request indicates that the caller has finished processing
each message in
MarkDoneResponse
MarkDone returns the list of unmodified (not marked done) messages
remaining. In the normal case, this will be empty. If there was an error
trying to mark items as done, it returns the error and
puts the unmarked elements in the list unmodified
QueueMsg
QueueMsg represents an object returned by a call to Receive.
ReceiveRequest
Receive pulls the available messages from the queue and returns
them. Note that if multiple copies of the caller exist, the
caller must be prepared to receive the same message multiple
times.
Field | Type | Label | Description |
---|
id | protosupport.v1.IdRaw | | |
message_limit | int32 | | it is expected that you can process all received messages inside the time limit |
1 is usually the right choice here |
ReceiveResponse
Receive response hands the caller a list of messages to
process. If you need to return an error, do so out of band.
SendRequest
Send requests enqueues the queue messages provided.
SendResponse
If the queue msg id is an error then we are using the error_detail_msg to
return the value. Note that the message id you provide here will
changed once we send you the success notification using your id.
QueueErr
Name | Number | Description |
---|
NoError | 0 | mandatory |
DispatchError | 1 | mandatory |
UnmarshalError | 2 | mandatory |
MarshalError | 3 | mandatory |
InvalidName | 4 | InvalidName means that the given queue name is a not a valid identifier. Identifiers must contain only ascii alphanumeric characters and the symbols ".", ",","_" and "-". The first letter of a queue name must be an alphabetic character. |
InternalError | 5 | InternalError means that the queue's implementation (not the values) passed to it) is the problem. This is roughly a 500 not a 401. This is usually caused by a problem with the internal database used to store the queue items. |
NoPayload | 6 | NoPayload is an error that means that an attempt was made to create a message a nil payload. Payloads are mandatory and senders are optional. |
NotFound | 7 | NotFound means that the Queue name requested could not be found. This the queue equivalent of 404. |
AlreadyExists | 8 | AlreadyExists means that the Queue name is already in use. |
UnmarshalFailed | 9 | Unmarshal error means that we could not use the protobuf unmarshal successfully for a payload or sender. |
Queue
Queue supports a reliable source of messages. Messages
may be delivered out of order or delivered multiple times.
Method Name | Request Type | Response Type | Description |
---|
CreateQueue | CreateQueueRequest | CreateQueueResponse | CreateQueue creates a new named queue. This is useful primarily in preparing for a deployment, not during normal execution. See LocateQueue to find an already existing queue. |
Locate | LocateRequest | LocateResponse | Locate finds the named queue and returns the id. |
DeleteQueue | DeleteQueueRequest | DeleteQueueResponse | DeleteQueue deletes a named queue. This request will return a specific error code if the queue does not exist. |
Receive | ReceiveRequest | ReceiveResponse | Receive a queued message. Just receiving a message does not imply that it is fully processed. You need to call delete or the message will be redelivered at a future point. Messages are not guaranteed to be received in the order sent. If there are no messages ready, the response will be returned with a nil message. |
MarkDone | MarkDoneRequest | MarkDoneResponse | Mark a message as done and delete. This should only be done after the processing is completed. If you are worried about idempotentency in your processing,you will need to keep a record of which message Ids you have processed. |
Length | LengthRequest | LengthResponse | Length returns the approximate number of items in the queue. |
Send | SendRequest | SendResponse | Send a message for later delivery. |
Top
test/v1/test.proto
AddTestSuiteRequest
AddTestSuiteRequest adds one or more test suites to the list of available
suites for the TestService.
AddTestSuiteResponse
AddTestSuiteResponse contains a map that takes a tuple, written as
pkg.service.name, and maps it to a boolean to indicate if the given
tuple was added successfully.
AddTestSuiteResponse.SucceededEntry
ComparisonResult
Comparison result describes a single comparison that was done during
a test. This result is generally optional inside a ExecResult. The
name field is not the package, service, or function name, it is a name
that can used to narrow down to a single comparison. name can be "",
as can error_message. The error_id can be nil. These can be zero
value because they are not crucial to the display of the results, although
it is highly recommended that if the success == false, then one of
error_message or error_id is set.
ExecRequest
ExecRequest is the type that flows from the TestService to the
package.service.func that is under test. The package, service, and
name are in the request message because the callee might be doing
trickery with names (see the map field in the SuiteInfo) and
thus needs to know what to emulate, dispatch, etc.
ExecResponse
ExecResponse is what an object under test sends back to the TestService
describing the test outcome. A single package/service/name can have
many comparisons.
QueuePayload
QueuePayload is the payload that is sent to the TestService via sending
and receiving items from the queue. Note that the TestSends these messages
during setup and retreives them in the background once the tests have started.
StartRequest
StartRequest is what the client should use to start the tests running.
The provided data is exclusive, if filter_suite is provided filter_name
may not be, and vice versa. Both the suite and name filters may be empty
to request running all tests. filter_name and filter_suite must be legal
golang regular expressions. Parallel is currently ignored.
StartResponse
StartResponse returns the number of tests that will be run, given
the filters provided in StartRequest. If regex_failed means that one
of the regex fields (filter_suite or filter_name) was not a valid
golang regex.
Field | Type | Label | Description |
---|
regex_failed | bool | | so common we don't even call it an error |
num_test | int32 | | |
SuiteInfo
SuiteInfo is used to describe the set of test functions that a
suite has. The map provided goes from the logical name of the
test ("MyFunc") to the function the test service will actually
request ("MyTrickyDispatcher"). The key and value can be identical in
the simple case.
SuiteReportRequest
SuiteReportRequest is passed to the suite from the TestService and
contains overall information about the suite's tests. The maps have a key
that is the logical function name (the key in the map of SuiteRequest).
SuiteReportRequest.DetailEntry
SuiteReportRequest.TestSkipEntry
SuiteReportRequest.TestSuccessEntry
SuiteReportResponse
SuiteReportResponse is empty because there is nothing valuable that
can be sent from the suite to the TestService.
TestErr
Error codes
Name | Number | Description |
---|
NoError | 0 | mandatory |
DispatchError | 1 | used by generated code |
UnmarshalError | 2 | used by generated code |
ServiceNotFound | 3 | ServiceNotFound means that the service that was supposed to be under test could not be found. |
Exec | 4 | Exec means that the exec itself (not the thing being execed) has failed. |
SendFailed | 5 | SendFailed means that the Test code itself could not create the necessary queue entries. |
Internal | 6 | Internal means that the Test code itself (not the code under test) has had a problem. |
RegexpFailed | 7 | RegexpFailed means that the regexp provided by the caller did not compile and is not a valid go regexp. |
Marshal | 8 | Marshal is used to when we cannot marshal arguments into to a protobuf. |
Queue | 9 | Queue means that the there was internal error with the queue that is used by the Test service. |
DynamicLocate | 10 | DynamicLocate is returned when we cannot discover the protobuf package and service name pair provided. |
MethodCallSuite
Test
Method Name | Request Type | Response Type | Description |
---|
AddTestSuite | AddTestSuiteRequest | AddTestSuiteResponse | AddTestSuite adds all the elements in the request as suites to the TestService list. If you add a Suite more than once, the function lists are merged–the functions that were already present are retained and the response will show these tests as failures. |
Start | StartRequest | StartResponse | Start starts the TestManager running all the known tests, implicitly this includes all suites. If you give a suite filter the entire suite's tests are dropped if the suite name doesn't match the filter. For finer granularity you can supple a name filter which walks all the known tests and discards any test that doesn't match the filter. |
UnderTest
UnderTest is the service that services should implement to be "under test" and
testable via Test.
Method Name | Request Type | Response Type | Description |
---|
Exec | ExecRequest | ExecResponse | For the default test setup, this is the method that dispatches requests from the TestService to the appropriate test function. |
Scalar Value Types
.proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
---|
double | | double | double | float | float64 | double | float | Float |
float | | float | float | float | float32 | float | float | Float |
int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum |
uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum |
fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) |
fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum |
sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |