forked from cdapio/cdap
-
Notifications
You must be signed in to change notification settings - Fork 3
control center cdap #8
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
Open
priyabhatnagar25
wants to merge
1
commit into
develop
Choose a base branch
from
controlcenter_e2e
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
101 changes: 101 additions & 0 deletions
101
cdap-e2e-tests/src/e2e-test/features/controlcenter/ControlCenter.feature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| # Copyright © 2023 Cask Data, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
| # use this file except in compliance with the License. You may obtain a copy of | ||
| # the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| # License for the specific language governing permissions and limitations under | ||
| # the License. | ||
|
|
||
| @Controlcenter | ||
|
|
||
| Feature: Controlcenter - Validate control center page flow | ||
|
|
||
| Scenario: Verify user is able to click the control center tab and successfully navigates to control center page | ||
| Given Open Datafusion Project to configure pipeline | ||
| Then Click on the Hamburger bar on the left panel | ||
| Then Click on Control Center link from the hamburger menu | ||
| Then Verify that the user is navigated to control center page successfully | ||
|
|
||
| @BQ_INSERT_INT_SOURCE_TEST @BQ_SINK_TEST | ||
| Scenario: Verify that user is able to create a pipeline and then validate the presence of created pipeline in control center. | ||
| Given Open Datafusion Project to configure pipeline | ||
| Then Click on the Hamburger bar on the left panel | ||
| Then Click on Control Center link from the hamburger menu | ||
| Then Click on the Plus Green Button to import the pipelines | ||
| Then Verify user is able to click on the create button to create a pipeline successfully | ||
| When Expand Plugin group in the LHS plugins list: "Source" | ||
| When Select plugin: "BigQuery" from the plugins list as: "Source" | ||
| When Expand Plugin group in the LHS plugins list: "Sink" | ||
| When Select plugin: "BigQuery" from the plugins list as: "Sink" | ||
| Then Connect plugins: "BigQuery" and "BigQuery2" to establish connection | ||
| Then Navigate to the properties page of plugin: "BigQuery" | ||
| And Enter input plugin property: "referenceName" with value: "Reference" | ||
| And Replace input plugin property: "project" with value: "projectId" | ||
| And Enter input plugin property: "datasetProject" with value: "projectId" | ||
| And Replace input plugin property: "dataset" with value: "dataset" | ||
| Then Override Service account details if set in environment variables | ||
| And Enter input plugin property: "table" with value: "bqSourceTable" | ||
| Then Click on the Get Schema button | ||
| Then Validate "BigQuery" plugin properties | ||
| And Close the Plugin Properties page | ||
| Then Navigate to the properties page of plugin: "BigQuery2" | ||
| Then Replace input plugin property: "project" with value: "projectId" | ||
| Then Override Service account details if set in environment variables | ||
| Then Enter input plugin property: "datasetProject" with value: "projectId" | ||
| Then Enter input plugin property: "referenceName" with value: "BQReferenceName" | ||
| Then Enter input plugin property: "dataset" with value: "dataset" | ||
| Then Enter input plugin property: "table" with value: "bqTargetTable" | ||
| Then Validate "BigQuery" plugin properties | ||
| And Close the Plugin Properties page | ||
| Then Save the pipeline | ||
| Then Deploy the pipeline | ||
| Then Run the Pipeline in Runtime | ||
| Then Wait till pipeline is in running state | ||
| Then Verify the pipeline status is "Succeeded" | ||
| Then Click on the Hamburger bar on the left panel | ||
| Then Click on Control Center link from the hamburger menu | ||
| Then Verify the pipeline created successfully is present in control center page | ||
|
|
||
| @BQ_INSERT_INT_SOURCE_TEST @BQ_SINK_TEST | ||
| Scenario: Verify that user is able to delete the created pipeline in control center successfully. | ||
| Given Open Datafusion Project to configure pipeline | ||
| Then Click on the Hamburger bar on the left panel | ||
| Then Click on Control Center link from the hamburger menu | ||
| Then Click on the Plus Green Button to import the pipelines | ||
rahuldash171 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Then Verify user is able to click on the create button to create a pipeline successfully | ||
| When Expand Plugin group in the LHS plugins list: "Source" | ||
| When Select plugin: "BigQuery" from the plugins list as: "Source" | ||
| When Expand Plugin group in the LHS plugins list: "Sink" | ||
| When Select plugin: "BigQuery" from the plugins list as: "Sink" | ||
| Then Connect plugins: "BigQuery" and "BigQuery2" to establish connection | ||
| Then Navigate to the properties page of plugin: "BigQuery" | ||
| And Enter input plugin property: "referenceName" with value: "Reference" | ||
| And Replace input plugin property: "project" with value: "projectId" | ||
| And Enter input plugin property: "datasetProject" with value: "projectId" | ||
| And Replace input plugin property: "dataset" with value: "dataset" | ||
| Then Override Service account details if set in environment variables | ||
| And Enter input plugin property: "table" with value: "bqSourceTable" | ||
| Then Click on the Get Schema button | ||
| Then Validate "BigQuery" plugin properties | ||
| And Close the Plugin Properties page | ||
| Then Navigate to the properties page of plugin: "BigQuery2" | ||
| Then Replace input plugin property: "project" with value: "projectId" | ||
| Then Override Service account details if set in environment variables | ||
| Then Enter input plugin property: "datasetProject" with value: "projectId" | ||
| Then Enter input plugin property: "referenceName" with value: "BQReferenceName" | ||
| Then Enter input plugin property: "dataset" with value: "dataset" | ||
| Then Enter input plugin property: "table" with value: "bqTargetTable" | ||
| Then Validate "BigQuery" plugin properties | ||
| And Close the Plugin Properties page | ||
| Then Save the pipeline | ||
| Then Deploy the pipeline | ||
| Then Click on the Hamburger bar on the left panel | ||
| Then Click on Control Center link from the hamburger menu | ||
| Then Click on the delete icon of the created pipeline and pipeline should get deleted successfully | ||
| Then Verify the deleted pipeline is not present in the control center page | ||
37 changes: 37 additions & 0 deletions
37
cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/controlcenter/runners/TestRunner.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /* | ||
| * Copyright © 2023 Cask Data, Inc. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
| * use this file except in compliance with the License. You may obtain a copy of | ||
| * the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| * License for the specific language governing permissions and limitations under | ||
| * the License. | ||
| */ | ||
|
|
||
| package io.cdap.cdap.controlcenter.runners; | ||
|
|
||
| import io.cucumber.junit.Cucumber; | ||
| import io.cucumber.junit.CucumberOptions; | ||
| import org.junit.runner.RunWith; | ||
|
|
||
| /** | ||
| * Test Runner to execute controlcenter related test cases. | ||
| */ | ||
| @RunWith(Cucumber.class) | ||
| @CucumberOptions( | ||
| features = {"src/e2e-test/features"}, | ||
| glue = {"io.cdap.cdap.controlcenter.stepsdesign", "stepsdesign"}, | ||
| tags = {"@Controlcenter"}, | ||
| plugin = {"pretty", "html:target/cucumber-html-report/controlcenter", | ||
| "json:target/cucumber-reports/cucumber-controlcenter.json", | ||
| "junit:target/cucumber-reports/cucumber-controlcenter.xml"} | ||
| ) | ||
| public class TestRunner { | ||
|
|
||
| } |
20 changes: 20 additions & 0 deletions
20
cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/controlcenter/runners/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /* | ||
| * Copyright © 2023 Cask Data, Inc. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
| * use this file except in compliance with the License. You may obtain a copy of | ||
| * the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| * License for the specific language governing permissions and limitations under | ||
| * the License. | ||
| */ | ||
|
|
||
| /** | ||
| * Package contains the runners for controlcenter features. | ||
| */ | ||
| package io.cdap.cdap.controlcenter.runners; |
87 changes: 87 additions & 0 deletions
87
cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/controlcenter/stepsdesign/TestSetupHooks.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| /* | ||
| * Copyright © 2023 Cask Data, Inc. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
| * use this file except in compliance with the License. You may obtain a copy of | ||
| * the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| * License for the specific language governing permissions and limitations under | ||
| * the License. | ||
| */ | ||
|
|
||
| package io.cdap.cdap.controlcenter.stepsdesign; | ||
|
|
||
| import com.google.cloud.bigquery.BigQueryException; | ||
| import io.cdap.e2e.utils.BigQueryClient; | ||
| import io.cdap.e2e.utils.PluginPropertyUtils; | ||
| import io.cucumber.java.After; | ||
| import io.cucumber.java.Before; | ||
| import org.apache.commons.lang3.StringUtils; | ||
| import org.junit.Assert; | ||
| import stepsdesign.BeforeActions; | ||
|
|
||
| import java.io.IOException; | ||
| import java.util.NoSuchElementException; | ||
| import java.util.UUID; | ||
|
|
||
| public class TestSetupHooks { | ||
| public static String bqTargetTable = StringUtils.EMPTY; | ||
| public static String bqSourceTable = StringUtils.EMPTY; | ||
| public static String datasetName = PluginPropertyUtils.pluginProp("dataset"); | ||
|
|
||
| @Before(order = 1, value = "@BQ_INSERT_INT_SOURCE_TEST") | ||
| public static void createSourceBQTable() throws IOException, InterruptedException { | ||
| bqSourceTable = "E2E_SOURCE_" + UUID.randomUUID().toString().replaceAll("-", "_"); | ||
| PluginPropertyUtils.addPluginProp("bqSourceTable", bqSourceTable); | ||
| BeforeActions.scenario.write("BQ source table name - " + bqSourceTable); | ||
| BigQueryClient.getSoleQueryResult("create table `" + datasetName + "." + bqSourceTable + "` " + | ||
| "(ID INT64, Name STRING, Price FLOAT64, Customer_Exists BOOL)"); | ||
| try { | ||
| BigQueryClient.getSoleQueryResult("INSERT INTO `" + datasetName + "." + bqSourceTable + "` " + | ||
| "(ID, Name, Price,Customer_Exists)" + | ||
| "VALUES" + "(3, 'Rajan Kumar', 100.0, true)"); | ||
| } catch (NoSuchElementException e) { | ||
| // Insert query does not return any record. | ||
| // Iterator on TableResult values in getSoleQueryResult method throws NoSuchElementException | ||
| BeforeActions.scenario.write("Error inserting the record in the table" + e.getStackTrace()); | ||
| } | ||
| PluginPropertyUtils.addPluginProp(" bqSourceTable", bqSourceTable); | ||
| BeforeActions.scenario.write("BQ Source Table " + bqSourceTable + " updated successfully"); | ||
| } | ||
|
|
||
| @After(order = 1, value = "@BQ_INSERT_INT_SOURCE_TEST") | ||
| public static void deleteTempSourceBQTable() throws IOException, InterruptedException { | ||
| BigQueryClient.dropBqQuery(bqSourceTable); | ||
| PluginPropertyUtils.removePluginProp("bqSourceTable"); | ||
| BeforeActions.scenario.write("BQ source Table " + bqSourceTable + " deleted successfully"); | ||
| bqSourceTable = StringUtils.EMPTY; | ||
| } | ||
|
|
||
| @Before(order = 1, value = "@BQ_SINK_TEST") | ||
| public static void setTempTargetBQTableName() { | ||
| bqTargetTable = "E2E_TARGET_" + UUID.randomUUID().toString().replaceAll("-", "_"); | ||
| PluginPropertyUtils.addPluginProp("bqTargetTable", bqTargetTable); | ||
| BeforeActions.scenario.write("BQ Target table name - " + bqTargetTable); | ||
| } | ||
|
|
||
| @After(order = 1, value = "@BQ_SINK_TEST") | ||
| public static void deleteTempTargetBQTable() throws IOException, InterruptedException { | ||
| try { | ||
| BigQueryClient.dropBqQuery(bqTargetTable); | ||
| PluginPropertyUtils.removePluginProp("bqTargetTable"); | ||
| BeforeActions.scenario.write("BQ Target table - " + bqTargetTable + " deleted successfully"); | ||
| bqTargetTable = StringUtils.EMPTY; | ||
| } catch (BigQueryException e) { | ||
| if (e.getMessage().contains("Not found: Table")) { | ||
| BeforeActions.scenario.write("BQ Target Table " + bqTargetTable + " does not exist"); | ||
| } else { | ||
| Assert.fail(e.getMessage()); | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| validationSuccessMessage=No errors found. |
4 changes: 4 additions & 0 deletions
4
cdap-e2e-tests/src/e2e-test/resources/pluginDataCyAttributes.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| projectId=project | ||
| datasetProjectId=datasetProject | ||
| referenceName=referenceName | ||
| table=table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,4 +2,11 @@ clientName=cdap | |
| clientUrl=http://localhost:11011 | ||
| serverUrl=https://placeholder.com/api | ||
| # command to generate token: gcloud auth print-access-token | ||
|
|
||
| ## CONTROLCENTER-START | ||
| serverAccessToken=placeholder | ||
| bqSourceTable=dummy | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add start and end comments for control center feature
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added the comments |
||
| dataset=bq_automation | ||
| projectId=cdf-athena | ||
| datasetprojectId=cdf-athena | ||
| ## CONTROLCENTER-END | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.