Skip to content

Commit 6105812

Browse files
committed
New design and runtime scenarios for Namespace admin module.
1 parent 3efa4c4 commit 6105812

10 files changed

Lines changed: 541 additions & 0 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Copyright © 2023 Cask Data, Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
3+
# use this file except in compliance with the License. You may obtain a copy of
4+
# the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
9+
# License for the specific language governing permissions and limitations under
10+
# the License.
11+
12+
# This workflow will build a Java project with Maven
13+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
14+
# Note: Any changes to this workflow would be used only after merging into develop
15+
name: Build e2e tests
16+
17+
on:
18+
push:
19+
branches: [ develop ]
20+
pull_request:
21+
branches: [ develop ]
22+
types: [ opened, synchronize, reopened, labeled ]
23+
workflow_dispatch:
24+
25+
jobs:
26+
build:
27+
runs-on: k8s-runner-e2e
28+
# We allow builds:
29+
# 1) When triggered manually
30+
# 2) When it's a merge into a branch
31+
# 3) For PRs that are labeled as build and
32+
# - It's a code change
33+
# - A build label was just added
34+
# A bit complex, but prevents builds when other labels are manipulated
35+
if: >
36+
github.event_name == 'workflow_dispatch'
37+
|| github.event_name == 'push'
38+
|| (contains(github.event.pull_request.labels.*.name, 'build')
39+
&& (github.event.action != 'labeled' || github.event.label.name == 'build')
40+
)
41+
strategy:
42+
matrix:
43+
module: [cdap-e2e-tests]
44+
fail-fast: false
45+
46+
steps:
47+
# Pinned 1.0.0 version
48+
- uses: actions/checkout@v3
49+
with:
50+
path: plugin
51+
submodules: 'recursive'
52+
ref: ${{ github.event.workflow_run.head_sha }}
53+
54+
- uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
55+
if: github.event_name != 'workflow_dispatch' && github.event_name != 'push'
56+
id: filter
57+
with:
58+
working-directory: plugin
59+
filters: |
60+
e2e-test:
61+
- '${{ matrix.module }}/**/e2e-test/**'
62+
63+
- name: Checkout e2e test repo
64+
uses: actions/checkout@v3
65+
with:
66+
repository: cdapio/cdap-e2e-tests
67+
path: e2e
68+
69+
- name: Cache
70+
uses: actions/cache@v3
71+
with:
72+
path: ~/.m2/repository
73+
key: ${{ runner.os }}-maven-${{ github.workflow }}-${{ hashFiles('**/pom.xml') }}
74+
restore-keys: |
75+
${{ runner.os }}-maven-${{ github.workflow }}
76+
77+
- name: Run required e2e tests
78+
if: github.event_name != 'workflow_dispatch' && github.event_name != 'push' && steps.filter.outputs.e2e-test == 'false'
79+
run: python3 e2e/src/main/scripts/run_e2e_test.py --module ${{ matrix.module }} --testRunner TestRunnerRequired.java
80+
81+
- name: Run all e2e tests
82+
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || steps.filter.outputs.e2e-test == 'true'
83+
run: python3 e2e/src/main/scripts/run_e2e_test.py --module ${{ matrix.module }}
84+
85+
- name: Upload report
86+
uses: actions/upload-artifact@v3
87+
if: always()
88+
with:
89+
name: Cucumber report - ${{ matrix.module }}
90+
path: ./**/target/cucumber-reports
91+
92+
- name: Upload debug files
93+
uses: actions/upload-artifact@v3
94+
if: always()
95+
with:
96+
name: Debug files - ${{ matrix.module }}
97+
path: ./**/target/e2e-debug
98+
99+
- name: Upload files to GCS
100+
uses: google-github-actions/upload-cloud-storage@v0
101+
if: always()
102+
with:
103+
path: ./plugin
104+
destination: e2e-tests-cucumber-reports/${{ github.event.repository.name }}/${{ github.ref }}
105+
glob: '**/target/cucumber-reports/**'
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
#
2+
# Copyright © 2023 Cask Data, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
# use this file except in compliance with the License. You may obtain a copy of
6+
# the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
# License for the specific language governing permissions and limitations under
14+
# the License.
15+
#
16+
@Namespaceadmin
17+
Feature: NameSpaceAdmin - Validate nameSpace admin design time scenarios
18+
19+
@Namespaceadmin
20+
Scenario:Verify user is able to click on the namespace admin tab and successfully navigates to the page
21+
Given Open Datafusion Project to configure pipeline
22+
When Click on the Hamburger bar on the left panel
23+
Then Click on NameSpace Admin link from the menu
24+
Then Verify if user successfully navigated to namespace admin page
25+
26+
@Namespaceadmin
27+
Scenario:Validate user is able to open compute profile page and create a profile for selected a provisioner
28+
Given Open Datafusion Project to configure pipeline
29+
Then Click on the Hamburger bar on the left panel
30+
Then Click on NameSpace Admin link from the menu
31+
Then Click on create profile button for "default" Namespace
32+
Then Select a provisioner: "remoteHadoopProvisioner" for the compute profile
33+
Then Verify the Create a Profile page is loaded for selected provisioner
34+
Then Enter input plugin property: "profileLabel" with value: "validProfile"
35+
Then Enter textarea plugin property: "profileDescription" with value: "validDescription"
36+
Then Enter input plugin property: "host" with value: "testHost"
37+
Then Enter input plugin property: "user" with value: "testUser"
38+
Then Enter textarea plugin property: "sshKey" with value: "testSSHKey"
39+
Then Click on: "Create" button in the properties
40+
Then Verify the created compute profile: "validProfile" is displayed in system compute profile list
41+
42+
43+
@Namespaceadmin
44+
Scenario: Validate user is able to create new namespace preferences and able to delete the added namespace preferences successfully
45+
Given Open Datafusion Project to configure pipeline
46+
Then Click on the Hamburger bar on the left panel
47+
Then Click on NameSpace Admin link from the menu
48+
Then Click "preferences" tab from Configuration page for "default" Namespace
49+
Then Click on edit namespace preferences to set namespace preferences
50+
Then Set namespace preferences with key: "keyValue" and value: "nameSpacePreferences1"
51+
Then Click on the Save & Close preferences button
52+
Then Click on edit namespace preferences to set namespace preferences
53+
Then Delete the preferences
54+
Then Click on the Save & Close preferences button
55+
56+
Scenario: Validate user is able to add multiple namespace preferences inside namespace admin successfully
57+
Given Open Datafusion Project to configure pipeline
58+
Then Click on the Hamburger bar on the left panel
59+
Then Click on NameSpace Admin link from the menu
60+
Then Click "preferences" tab from Configuration page for "default" Namespace
61+
Then Click on edit namespace preferences to set namespace preferences
62+
Then Set namespace preferences with key: "keyValue" and value: "nameSpacePreferences2"
63+
Then Click on the Save & Close preferences button
64+
Then Click on edit namespace preferences to set namespace preferences
65+
Then Delete the preferences
66+
Then Delete the preferences
67+
Then Click on the Save & Close preferences button
68+
69+
Scenario: Validate user is able reset the namespace preferences added inside namespace admin successfully
70+
Given Open Datafusion Project to configure pipeline
71+
Then Click on the Hamburger bar on the left panel
72+
Then Click on NameSpace Admin link from the menu
73+
Then Click "preferences" tab from Configuration page for "default" Namespace
74+
Then Click on edit namespace preferences to set namespace preferences
75+
Then Set namespace preferences with key: "keyValue" and value: "nameSpacePreferences1"
76+
Then Reset the preferences
77+
Then Verify the reset is successful for added preferences
78+
79+
Scenario: To verify the validation error message with invalid cluster name
80+
Given Open Datafusion Project to configure pipeline
81+
Then Click on the Hamburger bar on the left panel
82+
Then Click on NameSpace Admin link from the menu
83+
Then Click on create profile button for "default" Namespace
84+
Then Select a provisioner: "existingDataProc" for the compute profile
85+
Then Enter input plugin property: "profileLabel" with value: "validProfile"
86+
Then Enter textarea plugin property: "profileDescription" with value: "validDescription"
87+
Then Enter input plugin property: "clusterName" with value: "invalidClusterName"
88+
Then Click on: "Create" button in the properties
89+
Then Verify that the compute profile is displaying an error message: "errorInvalidClusterName" on the footer
90+
91+
Scenario:To verify the validation error message with invalid profile name
92+
Given Open Datafusion Project to configure pipeline
93+
Then Click on the Hamburger bar on the left panel
94+
Then Click on NameSpace Admin link from the menu
95+
Then Click on create profile button for "default" Namespace
96+
Then Select a provisioner: "existingDataProc" for the compute profile
97+
Then Enter input plugin property: "profileLabel" with value: "invalidProfile"
98+
Then Enter textarea plugin property: "profileDescription" with value: "validDescription"
99+
Then Enter input plugin property: "clusterName" with value: "validClusterName"
100+
Then Click on: "Create" button in the properties
101+
Then Verify that the compute profile is displaying an error message: "errorInvalidProfileName" on the footer
102+
103+
Scenario:To verify the validation error message with invalid namespace name
104+
Given Open Datafusion Project to configure pipeline
105+
Then Click on the Hamburger bar on the left panel
106+
Then Click on Namespace dropdown button
107+
Then Click on the Add Namespace tab
108+
Then Enter the New Namespace Name with value: "invalidNamespaceName"
109+
Then Enter the Namespace Description with value: "validNamespaceDescription"
110+
Then Click on: "Finish" button in the properties
111+
Then Verify the failed error message: "errorInvalidNamespace" displayed on dialog box
112+
113+
Scenario: Validate user is able to create new namespace from hamburger menu and switch to newly created namespace
114+
Given Open Datafusion Project to configure pipeline
115+
Then Click on the Hamburger bar on the left panel
116+
Then Click on Namespace dropdown button
117+
Then Click on the Add Namespace tab
118+
Then Enter the New Namespace Name with value: "validNamespaceName"
119+
Then Enter the Namespace Description with value: "validNamespaceDescription"
120+
Then Click on: "Finish" button in the properties
121+
Then Switch to the newly created Namespace
122+
Then Click on the Hamburger bar on the left panel
123+
Then Verify the namespace is switched to "validNamespaceName" successfully
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#
2+
# Copyright © 2023 Cask Data, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
# use this file except in compliance with the License. You may obtain a copy of
6+
# the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
# License for the specific language governing permissions and limitations under
14+
# the License.
15+
#
16+
@Namespaceadmin
17+
Feature: NameSpaceAdmin - Validate nameSpace admin run time scenarios
18+
19+
@BQ_SOURCE_TEST @BQ_SINK_TEST
20+
Scenario:To verify if user is able to run a pipeline successfully using the namespace preferences
21+
Given Open Datafusion Project to configure pipeline
22+
Then Click on the Hamburger bar on the left panel
23+
Then Click on NameSpace Admin link from the menu
24+
Then Click "preferences" tab from Configuration page for "default" Namespace
25+
Then Click on edit namespace preferences to set namespace preferences
26+
Then Set namespace preferences with key: "keyValue" and value: "nameSpacePreferences2"
27+
Then Click on the Save & Close preferences button
28+
Then Click on the Hamburger bar on the left panel
29+
Then Select navigation item: "studio" from the Hamburger menu list
30+
When Expand Plugin group in the LHS plugins list: "Source"
31+
When Select plugin: "BigQuery" from the plugins list as: "Source"
32+
When Expand Plugin group in the LHS plugins list: "Sink"
33+
When Select plugin: "BigQuery" from the plugins list as: "Sink"
34+
Then Connect plugins: "BigQuery" and "BigQuery2" to establish connection
35+
Then Navigate to the properties page of plugin: "BigQuery"
36+
Then Enter input plugin property: "referenceName" with value: "BQReferenceName"
37+
Then Click on the Macro button of Property: "projectId" and set the value to: "projectId"
38+
Then Click on the Macro button of Property: "datasetProjectId" and set the value to: "datasetprojectId"
39+
Then Enter input plugin property: "dataset" with value: "dataset"
40+
Then Enter input plugin property: "table" with value: "bqSourceTable"
41+
Then Validate "BigQuery" plugin properties
42+
Then Close the Plugin Properties page
43+
Then Navigate to the properties page of plugin: "BigQuery2"
44+
Then Enter input plugin property: "referenceName" with value: "BQReferenceName"
45+
Then Click on the Macro button of Property: "projectId" and set the value to: "projectId"
46+
Then Click on the Macro button of Property: "datasetProjectId" and set the value to: "datasetprojectId"
47+
Then Enter input plugin property: "dataset" with value: "dataset"
48+
Then Enter input plugin property: "table" with value: "bqSourceTable"
49+
Then Validate "BigQuery" plugin properties
50+
Then Close the Plugin Properties page
51+
Then Save the pipeline
52+
Then Deploy the pipeline
53+
Then Run the Pipeline in Runtime
54+
Then Wait till pipeline is in running state
55+
Then Open and capture logs
56+
Then Verify the pipeline status is "Succeeded"
57+
58+
@BQ_SOURCE_TEST @BQ_SINK_TEST
59+
Scenario: To verify if user is able to create a connection from namespace admin and configure it for required plugins
60+
Given Open Datafusion Project to configure pipeline
61+
Then Click on the Hamburger bar on the left panel
62+
Then Click on NameSpace Admin link from the menu
63+
Then Click "connections" tab from Configuration page for "default" Namespace
64+
Then Click on the Add Connection button
65+
Then Add connection type as "bqConnection" and provide a "ConnectionName"
66+
Then Click on the Test Connection button
67+
Then Click on the Create button
68+
Then Click on the Hamburger bar on the left panel
69+
Then Select navigation item: "studio" from the Hamburger menu list
70+
When Select plugin: "BigQuery" from the plugins list as: "Source"
71+
When Expand Plugin group in the LHS plugins list: "Sink"
72+
When Select plugin: "BigQuery" from the plugins list as: "Sink"
73+
Then Connect plugins: "BigQuery" and "BigQuery2" to establish connection
74+
Then Navigate to the properties page of plugin: "BigQuery"
75+
Then Click plugin property: "switch-useConnection"
76+
Then Click on the Browse Connections button
77+
Then Select connection: "ConnectionName"
78+
Then Enter input plugin property: "referenceName" with value: "BQReferenceName"
79+
Then Click on the Browse button inside plugin properties
80+
Then Click SELECT button inside connection data row with name: "dataset"
81+
Then Wait till connection data loading completes with a timeout of 60 seconds
82+
Then Enter input plugin property: "table" with value: "bqSourceTable"
83+
Then Validate "BigQuery" plugin properties
84+
Then Close the Plugin Properties page
85+
Then Navigate to the properties page of plugin: "BigQuery2"
86+
Then Click plugin property: "useConnection"
87+
Then Click on the Browse Connections button
88+
Then Select connection: "ConnectionName"
89+
Then Enter input plugin property: "referenceName" with value: "BQSinkReferenceName"
90+
Then Click on the Browse button inside plugin properties
91+
Then Click SELECT button inside connection data row with name: "dataset"
92+
Then Wait till connection data loading completes with a timeout of 60 seconds
93+
Then Verify input plugin property: "dataset" contains value: "dataset"
94+
Then Enter input plugin property: "table" with value: "bqTargetTable"
95+
Then Click plugin property: "truncateTable"
96+
Then Validate "BigQuery" plugin properties
97+
Then Close the Plugin Properties page
98+
Then Save the pipeline
99+
Then Deploy the pipeline
100+
Then Run the Pipeline in Runtime
101+
Then Wait till pipeline is in running state
102+
Then Open and capture logs
103+
Then Verify the pipeline status is "Succeeded"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright © 2023 Cask Data, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
17+
package io.cdap.cdap.namespaceadmin;
18+
19+
import io.cucumber.junit.Cucumber;
20+
import io.cucumber.junit.CucumberOptions;
21+
import org.junit.runner.RunWith;
22+
23+
/**
24+
* Test Runner to execute namespace admin related test cases.
25+
*/
26+
@RunWith(Cucumber.class)
27+
@CucumberOptions(
28+
features = {"src/e2e-test/features"},
29+
glue = {"io.cdap.cdap.stepsdesign", "stepsdesign"},
30+
tags = {"@NameSpaceadmin"},
31+
plugin = {"pretty", "html:target/cucumber-html-report/namespaceadmin",
32+
"json:target/cucumber-reports/cucumber-namespaceadmin.json",
33+
"junit:target/cucumber-reports/cucumber-namespaceadmin.xml"}
34+
)
35+
public class TestRunner {
36+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright © 2023 Cask Data, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
17+
/**
18+
* Package contains the runners for nameSpace admin features.
19+
*/
20+
package io.cdap.cdap.namespaceadmin;

0 commit comments

Comments
 (0)