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

e2e bigquerymultitable scenarios #6

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

itsmekumari
Copy link
Collaborator

e2e bigquerymultitable scenarios

@Vipinofficial11 Vipinofficial11 requested review from bharatgulati and removed request for bharatgulati August 8, 2023 11:13
# License for the specific language governing permissions and limitations under
# the License.

@BigQueryMultiTable_Sink
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can just make the tag as BQMT_SINK.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Change done.

Feature: BigQueryMultiTable sink -Verification of BigQuery to BigQueryMultiTable successful data transfer using macros

@MULTIPLEDATABASETABLE_SOURCE_TEST
Scenario:Verify data is getting transferred from BigQuery to BQMT sink with all datatypes using macros
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the scenario it says we are running a pipeline from BQ to BQMT but we are selecting source as Multiple Database Tables which one is it ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed to Multiple Database Tables


@MULTIPLEDATABASETABLE_SOURCE_TEST
Scenario:Verify data is getting transferred from BigQuery to BQMT sink with split field using macros
Given Open Datafusion Project to configure pipeline
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment here related to BigQuery

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed to Multiple Database Tables

Then Validate the values of records transferred to BQMT sink is equal to the value from source MultiDatabase table

@MULTIPLEDATABASETABLE_SOURCE_DATATYPES_TEST
Scenario:Verify data is getting transferred from BigQuery to BQMT sink with split field
Copy link
Collaborator

Choose a reason for hiding this comment

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

BigQuery -> Multiple Database Tables

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

public static WebElement datasetProject;

@FindBy(how = How.XPATH, using = "//input[@data-cy='location']")
public static WebElement location;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where are we using these 2 locators I don't see them in actions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

@FindBy(how = How.XPATH, using = "//input[@data-cy='location']")
public static WebElement location;

@FindBy(how = How.XPATH, using = "//*[@data-cy='sqlStatements']//*[@data-cy='key']/input")
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is a new property can we make a common locator out of this and add this in the framework ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@priyabhatnagar25 A generic step is added similar type of locator for BQ framework PR, I believe we can use it.

* @throws ClassNotFoundException If the class specified is not found.
*/

public static boolean validateMySqlToBQRecordValues(String sourceTable) throws IOException, InterruptedException,
Copy link
Collaborator

Choose a reason for hiding this comment

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

So we are using Multiple Database table plugin here but we are using a SQL Database/Table. It would be good if we can add few comments and context here describing this in this class.

* @throws InterruptedException If the current thread is interrupted while waiting.
*/

public static List<String> getTableByName() throws IOException, InterruptedException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

change the method name to getTableNameFromMySQL()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

change done.

public static List<String> getTableByName() throws IOException, InterruptedException {
List<String> tableNames = new ArrayList<>();
List<String> targetTableNames = Arrays.asList(tabA, tabB);
TableResult tableResult = getTableNamesFromDataSet();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Name it as getTableNamesFromBQDataSet()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Change done

case Types.VARCHAR:
String sourceString = rsSource.getString(currentColumnCount);
// String sour = bigQueryData.get(jsonObjectIdx).get(columnTypeName).getAsString();
// String sou2 = bigQueryData.get(jsonObjectIdx).get(columnType)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove commented line no. 155 & 156.

SeleniumHelper.getPropertiesLocators(BigQueryMultiTableLocators.class);
}

public static void enterSqlStatement(String value) {

Choose a reason for hiding this comment

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

Move the locator and the corresponding action to the framework repo, if it's not already there.

public static void createSourceDatatypesTable(String sourceTable) throws SQLException, ClassNotFoundException {
try (Connection connect = getMysqlConnection(); Statement statement = connect.createStatement()) {
String createTableQuery = "CREATE TABLE " + sourceTable +
"(EmployeeID int, LastName varchar(255), City varchar(255), tablename varchar(255))";

Choose a reason for hiding this comment

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

Can we make this parameterized?

@priyabhatnagar25 priyabhatnagar25 force-pushed the e2e_bigquerymultitable branch 7 times, most recently from 79d82d2 to cd2286e Compare August 24, 2023 11:46
@bharatgulati bharatgulati force-pushed the e2e_bigquerymultitable branch 3 times, most recently from 89e0b0b to f0c2b16 Compare September 1, 2023 05:23
@priyabhatnagar25 priyabhatnagar25 force-pushed the e2e_bigquerymultitable branch 2 times, most recently from bc7b626 to d2c87d4 Compare September 1, 2023 06:44
@priyabhatnagar25 priyabhatnagar25 force-pushed the e2e_bigquerymultitable branch 3 times, most recently from 4c9db2e to 74e2152 Compare November 22, 2023 15:38
@priyabhatnagar25 priyabhatnagar25 force-pushed the e2e_bigquerymultitable branch 8 times, most recently from 170af4a to 568fff4 Compare December 5, 2023 10:43
@rahuldash171 rahuldash171 force-pushed the e2e_bigquerymultitable branch 6 times, most recently from d808e6f to 0d56779 Compare December 21, 2023 08:59
updated correct conn string,
removed space in yml,
removed verify goal in pom.
changed sql connector java version to run in github actions and
bqmt secret updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants