feat: added API for continuous test

PiperOrigin-RevId: 374994233
pull/744/head
Google APIs 4 years ago committed by Copybara-Service
parent 4f622003b9
commit 31313cb7f8
  1. 2
      google/cloud/dialogflow/cx/v3beta1/dialogflow_v3beta1.yaml
  2. 113
      google/cloud/dialogflow/cx/v3beta1/environment.proto

@ -30,6 +30,8 @@ types:
- name: google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse
- name: google.cloud.dialogflow.cx.v3beta1.ImportTestCasesMetadata
- name: google.cloud.dialogflow.cx.v3beta1.ImportTestCasesResponse
- name: google.cloud.dialogflow.cx.v3beta1.RunContinuousTestMetadata
- name: google.cloud.dialogflow.cx.v3beta1.RunContinuousTestResponse
- name: google.cloud.dialogflow.cx.v3beta1.RunTestCaseMetadata
- name: google.cloud.dialogflow.cx.v3beta1.RunTestCaseResponse
- name: google.cloud.dialogflow.cx.v3beta1.TestError

@ -98,6 +98,26 @@ service Environments {
};
option (google.api.method_signature) = "name";
}
// Kicks off a continuous test under the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
rpc RunContinuousTest(RunContinuousTestRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v3beta1/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "RunContinuousTestResponse"
metadata_type: "RunContinuousTestMetadata"
};
}
// Fetches a list of continuous test results for a given environment.
rpc ListContinuousTestResults(ListContinuousTestResultsRequest) returns (ListContinuousTestResultsResponse) {
option (google.api.http) = {
get: "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults"
};
option (google.api.method_signature) = "parent";
}
}
// Represents an environment for an agent. You can create multiple versions
@ -261,3 +281,96 @@ message LookupEnvironmentHistoryResponse {
// results in the list.
string next_page_token = 2;
}
// Represents a result from running a test case in an agent environment.
message ContinuousTestResult {
option (google.api.resource) = {
type: "dialogflow.googleapis.com/ContinuousTestResult"
pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}"
};
// The overall result for a continuous test run in an agent environment.
enum AggregatedTestResult {
// Not specified. Should never be used.
AGGREGATED_TEST_RESULT_UNSPECIFIED = 0;
// All the tests passed.
PASSED = 1;
// At least one test did not pass.
FAILED = 2;
}
// The resource name for the continuous test result. Format:
// `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/environments/<Environment
// ID>/continuousTestResults/<ContinuousTestResult ID>`.
string name = 1;
// The result of this continuous test run, i.e. whether all the tests in this
// continuous test run pass or not.
AggregatedTestResult result = 2;
// A list of individual test case results names in this continuous test run.
repeated string test_case_results = 3 [(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/TestCaseResult"
}];
// Time when the continuous testing run starts.
google.protobuf.Timestamp run_time = 4;
}
// The request message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3beta1.Environments.RunContinuousTest].
message RunContinuousTestRequest {
// Required. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/environments/<Environment ID>`.
string environment = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Environment"
}
];
}
// The response message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3beta1.Environments.RunContinuousTest].
message RunContinuousTestResponse {
// The result for a continuous test run.
ContinuousTestResult continuous_test_result = 1;
}
// Metadata returned for the [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3beta1.Environments.RunContinuousTest] long running
// operation.
message RunContinuousTestMetadata {
// The test errors.
repeated TestError errors = 1;
}
// The request message for [Environments.ListContinuousTestResults][google.cloud.dialogflow.cx.v3beta1.Environments.ListContinuousTestResults].
message ListContinuousTestResultsRequest {
// Required. The environment to list results for.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/
// environments/<Environment ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "dialogflow.googleapis.com/ContinuousTestResult"
}
];
// The maximum number of items to return in a single page. By default 100 and
// at most 1000.
int32 page_size = 2;
// The next_page_token value returned from a previous list request.
string page_token = 3;
}
// The response message for [Environments.ListTestCaseResults][].
message ListContinuousTestResultsResponse {
// The list of continuous test results.
repeated ContinuousTestResult continuous_test_results = 1;
// Token to retrieve the next page of results, or empty if there are no more
// results in the list.
string next_page_token = 2;
}

Loading…
Cancel
Save