Skip to content

Commit

Permalink
Merge pull request #416 from cloudsufi/e2e-mysql
Browse files Browse the repository at this point in the history
[PLUGIN-1642] e2e_mysql hook changes
  • Loading branch information
itsankit-google authored Jul 18, 2023
2 parents bc60c65 + 8681acf commit 6c78d43
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@Mysql
Feature: MySQL Sink - Design time scenarios

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_TARGET_TEST @Mysql_Required
Scenario: Verify user can validate successfully when sink plugin is configured for table with basic details
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Sink"
Expand All @@ -31,7 +31,7 @@ Feature: MySQL Sink - Design time scenarios
Then Enter input plugin property: "referenceName" with value: "targetRef"
Then Validate "MySQL2" plugin properties

@MYSQL_SOURCE_TEST @CONNECTION @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_TARGET_TEST @CONNECTION @Mysql_Required
Scenario: Verify the MySQL Sink plugin using connection manager functionality
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Sink"
Expand All @@ -58,7 +58,7 @@ Feature: MySQL Sink - Design time scenarios
Then Validate "MySQL" plugin properties
Then Close the Plugin Properties page

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_TARGET_TEST @Mysql_Required
Scenario: Verify user should be able to validate sink plugin successfully by setting the advanced section fields
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Sink"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@Mysql
Feature: MySQL Sink - Design time validation scenarios

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: Verify Database field validation error message with invalid test data
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down Expand Up @@ -46,7 +46,7 @@ Feature: MySQL Sink - Design time validation scenarios
Then Click on the Validate button
Then Verify that the Plugin is displaying an error message: "invalid.sink.database.message" on the header

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: Verify Table Name Field validation error message with invalid test data
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down Expand Up @@ -77,7 +77,7 @@ Feature: MySQL Sink - Design time validation scenarios
Then Click on the Validate button
Then Verify that the Plugin Property: "tableName" is displaying an in-line error message: "invalidtableName.error.message"

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: Verify Reference Name field validation error message with invalid test data
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down Expand Up @@ -108,7 +108,7 @@ Feature: MySQL Sink - Design time validation scenarios
Then Click on the Validate button
Then Verify that the Plugin Property: "referenceName" is displaying an in-line error message: "invalidreferenceName.error.message"

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: Verify the Username field validation error message with blank value
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down Expand Up @@ -138,7 +138,7 @@ Feature: MySQL Sink - Design time validation scenarios
Then Click on the Validate button
Then Verify that the Plugin Property: "user" is displaying an in-line error message: "blank.username.message"

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: Verify the host validation error message with blank value
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@Mysql
Feature: MySQL Sink - Design time scenarios (macro)

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: Verify user should be able to validate sink plugin with macros for Connection section
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down Expand Up @@ -45,7 +45,7 @@ Feature: MySQL Sink - Design time scenarios (macro)
Then Replace input plugin property: "tableName" with value: "targetTable"
Then Click on the Validate button

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: Verify user should be able to validate sink plugin with macros for Basic section
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down
4 changes: 2 additions & 2 deletions mysql-plugin/src/e2e-test/features/mysqlsink/RunTime.feature
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Feature: MySQL Sink - Run time scenarios
Then Verify the pipeline status is "Succeeded"
Then Validate the values of records transferred to target MySQL table is equal to the values from source BigQuery table

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: To verify data is getting transferred from Mysql to Mysql successfully
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down Expand Up @@ -100,7 +100,7 @@ Feature: MySQL Sink - Run time scenarios
Then Verify the pipeline status is "Succeeded"
Then Validate the values of records transferred to target table is equal to the values from source table

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: To verify data is getting transferred from Mysql to Mysql successfully when advance section details are set
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Feature: MySQL Sink - Run time scenarios (macro)
Then Verify the pipeline status is "Succeeded"
Then Validate the values of records transferred to target Big Query table is equal to the values from source table

@BQ_SOURCE_TEST @MYSQL_TARGET_TABLE @Mysql_Required
@BQ_SOURCE_TEST @Mysql_Required
Scenario: Verify that the pipeline fails when user provides invalid Table Name of plugin with Macros
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@Mysql
Feature: Mysql - Verify Mysql source data transfer for different datatype

@MYSQL_SOURCE_DATATYPES_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_DATATYPES_TEST @MYSQL_TARGET_DATATYPES_TEST @Mysql_Required
Scenario: To verify data is getting transferred from Mysql to Mysql successfully
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down Expand Up @@ -61,7 +61,7 @@ Feature: Mysql - Verify Mysql source data transfer for different datatype
Then Verify the pipeline status is "Succeeded"
Then Validate the values of records transferred to target table is equal to the values from source table

@MYSQL_SOURCE_DATATYPES_TEST @BQ_SINK @Mysql_Required @Plugin-20670
@MYSQL_SOURCE_DATATYPES_TEST @BQ_SINK @BQ_SINK_CLEANUP @Mysql_Required @Plugin-20670
Scenario: To verify data is getting transferred from Mysql to BigQuery successfully
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@Mysql
Feature: Mysql - Verify Mysql source data transfer

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: To verify data is getting transferred from Mysql to Mysql successfully
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Feature: MySQL Source - Run time scenarios
Then Validate OUT record count is equal to records transferred to target BigQuery table
Then Validate the values of records transferred to target Big Query table is equal to the values from source table

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required @test
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required @test
Scenario: To verify data is getting transferred from Mysql to Mysql successfully when advance section details are set
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down Expand Up @@ -105,7 +105,7 @@ Feature: MySQL Source - Run time scenarios
Then Verify the pipeline status is "Succeeded"
Then Validate the values of records transferred to target table is equal to the values from source table

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: Verify the pipeline fails when plugin is configured with invalid bounding query
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down Expand Up @@ -145,7 +145,7 @@ Feature: MySQL Source - Run time scenarios
Then Wait till pipeline preview is in running state
Then Verify the preview run status of pipeline in the logs is "failed"

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: To verify data is getting transferred from Mysql to Mysql successfully when connection arguments are set
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@Mysql
Feature: MySQL Source - Run time scenarios (macro)

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: To verify data is getting transferred from Mysql to Mysql successfully using macros for Connection section
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down Expand Up @@ -68,7 +68,7 @@ Feature: MySQL Source - Run time scenarios (macro)
Then Verify the pipeline status is "Succeeded"
Then Validate the values of records transferred to target table is equal to the values from source table

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: To verify data is getting transferred from Mysql to Mysql successfully using macros for Basic section
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down Expand Up @@ -166,7 +166,7 @@ Feature: MySQL Source - Run time scenarios (macro)
Then Verify the pipeline status is "Succeeded"
Then Validate the values of records transferred to target Big Query table is equal to the values from source table

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: Verify that pipeline fails when user provides invalid Table name in importQuery of plugin with Macros
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down Expand Up @@ -203,7 +203,7 @@ Feature: MySQL Source - Run time scenarios (macro)
And Wait till pipeline is in running state
And Verify the pipeline status is "Failed"

@MYSQL_SOURCE_TEST @MYSQL_SINK_TEST @Mysql_Required
@MYSQL_SOURCE_TEST @MYSQL_TARGET_TEST @Mysql_Required
Scenario: Verify that pipeline fails when user provides invalid Credentials for connection with Macros
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,59 @@ public static void initializeDBProperties() {
}

@Before(order = 2, value = "@MYSQL_SOURCE_TEST")
public static void createTables() throws SQLException, ClassNotFoundException {
public static void createSourceTables() throws SQLException, ClassNotFoundException {
MysqlClient.createSourceTable(PluginPropertyUtils.pluginProp("sourceTable"));
BeforeActions.scenario.write("MYSQL Source table - " + PluginPropertyUtils.pluginProp("sourceTable")
+ " created successfully");
}

@Before(order = 2, value = "@MYSQL_TARGET_TEST")
public static void createTargetTables() throws SQLException, ClassNotFoundException {
MysqlClient.createTargetTable(PluginPropertyUtils.pluginProp("targetTable"));
BeforeActions.scenario.write("MYSQL Target table - " + PluginPropertyUtils.pluginProp("targetTable")
+ " created successfully");
}

@Before(order = 2, value = "@MYSQL_SOURCE_DATATYPES_TEST")
public static void createDatatypesTable() throws SQLException, ClassNotFoundException {
public static void createSourceDatatypesTable() throws SQLException, ClassNotFoundException {
MysqlClient.createSourceDatatypesTable(PluginPropertyUtils.pluginProp("sourceTable"));
BeforeActions.scenario.write("MYSQL Source Table - " + PluginPropertyUtils.pluginProp("sourceTable") +
" created successfully");
}

@Before(order = 2, value = "@MYSQL_TARGET_DATATYPES_TEST")
public static void createTargetDatatypesTable() throws SQLException, ClassNotFoundException {
MysqlClient.createTargetDatatypesTable(PluginPropertyUtils.pluginProp("targetTable"));
BeforeActions.scenario.write("MYSQL Target table - " + PluginPropertyUtils.pluginProp("targetTable")
+ " created successfully");
}

@After(order = 2, value = "@MYSQL_SINK_TEST")
public static void dropTables() throws SQLException, ClassNotFoundException {
MysqlClient.dropTables(new String[]{PluginPropertyUtils.pluginProp("sourceTable"),
PluginPropertyUtils.pluginProp("targetTable")});
@After(order = 2, value = "@MYSQL_SOURCE_TEST")
public static void dropSourceTables() throws SQLException, ClassNotFoundException {
MysqlClient.dropTable(PluginPropertyUtils.pluginProp("sourceTable"));
BeforeActions.scenario.write("MYSQL Source Table - " + PluginPropertyUtils.pluginProp("sourceTable") +
" deleted successfully");
}

@After(order = 2, value = "@MYSQL_TARGET_TEST")
public static void dropTargetTables() throws SQLException, ClassNotFoundException {
MysqlClient.dropTable(PluginPropertyUtils.pluginProp("targetTable"));
BeforeActions.scenario.write("MYSQL Target table - " + PluginPropertyUtils.pluginProp("targetTable")
+ " deleted successfully");
}

@After(order = 2, value = "@MYSQL_SOURCE_DATATYPES_TEST")
public static void dropSourceDatatypeTables() throws SQLException, ClassNotFoundException {
MysqlClient.dropTable(PluginPropertyUtils.pluginProp("sourceTable"));
BeforeActions.scenario.write("MYSQL Source Table - " + PluginPropertyUtils.pluginProp("sourceTable") +
" deleted successfully");
}

@After(order = 2, value = "@MYSQL_TARGET_DATATYPES_TEST")
public static void dropTargetDatatypeTables() throws SQLException, ClassNotFoundException {
MysqlClient.dropTable(PluginPropertyUtils.pluginProp("targetTable"));
BeforeActions.scenario.write("MYSQL Target table - " + PluginPropertyUtils.pluginProp("targetTable")
+ " deleted successfully");
}

@Before(order = 1, value = "@BQ_SINK")
Expand All @@ -103,18 +141,20 @@ public static void deleteTempTargetBQTable() throws IOException, InterruptedExce
}
}

@Before(order = 1, value = "@MYSQL_TARGET_TABLE")
@Before(order = 2, value = "@MYSQL_TARGET_TABLE")
public static void createMysqlTargetTable() throws SQLException, ClassNotFoundException {
MysqlClient.createTargetTable1(PluginPropertyUtils.pluginProp("targetTable"));
BeforeActions.scenario.write("MYSQL Target table - " + PluginPropertyUtils.pluginProp("targetTable")
+ " created successfully");
}

@After(order = 2, value = "@MYSQL_TARGET_TABLE")
public static void dropTargetTable() throws SQLException, ClassNotFoundException {
MysqlClient.dropTable(PluginPropertyUtils.pluginProp("targetTable"));
BeforeActions.scenario.write("MYSQL Target table - " + PluginPropertyUtils.pluginProp("targetTable")
+ " deleted successfully");
}



/**
* Create BigQuery table.
*/
Expand Down Expand Up @@ -173,3 +213,4 @@ public static void setNewConnectionName() {
BeforeActions.scenario.write("New Connection name: " + connectionName);
}
}

0 comments on commit 6c78d43

Please sign in to comment.