Skip to content
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

Merged

Conversation

priyabhatnagar25
Copy link
Contributor

No description provided.

/**
* BigQuery Related Locators.
*/
public class BigQueryLocators {
Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverting the changes

Copy link
Contributor

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverting the changes

Copy link
Contributor

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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these removed?

Copy link
Contributor

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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Contributor

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"
Copy link
Member

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.

Copy link
Contributor

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 {
Copy link
Member

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

@itsankit-google itsankit-google added the build Trigger unit test build label Aug 8, 2023
@@ -1,5 +1,5 @@
/*
* Copyright © 2021 Cask Data, Inc.
* Copyright © 2023 Cask Data, Inc.
Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Member

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?

Copy link
Contributor

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

Copy link
Member

@itsankit-google itsankit-google left a 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/

@bharatgulati
Copy link
Contributor

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.

@itsankit-google
Copy link
Member

Resolved.

Bigquery tests are still failing and does not look like related to existing chrome driver issue, ptal, thanks!

@Vipinofficial11 Vipinofficial11 added build Trigger unit test build and removed build Trigger unit test build labels Aug 9, 2023
Comment on lines 56 to 57


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra empty lines.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

Comment on lines 45 to 46
validateSourceBQToTargetBQRecord("E2E_SOURCE_32bee2c2_8e92_46ab_86af_9f9333371f58",
"E2E_TARGET_9905c77f_c04d_4958_accc_de3f02de1bba");
Copy link
Member

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??

Copy link
Contributor

@bharatgulati bharatgulati Aug 9, 2023

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 " +
Copy link
Member

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.

Copy link
Contributor

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 + "` " +
Copy link
Member

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved.

Copy link
Member

@itsankit-google itsankit-google left a 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.

@bharatgulati
Copy link
Contributor

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

@itsankit-google
Copy link
Member

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.

@bharatgulati
Copy link
Contributor

bharatgulati commented Aug 11, 2023

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

@itsankit-google itsankit-google merged commit aca754d into data-integrations:develop Aug 16, 2023
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Trigger unit test build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants