-
Notifications
You must be signed in to change notification settings - Fork 85
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
BQ e2e updated tests #1273
BQ e2e updated tests #1273
Conversation
src/e2e-test/features/bigquery/source/BigQueryToBigQuery_withConnections.feature
Outdated
Show resolved
Hide resolved
src/e2e-test/java/io/cdap/plugin/bigquery/locators/BigQueryLocators.java
Outdated
Show resolved
Hide resolved
src/e2e-test/java/io/cdap/plugin/bigquery/stepsdesign/BQValidation.java
Outdated
Show resolved
Hide resolved
src/e2e-test/java/io/cdap/plugin/bigquery/stepsdesign/BigQuery.java
Outdated
Show resolved
Hide resolved
src/e2e-test/java/io/cdap/plugin/bigquery/stepsdesign/TestSetupHooks.java
Outdated
Show resolved
Hide resolved
/** | ||
* BigQuery Related Locators. | ||
*/ | ||
public class BigQueryLocators { |
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.
All these locators are already present in the framework repo: https://github.com/cdapio/cdap-e2e-tests/blob/develop/src/main/java/io/cdap/e2e/pages/locators/CdfBigQueryPropertiesLocators.java
Why are we re-inventing the wheel here?
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.
Reverting the changes
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.
Reverted.
/** | ||
* GCP test hooks. | ||
*/ | ||
public class TestSetupHooks { |
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.
These test setup hooks are already present here: https://github.com/data-integrations/google-cloud/blob/develop/src/e2e-test/java/io/cdap/plugin/common/stepsdesign/TestSetupHooks.java
Why are we adding them again here?
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.
Reverting the changes
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.
Reverted. @sahusanket
@@ -310,33 +310,4 @@ private enum FilePart { | |||
|
|||
String filePart; | |||
} | |||
|
|||
@Then("Validate the values of records transferred to GCS bucket is equal to the values from source BigQuery table") |
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.
Why are these removed?
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.
Added back.
Then Enter input plugin property: "table" with value: "bqTargetTable" | ||
And Select radio button plugin property: "operation" with value: "upsert" | ||
Then Click plugin property: "updateTableSchema" | ||
Then Enter the Table Key property for performing update and upsert operation with value: "TableKey" |
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.
Replace this step with a generic step definiton like: https://github.com/cdapio/cdap-e2e-tests/blob/4ec16f7af29ffcfb5e44cf549ec7a919cf44d2fa/src/main/java/stepsdesign/PipelineSteps.java#L457
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.
Adding a generic step according to these fields (tableKey, deDupeBy and clusteringOrder) as a locator is different from the one which we used in Cdap e2e framework step.
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 know it is different, my comment was to add a similar generic locator in cdap-e2e-framework and use it here.
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.
Added.
Then Enter input plugin property: "dataset" with value: "dataset" | ||
Then Enter input plugin property: "table" with value: "bqTargetTable" | ||
Then Enter BigQuery sink property partition field "bqPartitionFieldTime" | ||
Then Enter the Cluster property : "clusterValue" |
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.
similarly here, replace it with a generic step.
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.
Replaced with a generic step.
/** | ||
* BigQuery plugin step actions. | ||
*/ | ||
public class BigQueryActions { |
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.
remove this class, similar class is present in cdap-e2e-tests
repo, any changes should be maintained at one place.
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.
Removed.
@@ -1,5 +1,5 @@ | |||
/* | |||
* Copyright © 2021 Cask Data, Inc. | |||
* Copyright © 2023 Cask Data, Inc. |
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.
why this change? Looks like nothing is changed in this file.
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.
An unintended step was initially removed and is now added. Aryan has also suggested changing the year to 2023 as part of the same change.
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.
you said some step definition was added, but I still don't anything changed in this file, am I missing something?
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 Apologize for the misunderstanding. The changes were made to the GCS Base, not the BigQueryBase. Reverted the year back to 2021. commit link
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.
Build is failing with some duplicate step definitons, please fix:
Duplicate step definitions in io.cdap.plugin.bigquery.stepsdesign.BigQuery.validateTheValuesOfRecordsTransferredToGcsBucketIsEqualToTheValuesFromSourceBigQueryTable() in file:/tmp/google-cloud/google-cloud/plugin/target/test-classes/ and io.cdap.plugin.gcs.stepsdesign.GCSBase.validateTheValuesOfRecordsTransferredToGcsBucketIsEqualToTheValuesFromSourceBigQueryTable() in file:/tmp/google-cloud/google-cloud/plugin/target/test-classes/
Resolved. |
Bigquery tests are still failing and does not look like related to existing chrome driver issue, ptal, thanks! |
|
||
|
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.
remove extra empty lines.
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.
Removed.
validateSourceBQToTargetBQRecord("E2E_SOURCE_32bee2c2_8e92_46ab_86af_9f9333371f58", | ||
"E2E_TARGET_9905c77f_c04d_4958_accc_de3f02de1bba"); |
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 are these hardcoded UUIDs??
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.
The main function for debugging and fixing e2e build failures with source and sink tables was added to check on local. Now that they've passed. I've now removed it.
@@ -255,7 +255,7 @@ public static void createTempSourceBQTable() throws IOException, InterruptedExce | |||
records.append(" (").append(index).append(", ").append((int) (Math.random() * 1000 + 1)).append(", '") | |||
.append(UUID.randomUUID()).append("'), "); | |||
} | |||
BigQueryClient.getSoleQueryResult("create table `test_automation." + bqSourceTable + "` as " + | |||
BigQueryClient.getSoleQueryResult("create table `bq_automation." + bqSourceTable + "` as " + |
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.
The value of dataset should come from plugin properties.
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.
Using a dataset constant instead of a hard-coded value.
@@ -285,11 +286,11 @@ public static void deleteTempSourceBQTable() throws IOException, InterruptedExce | |||
@Before(order = 1, value = "@BQ_PARTITIONED_SOURCE_TEST") | |||
public static void createTempPartitionedSourceBQTable() throws IOException, InterruptedException { | |||
bqSourceTable = "E2E_SOURCE_" + UUID.randomUUID().toString().replaceAll("-", "_"); | |||
BigQueryClient.getSoleQueryResult("create table `test_automation." + bqSourceTable + "` " + | |||
BigQueryClient.getSoleQueryResult("create table `bq_automation." + bqSourceTable + "` " + |
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.
similar comment at all places using the hard-coded value.
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.
Resolved.
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.
Plz squash commits before merge.
16c091f
to
23c9479
Compare
All commits have been squashed. However, before you merge the PR. We will raise an another PR for the review of the BQ step in the cdap-e2e-framework because three steps have been skipped |
Sure, will wait for the framework PR to be merged. |
Please review the step added for Big Query. commit Link |
aca754d
into
data-integrations:develop
No description provided.