Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,67 @@ Feature: CloudMySql source- Verify CloudMySql source plugin design time validati
Then Click on the Validate button
Then Verify that the Plugin Property: "boundingQuery" is displaying an in-line error message: "errorMessageBoundingQuery"
Then Verify that the Plugin Property: "numSplits" is displaying an in-line error message: "errorMessageNumberOfSplits"

@CloudMySql_Required
Scenario: Verify CloudSQLMySQL source plugin validation errors for mandatory fields
Given Open Datafusion Project to configure pipeline
When Select plugin: "CloudSQL MySQL" from the plugins list as: "Source"
Then Navigate to the properties page of plugin: "CloudSQL MySQL"
Then Click on the Validate button
Then Verify mandatory property error for below listed properties:
| jdbcPluginName |
| connectionName |
| database |
| referenceName |
| importQuery |

@CloudMySql_Required
Scenario: To verify CloudSQLMySQL source plugin validation error message with invalid connection name with public instance
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
When Select plugin: "CloudSQL MySQL" from the plugins list as: "Source"
Then Navigate to the properties page of plugin: "CloudSQL MySQL"
Then Select dropdown plugin property: "select-jdbcPluginName" with option value: "driverName"
Then Select radio button plugin property: "instanceType" with value: "public"
Then Replace input plugin property: "connectionName" with value: "invalidConnectionName"
Then Replace input plugin property: "user" with value: "username" for Credentials and Authorization related fields
Then Replace input plugin property: "password" with value: "password" for Credentials and Authorization related fields
Then Enter input plugin property: "referenceName" with value: "sourceRef"
Then Replace input plugin property: "database" with value: "DatabaseName"
Then Enter textarea plugin property: "importQuery" with value: "selectQuery"
Then Click on the Validate button
Then Verify that the Plugin Property: "connectionName" is displaying an in-line error message: "errorMessageConnectionName"

@CloudMySql_Required
Scenario: To verify CloudSQLMySQL source plugin validation error message with invalid connection name with private instance
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
When Select plugin: "CloudSQL MySQL" from the plugins list as: "Source"
Then Navigate to the properties page of plugin: "CloudSQL MySQL"
Then Select dropdown plugin property: "select-jdbcPluginName" with option value: "driverName"
Then Select radio button plugin property: "instanceType" with value: "private"
Then Replace input plugin property: "connectionName" with value: "invalidConnectionName"
Then Replace input plugin property: "user" with value: "username" for Credentials and Authorization related fields
Then Replace input plugin property: "password" with value: "password" for Credentials and Authorization related fields
Then Enter input plugin property: "referenceName" with value: "sourceRef"
Then Replace input plugin property: "database" with value: "DatabaseName"
Then Enter textarea plugin property: "importQuery" with value: "selectQuery"
Then Click on the Validate button
Then Verify that the Plugin Property: "connectionName" is displaying an in-line error message: "errorMessagePrivateConnectionName"

@CloudMySql_Required
Scenario: To verify CloudSQLMySQL source plugin validation error message with invalid password
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
When Select plugin: "CloudSQL MySQL" from the plugins list as: "Source"
Then Navigate to the properties page of plugin: "CloudSQL MySQL"
Then Select dropdown plugin property: "select-jdbcPluginName" with option value: "driverName"
Then Select radio button plugin property: "instanceType" with value: "public"
Then Replace input plugin property: "connectionName" with value: "connectionName" for Credentials and Authorization related fields
Then Replace input plugin property: "user" with value: "username" for Credentials and Authorization related fields
Then Replace input plugin property: "password" with value: "invalidPassword" for Credentials and Authorization related fields
Then Enter input plugin property: "referenceName" with value: "sourceRef"
Then Replace input plugin property: "database" with value: "DatabaseName"
Then Enter textarea plugin property: "importQuery" with value: "selectQuery"
Then Click on the Validate button
Then Verify that the Plugin is displaying an error message: "errorMessageInvalidPassword" on the header
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,92 @@ Feature: CloudMySql Source - Run time scenarios
Then Open Pipeline logs and verify Log entries having below listed Level and Message:
| Level | Message |
| ERROR | errorLogsMessageInvalidBoundingQuery |

@CLOUDSQLMYSQL_SOURCE_TEST @CLOUDSQLMYSQL_TARGET_TEST @CloudMySql_Required
Scenario: To verify data is getting transferred from CloudMySql source to CloudMySql sink successfully with bounding query
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
When Select plugin: "CloudSQL MySQL" from the plugins list as: "Source"
When Expand Plugin group in the LHS plugins list: "Sink"
When Select plugin: "CloudSQL MySQL" from the plugins list as: "Sink"
Then Connect plugins: "CloudSQL MySQL" and "CloudSQL MySQL2" to establish connection
Then Navigate to the properties page of plugin: "CloudSQL MySQL"
Then Select dropdown plugin property: "select-jdbcPluginName" with option value: "driverName"
Then Select radio button plugin property: "instanceType" with value: "public"
Then Replace input plugin property: "connectionName" with value: "connectionName" for Credentials and Authorization related fields
Then Replace input plugin property: "user" with value: "username" for Credentials and Authorization related fields
Then Replace input plugin property: "password" with value: "password" for Credentials and Authorization related fields
Then Enter input plugin property: "referenceName" with value: "RefName"
Then Enter input plugin property: "database" with value: "DatabaseName"
Then Enter textarea plugin property: "importQuery" with value: "selectQuery"
Then Enter textarea plugin property: "boundingQuery" with value: "boundingQuery"
Then Click on the Get Schema button
Then Verify the Output Schema matches the Expected Schema: "outputSourceSchema"
Then Validate "CloudSQL MySQL" plugin properties
Then Close the Plugin Properties page
Then Navigate to the properties page of plugin: "CloudSQL MySQL2"
Then Select dropdown plugin property: "select-jdbcPluginName" with option value: "driverName"
Then Select radio button plugin property: "instanceType" with value: "public"
Then Replace input plugin property: "connectionName" with value: "connectionName" for Credentials and Authorization related fields
Then Replace input plugin property: "user" with value: "username" for Credentials and Authorization related fields
Then Replace input plugin property: "password" with value: "password" for Credentials and Authorization related fields
Then Enter input plugin property: "referenceName" with value: "RefName"
Then Enter input plugin property: "database" with value: "DatabaseName"
Then Replace input plugin property: "tableName" with value: "targetTable"
Then Validate "CloudSQL MySQL2" plugin properties
Then Close the Plugin Properties page
Then Save the pipeline
Then Preview and run the pipeline
Then Verify the preview of pipeline is "success"
Then Close the preview
Then Deploy the pipeline
Then Run the Pipeline in Runtime
Then Wait till pipeline is in running state
Then Open and capture logs
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

@CLOUDSQLMYSQL_SOURCE_TEST @CLOUDSQLMYSQL_TARGET_TEST @CloudMySql_Required
Scenario: To verify data is getting transferred from CloudMySql source to CloudMySql sink successfully when connection arguments are set to read boolean datatype
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
When Select plugin: "CloudSQL MySQL" from the plugins list as: "Source"
When Expand Plugin group in the LHS plugins list: "Sink"
When Select plugin: "CloudSQL MySQL" from the plugins list as: "Sink"
Then Connect plugins: "CloudSQL MySQL" and "CloudSQL MySQL2" to establish connection
Then Navigate to the properties page of plugin: "CloudSQL MySQL"
Then Select dropdown plugin property: "select-jdbcPluginName" with option value: "driverName"
Then Select radio button plugin property: "instanceType" with value: "public"
Then Replace input plugin property: "connectionName" with value: "connectionName" for Credentials and Authorization related fields
Then Replace input plugin property: "user" with value: "username" for Credentials and Authorization related fields
Then Replace input plugin property: "password" with value: "password" for Credentials and Authorization related fields
Then Enter input plugin property: "referenceName" with value: "RefName"
Then Enter input plugin property: "database" with value: "DatabaseName"
Then Enter key value pairs for plugin property: "connectionArguments" with values from json: "connectionArgumentsForBooleanDataType"
Then Enter textarea plugin property: "importQuery" with value: "selectQuery"
Then Click on the Get Schema button
Then Verify the Output Schema matches the Expected Schema: "outputSourceSchema"
Then Validate "CloudSQL MySQL" plugin properties
Then Close the Plugin Properties page
Then Navigate to the properties page of plugin: "CloudSQL MySQL2"
Then Select dropdown plugin property: "select-jdbcPluginName" with option value: "driverName"
Then Select radio button plugin property: "instanceType" with value: "public"
Then Replace input plugin property: "connectionName" with value: "connectionName" for Credentials and Authorization related fields
Then Replace input plugin property: "user" with value: "username" for Credentials and Authorization related fields
Then Replace input plugin property: "password" with value: "password" for Credentials and Authorization related fields
Then Enter input plugin property: "referenceName" with value: "RefName"
Then Enter key value pairs for plugin property: "connectionArguments" with values from json: "connectionArgumentsForBooleanDataType"
Then Enter input plugin property: "database" with value: "DatabaseName"
Then Replace input plugin property: "tableName" with value: "targetTable"
Then Validate "CloudSQL MySQL2" plugin properties
Then Close the Plugin Properties page
Then Save the pipeline
Then Preview and run the pipeline
Then Verify the preview of pipeline is "success"
Then Close the preview
Then Deploy the pipeline
Then Run the Pipeline in Runtime
Then Wait till pipeline is in running state
Then Open and capture logs
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
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,59 @@ Feature: CloudMySql - Verify CloudMySql plugin data transfer with macro argument
Then Verify the pipeline status is "Succeeded"
Then Close the pipeline logs
Then Validate the values of records transferred to target Big Query table is equal to the values from source table

@CLOUDSQLMYSQL_SOURCE_TEST @CLOUDSQLMYSQL_TARGET_TEST @CloudMySql_Required
Scenario: To verify data is getting transferred from CloudMySql to CloudMySql successfully when connection arguments,bounding query are macro enabled
Given Open Datafusion Project to configure pipeline
When Expand Plugin group in the LHS plugins list: "Source"
When Select plugin: "CloudSQL MySQL" from the plugins list as: "Source"
When Expand Plugin group in the LHS plugins list: "Sink"
When Select plugin: "CloudSQL MySQL" from the plugins list as: "Sink"
Then Connect plugins: "CloudSQL MySQL" and "CloudSQL MySQL2" to establish connection
Then Navigate to the properties page of plugin: "CloudSQL MySQL"
Then Select dropdown plugin property: "select-jdbcPluginName" with option value: "driverName"
Then Select radio button plugin property: "instanceType" with value: "public"
Then Replace input plugin property: "connectionName" with value: "connectionName" for Credentials and Authorization related fields
Then Replace input plugin property: "user" with value: "username" for Credentials and Authorization related fields
Then Replace input plugin property: "password" with value: "password" for Credentials and Authorization related fields
Then Click on the Macro button of Property: "connectionArguments" and set the value to: "connArgumentsSource"
Then Enter input plugin property: "referenceName" with value: "RefName"
Then Enter textarea plugin property: "importQuery" with value: "selectQuery"
Then Enter input plugin property: "database" with value: "DatabaseName"
Then Click on the Macro button of Property: "boundingQuery" and set the value in textarea: "CloudMysqlBoundingQuery"
Then Validate "CloudSQL MySQL" plugin properties
Then Close the Plugin Properties page
Then Navigate to the properties page of plugin: "CloudSQL MySQL2"
Then Select dropdown plugin property: "select-jdbcPluginName" with option value: "driverName"
Then Select radio button plugin property: "instanceType" with value: "public"
Then Replace input plugin property: "connectionName" with value: "connectionName" for Credentials and Authorization related fields
Then Replace input plugin property: "user" with value: "username" for Credentials and Authorization related fields
Then Replace input plugin property: "password" with value: "password" for Credentials and Authorization related fields
Then Click on the Macro button of Property: "connectionArguments" and set the value to: "connArgumentsSink"
Then Enter input plugin property: "referenceName" with value: "RefName"
Then Enter input plugin property: "database" with value: "DatabaseName"
Then Replace input plugin property: "tableName" with value: "targetTable"
Then Validate "CloudSQL MySQL2" plugin properties
Then Close the Plugin Properties page
Then Save the pipeline
Then Preview and run the pipeline
Then Enter runtime argument value "connectionArguments" for key "connArgumentsSource"
Then Enter runtime argument value "connectionArguments" for key "connArgumentsSink"
Then Enter runtime argument value "boundingQuery" for key "CloudMysqlBoundingQuery"
Then Run the preview of pipeline with runtime arguments
Then Wait till pipeline preview is in running state
Then Open and capture pipeline preview logs
Then Verify the preview run status of pipeline in the logs is "succeeded"
Then Close the pipeline logs
Then Close the preview
Then Deploy the pipeline
Then Run the Pipeline in Runtime
Then Enter runtime argument value "connectionArguments" for key "connArgumentsSource"
Then Enter runtime argument value "connectionArguments" for key "connArgumentsSink"
Then Enter runtime argument value "boundingQuery" for key "CloudMysqlBoundingQuery"
Then Run the Pipeline in Runtime with runtime arguments
Then Wait till pipeline is in running state
Then Open and capture logs
Then Verify the pipeline status is "Succeeded"
Then Close the pipeline logs
Then Validate the values of records transferred to target table is equal to the values from source table
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,37 @@ public static void deleteTable(String table)
statement.execute(dropTableQuery);
}
}

public static void createSourceTestTable(String sourceTable) throws SQLException, ClassNotFoundException {
try (Connection connect = getCloudSqlConnection();
Statement statement = connect.createStatement()) {
String createSourceTableQuery = "CREATE TABLE IF NOT EXISTS " + sourceTable +
"(id int, lastName varchar(255), PRIMARY KEY (id), is_active BOOLEAN NOT NULL)";
statement.executeUpdate(createSourceTableQuery);

// Truncate table to clean the data of last failure run.
String truncateSourceTableQuery = "TRUNCATE TABLE " + sourceTable;
statement.executeUpdate(truncateSourceTableQuery);

// Insert dummy data.
statement.executeUpdate("INSERT INTO " + sourceTable + " (id, lastName, is_active)" +
"VALUES (1, 'Simpson', true)");
statement.executeUpdate("INSERT INTO " + sourceTable + " (id, lastName, is_active)" +
"VALUES (2, 'McBeal', true)");
statement.executeUpdate("INSERT INTO " + sourceTable + " (id, lastName, is_active)" +
"VALUES (3, 'Flinstone', false)");
}
}

public static void createTargetTestTable(String targetTable) throws SQLException, ClassNotFoundException {
try (Connection connect = getCloudSqlConnection();
Statement statement = connect.createStatement()) {
String createTargetTableQuery = "CREATE TABLE IF NOT EXISTS " + targetTable +
"(id int, lastName varchar(255), PRIMARY KEY (id), is_active BOOLEAN NOT NULL)";
statement.executeUpdate(createTargetTableQuery);
// Truncate table to clean the data of last failure run.
String truncateTargetTableQuery = "TRUNCATE TABLE " + targetTable;
statement.executeUpdate(truncateTargetTableQuery);
}
}
}
Loading
Loading