Skip to content

Commit 717fa07

Browse files
CloudSql My Sql Sink Run Time Scenarios e2e tests
1 parent ec40077 commit 717fa07

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

cloudsql-mysql-plugin/src/e2e-test/features/source/CloudMySqlRunTime.feature

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Feature: CloudMySql Source - Run time scenarios
1717

1818
Feature: CloudMySql - Verify data transfer from CloudMySql source to BigQuery sink
1919

20-
@CLOUDMYSQL_SOURCE_TEST
20+
@CLOUDMYSQL_SOURCE_TEST @BQ_SINK_TEST
2121
Scenario: To verify data is getting transferred from CloudMySql source to BigQuery sink successfully
2222
Given Open Datafusion Project to configure pipeline
2323
When Expand Plugin group in the LHS plugins list: "Source"
@@ -104,7 +104,7 @@ Feature: CloudMySql - Verify data transfer from CloudMySql source to BigQuery si
104104
Then Close the pipeline logs
105105
#Then Validate the values of records transferred to target Big Query table is equal to the values from source table
106106

107-
@CLOUDMYSQL_SOURCE_DATATYPES_TEST
107+
@CLOUDMYSQL_SOURCE_DATATYPES_TEST @CLOUDMYSQL_SINK_TEST
108108
Scenario: To verify data is getting transferred from CloudMySql source to CloudMySql sink successfully
109109
Given Open Datafusion Project to configure pipeline
110110
When Expand Plugin group in the LHS plugins list: "Source"
@@ -122,7 +122,7 @@ Feature: CloudMySql - Verify data transfer from CloudMySql source to BigQuery si
122122
Then Enter input plugin property: "database" with value: "DatabaseName"
123123
Then Enter textarea plugin property: "importQuery" with value: "selectQuery"
124124
Then Click on the Get Schema button
125-
# Then Verify the Output Schema matches the Expected Schema: "OutputSchema"
125+
Then Verify the Output Schema matches the Expected Schema: "datatypesSchema"
126126
Then Validate "CloudSQL MySQL" plugin properties
127127
Then Close the Plugin Properties page
128128
Then Navigate to the properties page of plugin: "CloudSQL MySQL2"
@@ -145,9 +145,8 @@ Feature: CloudMySql - Verify data transfer from CloudMySql source to BigQuery si
145145
Then Wait till pipeline is in running state
146146
Then Open and capture logs
147147
Then Verify the pipeline status is "Succeeded"
148-
Then Validate the values of records transferred to target table is equal to the values from source table
149148

150-
@CLOUDMYSQL_SOURCE_DATATYPES_TEST
149+
@CLOUDMYSQL_SOURCE_DATATYPES_TEST @CLOUDMYSQL_SINK_TEST
151150
Scenario: To verify data is getting transferred from CloudMySql source to CloudMySql successfully when connection arguments are set
152151
Given Open Datafusion Project to configure pipeline
153152
When Expand Plugin group in the LHS plugins list: "Source"

cloudsql-mysql-plugin/src/e2e-test/java/io/cdap/plugin/CloudMySql/stepsdesign/CloudMysql.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
public class CloudMysql implements CdfHelper {
1717

1818
@Then("Validate the values of records transferred to target table is equal to the values from source table")
19-
public void validateTheValuesOfRecordsTransferredToTargetTableIsEqualToTheValuesFromSourceTable() throws SQLException, ClassNotFoundException {
19+
public void validateTheValuesOfRecordsTransferredToTargetTableIsEqualToTheValuesFromSourceTable()
20+
throws SQLException, ClassNotFoundException {
2021
int countRecords = CloudMySqlClient.countRecord(PluginPropertyUtils.pluginProp("targetTable"));
2122
Assert.assertEquals("Number of records transferred should be equal to records out ",
2223
countRecords, recordOut());

cloudsql-mysql-plugin/src/e2e-test/java/io/cdap/plugin/CloudMySqlClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ public static void createTargetDatatypesTable(String targetTable) throws SQLExce
163163
String datatypesColumns = PluginPropertyUtils.pluginProp("datatypesColumns");
164164
String createTargetTableQuery = "CREATE TABLE " + targetTable + " " + datatypesColumns;
165165
statement.executeUpdate(createTargetTableQuery);
166+
System.out.println(createTargetTableQuery);
166167
}
167168
}
168169

cloudsql-mysql-plugin/src/e2e-test/resources/pluginParameters.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ datatypesValue1=VALUES ('User1',1,-1,true,-32768,HEX('27486920546869732069732061
6666
'This is a test message to check ','X')
6767
datatypesSchema=[{"key":"ID","value":"string"},{"key":"COL1","value":"boolean"},{"key":"COL2","value":"int"},\
6868
{"key":"COL3","value":"boolean"},{"key":"COL4","value":"int"},{"key":"COL5","value":"bytes"},\
69-
{"key":"COL6","value":"double"},{"key":"COL7","value":"int"},{"key":"COL8","value":"long"},\
69+
{"key":"COL6","value":"int"},{"key":"COL7","value":"int"},{"key":"COL8","value":"long"},\
7070
{"key":"COL9","value":"float"},{"key":"COL10","value":"date"},{"key":"COL11","value":"timestamp"},\
7171
{"key":"COL12","value":"decimal"},{"key":"COL13","value":"double"},{"key":"COL14","value":"string"},\
7272
{"key":"COL15","value":"time"},{"key":"COL16","value":"timestamp"},\
7373
{"key":"COL18","value":"string"},{"key":"COL19","value":"bytes"},{"key":"COL20","value":"string"},\
7474
{"key":"COL21","value":"bytes"},{"key":"COL22","value":"bytes"},{"key":"COL23","value":"bytes"},\
75-
{"key":"COL24","value":"bytes"},{"key":"COL25","value":"string"},{"key":"COL26","value":"time"},\
75+
{"key":"COL24","value":"bytes"},{"key":"COL25","value":"string"},{"key":"COL26","value":"string"},\
7676
{"key":"COL27","value":"bytes"},{"key":"COL28","value":"string"},{"key":"COL29","value":"string"}]
7777

7878
bqOutputMultipleDatatypesSchema= [{"key":"col1","value":"bytes"},{"key":"col2","value":"string"},\

0 commit comments

Comments
 (0)