All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sisyphus.test.case.proto Maven / Gradle / Ivy

There is a newer version: 2.1.22
Show newest version
syntax = "proto3";

package sisyphus.test;

import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";

option java_package = "com.bybutter.sisyphus.test";
option objc_class_prefix = "SIS";

// Struct for a valid test case file.
message TestCase {
  // Display title of test case, it will be set from file name if not set.
  string name = 1;

  // The global metadata for running test.
  map metadata = 2;

  // Test steps.
  repeated TestStep steps = 3;

  // CEL script for executing asserts.
  // Using name of test step to get [TestResult] struct.
  // Each CEL script must return true or false.
  repeated string asserts = 4;
}

// Test step information to execute test.
message TestStep {
  // The unique id of test step, you can use
  // this id to get [TestResult] struct in asserts.
  // The id must be a valid identifier of CEL.
  // To avoid name conflicts, any names same as fields
  // of [TestStep] and [TestResult] will be invalid id.
  string id = 1;

  // Display title of test step, it will be [id] if not set.
  string name = 2;

  // CEL script for determining whether to execute the step.
  // Current step will be executed when all script return true.
  // In addition, you can use name of test step to get [TestResult] struct
  // of test steps which have been executed before.
  repeated string precondition = 3;

  // The server host and port, it will be localhost:9090 if not set.
  string authority = 4;

  // The full method name to call.
  string method = 5;

  // The input of method.
  google.protobuf.Any input = 6;

  // CEL script for preparing input.
  // Using current [TestStep] as context of CEL executing.
  // In addition, you can use name of test step to get [TestResult] struct
  // of test steps which have been executed before.
  repeated string input_script = 7;

  // The metadata of one call.
  map metadata = 8;

  // CEL script for preparing metadata.
  // Using current [TestStep] as context of CEL executing.
  // In addition, you can use name of test step to get [TestResult] struct
  // of test steps which have been executed before.
  repeated string metadata_script = 9;

  // Mark a test step is not sensitive, it means gRPC call could be failed,
  // and asserts will be executed without [output] but with [status] amd [message].
  bool insensitive = 10;

  // CEL script for executing asserts.
  // The [TestResult] of current [TestCase] will be the global context.
  // It means you can use [input] directly to get request message,
  // [output] to get response message.
  // In addition, you can use name of test step to get [TestResult] struct
  // of test steps which have been executed before.
  repeated string asserts = 11;

  // Timeout duration of compute deadline of gRPC calls.
  // Depending on [not_sensitive] field, there are two different behaviors
  // in the case of a request timeout.
  // - [not_sensitive] is false, the step will failed.
  // - [not_sensitive] is true, the asserts will be executed with [status]
  //   set by '4'(DEADLINE_EXCEEDED).
  google.protobuf.Duration timeout = 12;

  // Retry count of current step.
  int32 retry_count = 13;

  // Retry condition of current step.
  // The [TestResult] of current [TestCase] will be the global context.
  // It means you can use [input] directly to get request message,
  // [output] to get response message.
  // In addition, you can use name of test step to get [TestResult] struct
  // of test steps which have been executed before.
  repeated string retry_condition = 14;
}

// Result of executing test step.
message TestResult {
  TestStep step = 1;

  TestCase case = 2;

  // Full method name of [TestStep].
  string method = 3;

  int32 status = 4;

  string message = 5;

  // Input message of [TestStep].
  google.protobuf.Any input = 6;

  // Output message of [TestStep].
  google.protobuf.Any output = 7;

  // Input metadata of [TestStep].
  map headers = 8;

  // Output metadata of [TestStep].
  map trailers = 9;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy