From 52b227a1d479251941fce28bcdbfb7c5b58ae70d Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Mon, 7 Aug 2023 14:50:25 +0530 Subject: [PATCH] Update Required tests. --- .../bigquery/sink/BigQuerySinkError.feature | 1 + .../bigquery/sink/GCSToBigQuery.feature | 2 +- .../source/BigQueryToBigQuery.feature | 2 +- ...BigQueryToBigQuery_withConnections.feature | 2 +- .../bigqueryexecute/BQExecute.feature | 2 +- .../features/gcs/sink/GCSSink.feature | 4 +- .../features/gcs/sink/GCSSinkError.feature | 2 +- .../source/GCSToGCS_withConnections.feature | 2 +- .../gcs/source/GCSourceSchema.feature | 1 + .../spanner/source/SpannerToSpanner.feature | 2 +- .../spanner/source/SpannertoGCS.feature | 2 +- .../sinkrunner/TestRunnerRequired.java | 37 +++++++++++++++++++ 12 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 src/e2e-test/java/io/cdap/plugin/gcs/runners/sinkrunner/TestRunnerRequired.java diff --git a/src/e2e-test/features/bigquery/sink/BigQuerySinkError.feature b/src/e2e-test/features/bigquery/sink/BigQuerySinkError.feature index 7468365611..dd4c331f24 100644 --- a/src/e2e-test/features/bigquery/sink/BigQuerySinkError.feature +++ b/src/e2e-test/features/bigquery/sink/BigQuerySinkError.feature @@ -1,6 +1,7 @@ @BigQuery_Sink Feature: BigQuery sink - Validate BigQuery sink plugin error scenarios + @BigQuery_Sink_Required Scenario Outline:Verify BigQuery Sink properties validation errors for mandatory fields Given Open Datafusion Project to configure pipeline When Sink is BigQuery diff --git a/src/e2e-test/features/bigquery/sink/GCSToBigQuery.feature b/src/e2e-test/features/bigquery/sink/GCSToBigQuery.feature index d1015362b2..e27929eb8b 100644 --- a/src/e2e-test/features/bigquery/sink/GCSToBigQuery.feature +++ b/src/e2e-test/features/bigquery/sink/GCSToBigQuery.feature @@ -1,7 +1,7 @@ @BigQuery_Sink Feature: BigQuery sink - Verification of GCS to BigQuery successful data transfer - @CMEK @GCS_CSV_TEST @BQ_SINK_TEST + @CMEK @GCS_CSV_TEST @BQ_SINK_TEST @BigQuery_Sink_Required Scenario:Validate successful records transfer from GCS to BigQuery Given Open Datafusion Project to configure pipeline When Source is GCS diff --git a/src/e2e-test/features/bigquery/source/BigQueryToBigQuery.feature b/src/e2e-test/features/bigquery/source/BigQueryToBigQuery.feature index f3d4347b24..83e4d5e99d 100644 --- a/src/e2e-test/features/bigquery/source/BigQueryToBigQuery.feature +++ b/src/e2e-test/features/bigquery/source/BigQueryToBigQuery.feature @@ -179,7 +179,7 @@ Feature: BigQuery source - Verification of BigQuery to BigQuery successful data Then Verify the pipeline status is "Succeeded" Then Verify the partition table is created with partitioned on field "bqPartitionFieldTime" - @BQ_SOURCE_DATATYPE_TEST @BQ_SINK_TEST + @BQ_SOURCE_DATATYPE_TEST @BQ_SINK_TEST @BigQuery_Source_Required Scenario:Validate successful records transfer from BigQuery to BigQuery with all the datatypes Given Open Datafusion Project to configure pipeline When Source is BigQuery diff --git a/src/e2e-test/features/bigquery/source/BigQueryToBigQuery_withConnections.feature b/src/e2e-test/features/bigquery/source/BigQueryToBigQuery_withConnections.feature index d38c2d520b..192f86f1e9 100644 --- a/src/e2e-test/features/bigquery/source/BigQueryToBigQuery_withConnections.feature +++ b/src/e2e-test/features/bigquery/source/BigQueryToBigQuery_withConnections.feature @@ -1,7 +1,7 @@ @BigQuery_Source Feature: BigQuery source - Verification of BigQuery to BigQuery successful data transfer using connections - @BQ_SOURCE_TEST @BQ_SINK_TEST @BQ_CONNECTION + @BQ_SOURCE_TEST @BQ_SINK_TEST @BQ_CONNECTION @BigQuery_Source_Required Scenario: To verify data transfer from BigQuery to BigQuery with pipeline connection created from wrangler Given Open Wrangler connections page Then Click plugin property: "addConnection" button diff --git a/src/e2e-test/features/bigqueryexecute/BQExecute.feature b/src/e2e-test/features/bigqueryexecute/BQExecute.feature index 0715ad20ac..afdd8b6b65 100644 --- a/src/e2e-test/features/bigqueryexecute/BQExecute.feature +++ b/src/e2e-test/features/bigqueryexecute/BQExecute.feature @@ -70,7 +70,7 @@ Feature: BigQueryExecute - Verify data transfer using BigQuery Execute plugin Then Open and capture logs Then Verify the pipeline status is "Succeeded" - @BQ_EXECUTE_DDL_CREATE_TEST + @BQ_EXECUTE_DDL_CREATE_TEST @BQExecute_Required Scenario: Verify BQExecute plugin functionality for DDL query - Create table Given Open Datafusion Project to configure pipeline When Expand Plugin group in the LHS plugins list: "Conditions and Actions" diff --git a/src/e2e-test/features/gcs/sink/GCSSink.feature b/src/e2e-test/features/gcs/sink/GCSSink.feature index 0e5e582e39..563a896e87 100644 --- a/src/e2e-test/features/gcs/sink/GCSSink.feature +++ b/src/e2e-test/features/gcs/sink/GCSSink.feature @@ -35,7 +35,7 @@ Feature: GCS sink - Verification of GCS Sink plugin Then Verify data is transferred to target GCS bucket Then Validate the cmek key "cmekGCS" of target GCS bucket if cmek is enabled - @GCS_SINK_TEST @BQ_SOURCE_TEST + @GCS_SINK_TEST @BQ_SOURCE_TEST @GCS_Sink_Required Scenario Outline: To verify data is getting transferred successfully from BigQuery to GCS for different formats Given Open Datafusion Project to configure pipeline When Source is BigQuery @@ -172,7 +172,7 @@ Feature: GCS sink - Verification of GCS Sink plugin Then Verify the pipeline status is "Succeeded" Then Verify data is transferred to target GCS bucket with path suffix "gcsPathSuffix" - @GCS_DATATYPE_TEST @GCS_SINK_TEST + @GCS_DATATYPE_TEST @GCS_SINK_TEST @GCS_Sink_Required Scenario: To verify data is getting transferred from GCS to GCS with supported DataTypes Given Open Datafusion Project to configure pipeline When Source is GCS diff --git a/src/e2e-test/features/gcs/sink/GCSSinkError.feature b/src/e2e-test/features/gcs/sink/GCSSinkError.feature index 6faa6d5736..0718136d4a 100644 --- a/src/e2e-test/features/gcs/sink/GCSSinkError.feature +++ b/src/e2e-test/features/gcs/sink/GCSSinkError.feature @@ -48,7 +48,7 @@ Feature: GCS sink - Verify GCS Sink plugin error scenarios Then Click on the Validate button Then Verify that the Plugin Property: "path" is displaying an in-line error message: "errorMessageInvalidBucketName" - @BQ_SOURCE_DATATYPE_TEST @GCS_SINK_TEST + @BQ_SOURCE_DATATYPE_TEST @GCS_SINK_TEST @GCS_Sink_Required Scenario: To verify error message when unsupported format is used in GCS sink with multiple datatypes provided in source table Given Open Datafusion Project to configure pipeline When Source is BigQuery diff --git a/src/e2e-test/features/gcs/source/GCSToGCS_withConnections.feature b/src/e2e-test/features/gcs/source/GCSToGCS_withConnections.feature index 105419f436..481b1ef2fa 100644 --- a/src/e2e-test/features/gcs/source/GCSToGCS_withConnections.feature +++ b/src/e2e-test/features/gcs/source/GCSToGCS_withConnections.feature @@ -66,7 +66,7 @@ Feature: GCS source - Verification of GCS to GCS successful data transfer using Then Click plugin property: "Delete" button Then Verify connection: "gcsConnectionName" of type: "GCS" is deleted successfully - @GCS_CSV_TEST @GCS_SINK_TEST @EXISTING_GCS_CONNECTION + @GCS_CSV_TEST @GCS_SINK_TEST @EXISTING_GCS_CONNECTION @GCS_Source_Required Scenario: To verify data is getting transferred from GCS to GCS with use connection functionality Given Open Datafusion Project to configure pipeline When Select plugin: "GCS" from the plugins list as: "Source" diff --git a/src/e2e-test/features/gcs/source/GCSourceSchema.feature b/src/e2e-test/features/gcs/source/GCSourceSchema.feature index 9aee365949..ab90595858 100644 --- a/src/e2e-test/features/gcs/source/GCSourceSchema.feature +++ b/src/e2e-test/features/gcs/source/GCSourceSchema.feature @@ -20,6 +20,7 @@ Feature: GCS source - Validate GCS plugin output schema for different formats | GcsPath | FileFormat | ExpectedSchema | | gcsTsvFile | tsv | gcsTsvFileSchema | + @GCS_Source_Required Scenario Outline:GCS Source output schema validation for blob, parquet, avro and text format Given Open Datafusion Project to configure pipeline When Source is GCS diff --git a/src/e2e-test/features/spanner/source/SpannerToSpanner.feature b/src/e2e-test/features/spanner/source/SpannerToSpanner.feature index d0f831486a..decad8719f 100644 --- a/src/e2e-test/features/spanner/source/SpannerToSpanner.feature +++ b/src/e2e-test/features/spanner/source/SpannerToSpanner.feature @@ -1,7 +1,7 @@ @Spanner_Source @SPANNER_TEST Feature: Spanner source - Verification of Spanner to Spanner successful data transfer without using connections - @SPANNER_SINK_TEST @SPANNER_TEST + @SPANNER_SINK_TEST @SPANNER_TEST @Spanner_Source_Required Scenario: To verify data is getting transferred from Spanner to Spanner without using connection functionality Given Open Datafusion Project to configure pipeline When Select plugin: "Spanner" from the plugins list as: "Source" diff --git a/src/e2e-test/features/spanner/source/SpannertoGCS.feature b/src/e2e-test/features/spanner/source/SpannertoGCS.feature index 7c521f45ed..5c4461b294 100644 --- a/src/e2e-test/features/spanner/source/SpannertoGCS.feature +++ b/src/e2e-test/features/spanner/source/SpannertoGCS.feature @@ -1,7 +1,7 @@ @Spanner_Source @SPANNER_TEST Feature: Spanner Source - Verification of Spanner to GCS successful data transfer - @GCS_SINK_TEST + @GCS_SINK_TEST @Spanner_Source_Required Scenario: Verify data is getting transferred from Spanner to GCS successfully Given Open Datafusion Project to configure pipeline When Source is Spanner diff --git a/src/e2e-test/java/io/cdap/plugin/gcs/runners/sinkrunner/TestRunnerRequired.java b/src/e2e-test/java/io/cdap/plugin/gcs/runners/sinkrunner/TestRunnerRequired.java new file mode 100644 index 0000000000..2737804318 --- /dev/null +++ b/src/e2e-test/java/io/cdap/plugin/gcs/runners/sinkrunner/TestRunnerRequired.java @@ -0,0 +1,37 @@ +/* + * Copyright © 2021 Cask Data, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package io.cdap.plugin.gcs.runners.sinkrunner; + +import io.cucumber.junit.Cucumber; +import io.cucumber.junit.CucumberOptions; +import org.junit.runner.RunWith; + +/** + * Test Runner to execute only required GCS sink cases. + */ +@RunWith(Cucumber.class) +@CucumberOptions( + features = {"src/e2e-test/features"}, + glue = {"io.cdap.plugin.gcs.stepsdesign", "io.cdap.plugin.bigquery.stepsdesign", + "stepsdesign", "io.cdap.plugin.common.stepsdesign"}, + tags = {"@GCS_Sink_Required"}, + monochrome = true, + plugin = {"pretty", "html:target/cucumber-html-report/gcs-sink", + "json:target/cucumber-reports/cucumber-gcs-sink.json", + "junit:target/cucumber-reports/cucumber-gcs-sink.xml"} +) +public class TestRunnerRequired { +}