From 31313cb7f81b4323d25fb0a320e688a7c6c22502 Mon Sep 17 00:00:00 2001 From: Google APIs Date: Thu, 20 May 2021 18:50:54 -0700 Subject: [PATCH] feat: added API for continuous test PiperOrigin-RevId: 374994233 --- .../cx/v3beta1/dialogflow_v3beta1.yaml | 2 + .../dialogflow/cx/v3beta1/environment.proto | 113 ++++++++++++++++++ 2 files changed, 115 insertions(+) diff --git a/google/cloud/dialogflow/cx/v3beta1/dialogflow_v3beta1.yaml b/google/cloud/dialogflow/cx/v3beta1/dialogflow_v3beta1.yaml index 1d2ef14fec357..e5b4ecbd502b6 100644 --- a/google/cloud/dialogflow/cx/v3beta1/dialogflow_v3beta1.yaml +++ b/google/cloud/dialogflow/cx/v3beta1/dialogflow_v3beta1.yaml @@ -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 diff --git a/google/cloud/dialogflow/cx/v3beta1/environment.proto b/google/cloud/dialogflow/cx/v3beta1/environment.proto index 33fd9e816767c..837551df98714 100644 --- a/google/cloud/dialogflow/cx/v3beta1/environment.proto +++ b/google/cloud/dialogflow/cx/v3beta1/environment.proto @@ -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//locations//agents//environments//continuousTestResults/`. + 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//locations//agents//environments/`. + 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//locations//agents// + // environments/`. + 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; +}