-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added e2e tests with snapshot and cdc- Draft PR #103
base: develop
Are you sure you want to change the base?
Conversation
# Scenario: Sanity test from Oracle to Big Query | ||
# Given Open DataFusion Project with replication to configure pipeline | ||
# When Enter input plugin property: "name" with value: "pipelineName" | ||
# And Click on the Next button | ||
# And Select Oracle as Source | ||
# Then Replace input plugin property: "host" with value: "host" for Credentials and Authorization related fields | ||
# Then Replace input plugin property: "port" with value: "port" for Credentials and Authorization related fields | ||
# Then Click plugin property: "region" | ||
# Then Click plugin property: "regionOption" | ||
# 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 Replace input plugin property: "sid" with value: "database" for Credentials and Authorization related fields | ||
# Then Click on the Next button | ||
# Then Replace input plugin property: "loadInterval" with value: "loadInterval" | ||
# Then Click on the Next button | ||
# Then Validate Table is available and can be selected "ABC.E2E-sanity" | ||
# And Click on the Next button | ||
# And Click on the Next button | ||
# And Click on the Next button | ||
# Then Deploy the replication pipeline | ||
# And Run the replication Pipeline | ||
# Then Open the logs | ||
# And Wait till pipeline is in running state and check if no errors occurred | ||
# Then Verify expected Oracle records in target BigQuery table | ||
# And Capture raw logs | ||
# Then Close the pipeline logs and stop the pipeline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this comment block be removed?
# And Capture raw logs | ||
# Then Close the pipeline logs and stop the pipeline | ||
|
||
# @ORACLE_SOURCE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the significance of this annotation? Why is it commented out?
# Then Close the pipeline logs and stop the pipeline | ||
|
||
# @ORACLE_SOURCE | ||
Scenario: To verify snapshot and cdc from Oracle to Big Query successfully |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scenario: To verify snapshot and cdc from Oracle to Big Query successfully | |
Scenario: To verify replication of snapshot and cdc data from Oracle to Big Query successfully |
datatypeColumnsForSanityTesting=('USER1', 'M','ABCDEF','ABC','ABC','�','� 好�?�?','� 好�?�?','AAAAaoAATAAABrXAAA',1234,1234.56789,\ | ||
1234.56789,1234.56789,1234.56789,1234.56789,1234.56789,1234.56789,1234.5679,\ | ||
1234.56789,1234.5679,1234.5679,1234.56789,TIMESTAMP'2023-01-01 2:00:00',TIMESTAMP'2023-01-01 2:00:00',\ | ||
TIMESTAMP '2023-01-01 00:00:00.000000') | ||
|
||
datatypeValuesForSanityTesting=('USER1', 'M','ABCDEF','ABC','ABC','�','� 好�?�?','� 好�?�?',\ | ||
'AAAAaoAATAAABrXAAA',1234,1234.56789,\ | ||
1234.56789,1234.56789,1234.56789,1234.56789,1234.56789,1234.56789,1234.5679,\ | ||
1234.56789,1234.5679,1234.5679,1234.56789,TIMESTAMP'2023-01-01 2:00:00',TIMESTAMP'2023-01-01 2:00:00',\ | ||
TIMESTAMP '2023-01-01 00:00:00.000000') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for storing these in property file? Are we storing rows and types like this for existing e2e tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.For connectors, it is done this way.
|
||
public static void waitTillPipelineIsRunningAndCheckForErrors() throws InterruptedException { | ||
//wait for datastream to startup | ||
int defaultTimeout = Integer.parseInt(PluginPropertyUtils.pluginProp("datastream.timeout")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename it to more general term like pipeline initialization time instead of datastream.timeout
bqRow.remove("_is_deleted"); | ||
bqRow.remove("_sequence_num"); | ||
|
||
ValidationHelper.compareBothResponses( bqRow, oracleRecord); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ValidationHelper.compareBothResponses( bqRow, oracleRecord); | |
compareRecords( bqRow, oracleRecord); |
if (port!= null && !port.isEmpty()) { | ||
PluginPropertyUtils.addPluginProp("port", port); | ||
} | ||
String sapHost = System.getenv("ORACLE_HOST"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oracleHost
@Before(order = 1, value = "@ORACLE_SOURCE") | ||
public static void overridePropertiesFromEnvVarsIfProvided() { | ||
String username = System.getenv("ORACLE_USERNAME"); | ||
if (username != null && !username.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if property is null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test will not run like username is used for creating tables, that will fail thereby ending tests
|
||
@Before(order = 4, value = "@ORACLE_SOURCE") | ||
public static void getOracleRecordsAsMap() throws SQLException, ClassNotFoundException { | ||
sourceOracleRecords = OracleClient.getOracleRecordsAsMap(tableName, schemaName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for logging expected records before test starts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
|
||
@After(order = 1, value = "@ORACLE_SOURCE_TEMP") | ||
public static void dropTables() throws SQLException, ClassNotFoundException { | ||
OracleClient.deleteTables(schemaName, tableName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we drop BQ table as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we can. But having target table is good for validation after e2e tests are done
@@ -0,0 +1,50 @@ | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to rename the file to SanityTests.feature to reflect the intent
No description provided.