Skip to content

Commit

Permalink
Run cdap-e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
Vipinofficial11 committed Dec 7, 2023
1 parent 9bd05f5 commit 2d84b39
Show file tree
Hide file tree
Showing 19 changed files with 676 additions and 5 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Copyright © 2021 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.

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
# Note: Any changes to this workflow would be used only after merging into develop
name: Build e2e tests

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop]
types: [opened, synchronize, reopened, labeled]
workflow_dispatch:

jobs:
build:
runs-on: self-hosted
# We allow builds:
# 1) When triggered manually
# 2) When it's a merge into a branch
# 3) For PRs that are labeled as build and
# - It's a code change
# - A build label was just added
# A bit complex but prevents builds when other labels are manipulated
if: >
github.event_name == 'workflow_dispatch'
|| github.event_name == 'push'
|| (contains(github.event.pull_request.labels.*.name, 'build')
&& (github.event.action != 'labeled' || github.event.label.name == 'build')
)
strategy:
matrix:
tests: [ cdap-e2e-tests ]
fail-fast: false
steps:
# Pinned 1.0.0 version
- uses: actions/checkout@v3
with:
path: plugin

- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50
# Pinned version 2.11.1
if: github.event_name != 'workflow_dispatch' && github.event_name != 'push'
id: filter
with:
working-directory: plugin
filters: |
e2e-test:
- '**/e2e-test/**'
- name: Checkout e2e test repo
uses: actions/checkout@v3
with:
repository: Vipinofficial11/cdap-e2e-tests
path: e2e
ref: addPluginUploadSkipFlag

- name: Cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ github.workflow }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ github.workflow }}
- name: Run required e2e tests
if: github.event_name != 'workflow_dispatch' && github.event_name != 'push' && steps.filter.outputs.e2e-test == 'false'
run: python3 e2e/src/main/scripts/run_cdap_e2e_test.py --testRunner TestRunnerRequired.java

- name: Run all e2e tests
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || steps.filter.outputs.e2e-test == 'true'
run: python3 e2e/src/main/scripts/run_cdap_e2e_test.py --testRunner TestRunnerRequired.java

- name: Upload report
uses: actions/upload-artifact@v3
if: always()
with:
name: Cucumber report - ${{ matrix.tests }}
path: ./plugin/${{ matrix.tests }}/target/cucumber-reports

- name: Upload debug files
uses: actions/upload-artifact@v3
if: always()
with:
name: Debug files - ${{ matrix.tests }}
path: ./**/target/e2e-debug

- name: Upload files to GCS
uses: google-github-actions/upload-cloud-storage@v0
if: always()
with:
path: ./plugin/cdap-e2e-tests/target/cucumber-reports
destination: e2e-tests-cucumber-reports/${{ github.event.repository.name }}/${{ github.ref }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ derby.log

# generated by docs build
*.pyc

#/cdap-ui
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ public void testPEMToKeyStore() throws Exception {
// Generate a keystore and write out PEM blocks
KeyStore keystore = KeyStores.generatedCertKeyStore(KeyStores.VALIDITY, password);
Key key = keystore.getKey(KeyStores.CERT_ALIAS, password.toCharArray());

File pemFile = writePEMFile(TEMP_FOLDER.newFile(), keystore, KeyStores.CERT_ALIAS, password);

// Create a keystore from the PEM file
Expand Down
2 changes: 1 addition & 1 deletion cdap-e2e-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
<!-- <goal>verify</goal>-->
</goals>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#
# 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.
#

@Sysadmin
Feature: Sysadmin - Validate system admin page design time scenarios

@Sysadmin1
Scenario:Validate user is able to create new system preferences and able to delete the added system preferences successfully
Given Open Datafusion Project to configure pipeline
When Open "System Admin" menu
Then Click on the Configuration link on the System admin page
Then Select "systemPreferences" option from Configuration page
Then Click on edit system preferences
Then Set system preferences with key: "keyValue" and value: "systemPreferences1"
Then Click on the Save & Close preferences button
Then Select "systemPreferences" option from Configuration page
Then Click on edit system preferences
Then Delete the preferences
Then Click on the Save & Close preferences button
Then Verify the system admin page is navigated successfully

Scenario:Validate user is able to add multiple system preferences inside system admin successfully
Given Open Datafusion Project to configure pipeline
When Open "System Admin" menu
Then Click on the Configuration link on the System admin page
Then Select "systemPreferences" option from Configuration page
Then Click on edit system preferences
Then Set system preferences with key: "keyValue" and value: "systemPreferences2"
Then Click on the Save & Close preferences button
Then Click on edit system preferences
Then Delete the preferences
Then Delete the preferences
Then Click on the Save & Close preferences button
Then Verify the system admin page is navigated successfully

Scenario:Validate user is able to successfully reload system artifacts using reload
Given Open Datafusion Project to configure pipeline
When Open "System Admin" menu
Then Click on the Configuration link on the System admin page
Then Click on Reload System Artifacts from the System admin page
Then Click on Reload button on popup to reload the System Artifacts successfully
Then Verify the system admin page is navigated successfully

Scenario:Validate user is able to open compute profile page and create a compute profile for selected provisioner
Given Open Datafusion Project to configure pipeline
When Open "System Admin" menu
Then Click on the Configuration link on the System admin page
Then Click on the Compute Profile from the System admin page
Then Click on create compute profile button
Then Select a provisioner: "remoteHadoopProvisioner" for the compute profile
Then Verify the Create a Profile page is loaded for selected provisioner
Then Enter input plugin property: "profileLabel" with value: "validProfile"
Then Enter textarea plugin property: "profileDescription" with value: "validDescription"
Then Enter input plugin property: "host" with value: "testHost"
Then Enter input plugin property: "user" with value: "testUser"
Then Enter textarea plugin property: "sshKey" with value: "testSSHKey"
Then Click on: "Create" button in the properties
Then Verify the created compute profile: "validProfile" is displayed in system compute profile list
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#
# 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.
#

@Sysadmin
Feature: Sysadmin - Validate system admin page design time validation scenarios

@SysAdminRequired
Scenario:Validate user is able reset the system preferences added inside system admin successfully
Given Open Datafusion Project to configure pipeline
When Open "System Admin" menu
Then Click on the Configuration link on the System admin page
Then Select "systemPreferences" option from Configuration page
Then Click on edit system preferences
Then Set system preferences with key: "keyValue" and value: "systemPreferences1"
Then Reset the preferences
Then Verify the reset is successful for added preferences

Scenario:To verify the validation error message with invalid cluster name
Given Open Datafusion Project to configure pipeline
When Open "System Admin" menu
Then Click on the Configuration link on the System admin page
Then Click on the Compute Profile from the System admin page
Then Click on create compute profile button
Then Select a provisioner: "existingDataProc" for the compute profile
Then Enter input plugin property: "profileLabel" with value: "validProfile"
Then Enter textarea plugin property: "profileDescription" with value: "validDescription"
Then Enter input plugin property: "clusterName" with value: "invalidClusterName"
Then Click on: "Create" button in the properties
Then Verify that the compute profile is displaying an error message: "errorInvalidClusterName" on the footer

Scenario:To verify the validation error message with invalid profile name
Given Open Datafusion Project to configure pipeline
When Open "System Admin" menu
Then Click on the Configuration link on the System admin page
Then Click on the Compute Profile from the System admin page
Then Click on create compute profile button
Then Select a provisioner: "existingDataProc" for the compute profile
Then Enter input plugin property: "profileLabel" with value: "invalidProfile"
Then Enter textarea plugin property: "profileDescription" with value: "validDescription"
Then Enter input plugin property: "clusterName" with value: "validClusterName"
Then Click on: "Create" button in the properties
Then Verify that the compute profile is displaying an error message: "errorInvalidProfileName" on the footer

Scenario:To verify the validation error message with invalid namespace name
Given Open Datafusion Project to configure pipeline
When Open "System Admin" menu
Then Click on the Configuration link on the System admin page
Then Click on Create New Namespace button
Then Enter the New Namespace Name with value: "invalidNamespaceName"
Then Enter the Namespace Description with value: "validNamespaceDescription"
Then Click on: "Finish" button in the properties
Then Verify the failed error message: "errorInvalidNamespace" displayed on dialog box
Loading

0 comments on commit 2d84b39

Please sign in to comment.