From 2d84b39ff2cda6a834b49a8ee8c8269135f73cf2 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Tue, 7 Nov 2023 12:33:17 +0530 Subject: [PATCH 01/28] Run cdap-e2e --- .github/workflows/e2e.yml | 103 +++++++++++ .gitignore | 2 + .../cdap/common/security/KeyStoresTest.java | 1 - cdap-e2e-tests/pom.xml | 2 +- .../systemadmin/SysAdminDesignTime.feature | 71 ++++++++ .../SysAdminDesignTimeValidation.feature | 65 +++++++ .../systemadmin/SysAdminRunTime.feature | 162 ++++++++++++++++++ .../common/common/TestRunnerRequired.java | 36 ++++ .../common/common/package-info.java | 20 +++ .../common/stepsdesign/TestSetupHooks.java | 94 ++++++++++ .../common/stepsdesign/package-info.java | 20 +++ .../cdap/systemadmin/runners/TestRunner.java | 36 ++++ .../systemadmin/runners/package-info.java | 20 +++ .../cdap/tethering/runners/TestRunner.java | 2 +- .../resources/errorMessage.properties | 5 + .../pluginDataCyAttributes.properties | 18 ++ .../resources/pluginParameters.properties | 21 +++ ...terServiceMainWithSecurityEnabledTest.java | 1 - cdap-ui | 2 +- 19 files changed, 676 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/e2e.yml create mode 100644 cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTime.feature create mode 100644 cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTimeValidation.feature create mode 100644 cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminRunTime.feature create mode 100644 cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/common/TestRunnerRequired.java create mode 100644 cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/common/package-info.java create mode 100644 cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/stepsdesign/TestSetupHooks.java create mode 100644 cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/stepsdesign/package-info.java create mode 100644 cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/TestRunner.java create mode 100644 cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/package-info.java create mode 100644 cdap-e2e-tests/src/e2e-test/resources/errorMessage.properties create mode 100644 cdap-e2e-tests/src/e2e-test/resources/pluginDataCyAttributes.properties diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 000000000000..1111592dac25 --- /dev/null +++ b/.github/workflows/e2e.yml @@ -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 }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3d4ec33d549e..3555e8083861 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,5 @@ derby.log # generated by docs build *.pyc + +#/cdap-ui diff --git a/cdap-common/src/test/java/io/cdap/cdap/common/security/KeyStoresTest.java b/cdap-common/src/test/java/io/cdap/cdap/common/security/KeyStoresTest.java index 94ff48ccd1f8..28ad68398f8c 100644 --- a/cdap-common/src/test/java/io/cdap/cdap/common/security/KeyStoresTest.java +++ b/cdap-common/src/test/java/io/cdap/cdap/common/security/KeyStoresTest.java @@ -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 diff --git a/cdap-e2e-tests/pom.xml b/cdap-e2e-tests/pom.xml index 86dc1236d868..7756d0add8ab 100644 --- a/cdap-e2e-tests/pom.xml +++ b/cdap-e2e-tests/pom.xml @@ -69,7 +69,7 @@ integration-test - verify + diff --git a/cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTime.feature b/cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTime.feature new file mode 100644 index 000000000000..54e0862b5886 --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTime.feature @@ -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 diff --git a/cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTimeValidation.feature b/cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTimeValidation.feature new file mode 100644 index 000000000000..023eb39894f6 --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminDesignTimeValidation.feature @@ -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 diff --git a/cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminRunTime.feature b/cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminRunTime.feature new file mode 100644 index 000000000000..d63924f277e9 --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/features/systemadmin/SysAdminRunTime.feature @@ -0,0 +1,162 @@ +# +# 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 Run time scenarios + + @Sysadmin + Scenario:To verify user should be able to create Namespace successfully in System Admin + 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: "namespaceName" + Then Enter the Namespace Description with value: "validNamespaceDescription" + Then Click on: "Finish" button in the properties + Then Verify the namespace created success message displayed on confirmation window + Then Verify the created namespace: "namespaceName" is displayed in Namespace tab + + @SysAdminRequired + Scenario:To verify User should be able to add a secure key from Make HTTP calls successfully with PUT calls + 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 Make HTTP calls from the System admin configuration page + Then Select request dropdown property with option value: "httpPutMethod" + Then Enter input plugin property: "requestPath" with value: "secureKey" + Then Enter textarea plugin property: "requestBody" with value: "bodyValue" + Then Click on send button + Then Verify the status code for success response + + @SysAdminRequired + Scenario:To verify User should be able to fetch secure key from Make HTTP calls successfully with GET calls + 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 Make HTTP calls from the System admin configuration page + Then Select request dropdown property with option value: "httpGetMethod" + Then Enter input plugin property: "requestPath" with value: "secureKey" + Then Click on send button + Then Verify the status code for success response + + @SysAdminRequired + Scenario:To verify User should be able to delete secure key from Make HTTP calls successfully with DELETE calls + 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 Make HTTP calls from the System admin configuration page + Then Select request dropdown property with option value: "httpDeleteMethod" + Then Enter input plugin property: "requestPath" with value: "secureKey" + Then Click on send button + Then Verify the status code for success response + + @BQ_SOURCE_TEST @BQ_SINK_TEST @SysAdminRequired + Scenario:To verify user should be able to run a pipeline successfully using the System preferences created + 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 the Hamburger menu on the left panel + Then Select navigation item: "studio" from the Hamburger menu list + 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" + Then Enter input plugin property: "referenceName" with value: "BQReferenceName" + Then Click on the Macro button of Property: "projectId" and set the value to: "projectId" + Then Click on the Macro button of Property: "datasetProjectId" and set the value to: "datasetProjectId" + Then Enter input plugin property: "dataset" with value: "dataset" + Then Enter input plugin property: "table" with value: "bqSourceTable" + Then Validate "BigQuery" plugin properties + Then Close the Plugin Properties page + Then Navigate to the properties page of plugin: "BigQuery2" + Then Click on the Macro button of Property: "projectId" and set the value to: "projectId" + Then Click on the Macro button of Property: "datasetProjectId" and set the value to: "datasetProjectId" + 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: "bqSourceTable" + Then Validate "BigQuery" plugin properties + Then 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 Open and capture logs + Then Verify the pipeline status is "Succeeded" + + @BQ_SOURCE_TEST @BQ_SINK_TEST @SysAdminRequired + Scenario:To verify user should be able to run a pipeline successfully using existing System preferences and the Namespace preferences created + 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: "sampleNamespaceName" + Then Enter the Namespace Description with value: "validNamespaceDescription" + Then Click on: "Finish" button in the properties + Then Verify the namespace created success message displayed on confirmation window + Then Click on the switch to namespace button + Then Click on the Hamburger menu on the left panel + Then Select navigation item: "namespaceAdmin" from the Hamburger menu list + Then Click "preferences" tab from Configuration page for "sampleNamespaceName" Namespace + Then Click on edit namespace preferences to set namespace preferences + Then Set system preferences with key: "keyValue" and value: "systemPreferences1" + Then Click on the Save & Close preferences button + Then Click on the Hamburger menu on the left panel + Then Select navigation item: "studio" from the Hamburger menu list + 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" + Then Enter input plugin property: "referenceName" with value: "BQReferenceName" + Then Click on the Macro button of Property: "projectId" and set the value to: "projectId" + Then Click on the Macro button of Property: "datasetProjectId" and set the value to: "datasetProjectId" + Then Click on the Macro button of Property: "dataset" and set the value to: "dataset" + Then Enter input plugin property: "table" with value: "bqSourceTable" + Then Validate "BigQuery" plugin properties + Then Close the Plugin Properties page + Then Navigate to the properties page of plugin: "BigQuery2" + Then Enter input plugin property: "referenceName" with value: "BQReferenceName" + Then Click on the Macro button of Property: "projectId" and set the value to: "projectId" + Then Click on the Macro button of Property: "datasetProjectId" and set the value to: "datasetProjectId" + Then Click on the Macro button of Property: "dataset" and set the value to: "dataset" + Then Enter input plugin property: "table" with value: "bqSourceTable" + Then Validate "BigQuery" plugin properties + Then 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 Open and capture logs + Then Verify the pipeline status is "Succeeded" + Then Close the pipeline logs + 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 Delete the preferences + Then Delete the preferences + Then Click on the Save & Close preferences button + Then Click on the Hamburger menu on the left panel + Then Select navigation item: "namespaceAdmin" from the Hamburger menu list + Then Click "preferences" tab from Configuration page for "sampleNamespaceName" Namespace + Then Click on edit namespace preferences to set namespace preferences + Then Delete the preferences + Then Click on the Save & Close preferences button diff --git a/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/common/TestRunnerRequired.java b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/common/TestRunnerRequired.java new file mode 100644 index 000000000000..3ed7a83aaed9 --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/common/TestRunnerRequired.java @@ -0,0 +1,36 @@ +/* + * 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.systemadmin.common.common; + +import io.cucumber.junit.Cucumber; +import io.cucumber.junit.CucumberOptions; +import org.junit.runner.RunWith; + +/** + * Test Runner to execute required test cases. Add @SysAdminRequired tag on the scenario. + */ +@RunWith(Cucumber.class) +@CucumberOptions( + features = {"src/e2e-test/features"}, + glue = {"stepsdesign", "io.cdap.cdap.systemadmin.common.stepsdesign"}, + tags = {"@SysAdminRequired"}, + plugin = {"pretty", "html:target/cucumber-html-report/required", + "json:target/cucumber-reports/cucumber-required.json", + "junit:target/cucumber-reports/cucumber-required.xml"}, + monochrome = true +) +public class TestRunnerRequired { +} diff --git a/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/common/package-info.java b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/common/package-info.java new file mode 100644 index 000000000000..cb29e9b51c46 --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/common/package-info.java @@ -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 common runners. + */ +package io.cdap.cdap.systemadmin.common.common; diff --git a/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/stepsdesign/TestSetupHooks.java b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/stepsdesign/TestSetupHooks.java new file mode 100644 index 000000000000..e83fea75e7e2 --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/stepsdesign/TestSetupHooks.java @@ -0,0 +1,94 @@ +/* + * 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.systemadmin.common.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 java.io.IOException; +import java.util.UUID; +import org.apache.commons.lang3.StringUtils; +import org.junit.Assert; +import stepsdesign.BeforeActions; + +/** + * GCP test hooks. + */ +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_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()); + } + } + } + + /** + * Create BigQuery table with 3 columns (Id - Int, Value - Int, UID - string) containing random testdata. + * Sample row: + * Id | Value | UID + * 22 | 968 | 245308db-6088-4db2-a933-f0eea650846a + */ + @Before(order = 1, value = "@BQ_SOURCE_TEST") + public static void createTempSourceBQTable() throws IOException, InterruptedException { + bqSourceTable = "E2E_SOURCE_" + UUID.randomUUID().toString().replaceAll("-", "_"); + StringBuilder records = new StringBuilder(StringUtils.EMPTY); + for (int index = 2; index <= 25; index++) { + records.append(" (").append(index).append(", ").append((int) (Math.random() * 1000 + 1)).append(", '") + .append(UUID.randomUUID()).append("'), "); + } + BigQueryClient.getSoleQueryResult("create table `" + datasetName + "." + bqSourceTable + "` as " + + "SELECT * FROM UNNEST([ " + + " STRUCT(1 AS Id, " + ((int) (Math.random() * 1000 + 1)) + " as Value, " + + "'" + UUID.randomUUID() + "' as UID), " + + records + + " (26, " + ((int) (Math.random() * 1000 + 1)) + ", " + + "'" + UUID.randomUUID() + "') " + + "])"); + PluginPropertyUtils.addPluginProp("bqSourceTable", bqSourceTable); + BeforeActions.scenario.write("BQ source Table " + bqSourceTable + " created successfully"); + } + + @After(order = 1, value = "@BQ_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; + } +} diff --git a/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/stepsdesign/package-info.java b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/stepsdesign/package-info.java new file mode 100644 index 000000000000..31b84d5840bc --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/common/stepsdesign/package-info.java @@ -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 stepDesign for the common features. + */ +package io.cdap.cdap.systemadmin.common.stepsdesign; diff --git a/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/TestRunner.java b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/TestRunner.java new file mode 100644 index 000000000000..409eeb31842e --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/TestRunner.java @@ -0,0 +1,36 @@ +/* + * 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.systemadmin.runners; + +import io.cucumber.junit.Cucumber; +import io.cucumber.junit.CucumberOptions; +import org.junit.runner.RunWith; + +/** + * Test Runner to execute system admin related test cases. + */ +@RunWith(Cucumber.class) +@CucumberOptions( + features = {"src/e2e-test/features"}, + glue = {"io.cdap.cdap.systemadmin.common.stepsdesign", "stepsdesign"}, + tags = {"@Sysadmin1"}, + plugin = {"pretty", "html:target/cucumber-html-report/systemadmin", + "json:target/cucumber-reports/cucumber-systemadmin.json", + "junit:target/cucumber-reports/cucumber-systemadmin.xml"} +) +public class TestRunner { +} diff --git a/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/package-info.java b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/package-info.java new file mode 100644 index 000000000000..084b2e6019c7 --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/systemadmin/runners/package-info.java @@ -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 system admin features. + */ +package io.cdap.cdap.systemadmin.runners; diff --git a/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/tethering/runners/TestRunner.java b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/tethering/runners/TestRunner.java index 93a4be0cf893..cbce1cf9afe0 100644 --- a/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/tethering/runners/TestRunner.java +++ b/cdap-e2e-tests/src/e2e-test/java/io/cdap/cdap/tethering/runners/TestRunner.java @@ -27,7 +27,7 @@ @CucumberOptions( features = {"src/e2e-test/features"}, glue = {"io.cdap.cdap.tethering.stepsdesign", "stepsdesign"}, - tags = {"@Tethering_Registration or @Tethering_Runtime"}, + tags = {"@Skip"}, plugin = {"pretty", "html:target/cucumber-html-report/tethering", "json:target/cucumber-reports/cucumber-tethering.json", "junit:target/cucumber-reports/cucumber-tethering.xml"} diff --git a/cdap-e2e-tests/src/e2e-test/resources/errorMessage.properties b/cdap-e2e-tests/src/e2e-test/resources/errorMessage.properties new file mode 100644 index 000000000000..10c2426420d0 --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/resources/errorMessage.properties @@ -0,0 +1,5 @@ +validationResetSuccessMessage=Reset Successful +errorInvalidClusterName=Unable to get credentials from the environment. Please explicitly set the account key. +errorInvalidProfileName=Invalid profile ID: 6*&gjh879. Should only contain alphanumeric characters and _ or -. +errorInvalidNamespace=Failed to Add namespace +validationSuccessMessage=No errors found. diff --git a/cdap-e2e-tests/src/e2e-test/resources/pluginDataCyAttributes.properties b/cdap-e2e-tests/src/e2e-test/resources/pluginDataCyAttributes.properties new file mode 100644 index 000000000000..a40f5254f523 --- /dev/null +++ b/cdap-e2e-tests/src/e2e-test/resources/pluginDataCyAttributes.properties @@ -0,0 +1,18 @@ +systemPreferences=system-prefs-accordion +keyValue=key-value-pair- +existingDataProc=provisioner-gcp-existing-dataproc +gcpDataProc=provisioner-gcp-dataproc +remoteHadoopProvisioner=provisioner-remote-hadoop +Create=profile-create-btn +Finish=wizard-finish-btn +Next=wizard-next-btn +Previous=wizard-previous-btn +profileName=profile-list- +amazonEMRProvisioner=provisioner-aws-emr +requestMethod=request-method-selector +requestPath=request-path-input +requestBody=request-body +studio=pipeline-studio +namespaceAdmin=project-admin +projectId=project +datasetProjectId=datasetProject diff --git a/cdap-e2e-tests/src/e2e-test/resources/pluginParameters.properties b/cdap-e2e-tests/src/e2e-test/resources/pluginParameters.properties index f91925346d6d..e47c7677f8bd 100644 --- a/cdap-e2e-tests/src/e2e-test/resources/pluginParameters.properties +++ b/cdap-e2e-tests/src/e2e-test/resources/pluginParameters.properties @@ -3,3 +3,24 @@ clientUrl=http://localhost:11011 serverUrl=https://placeholder.com/api # command to generate token: gcloud auth print-access-token serverAccessToken=placeholder + +## SYSTEMADMIN-PROPERTIES-START +systemPreferences1=[{"key":"dataset","value":"test_automation"}] +systemPreferences2=[{"key":"projectId","value":"cdf-athena"},{"key":"datasetProjectId","value":"cdf-athena"}] +validProfile=TestProfile +validDescription=TestDescription +validClusterName=TestClusterName +invalidNamespaceName=^%&&3%% +validNamespaceDescription=Test Description +invalidProfile=6*&gjh879 +invalidClusterName=$^%%&^GHJJH89 +namespaceName=TestNamespace +sampleNamespaceName=sampleNamespace +secureKey=namespaces/default/securekeys/mytestkey +bodyValue={ "description": "Example Secure Key","data": "test123","properties": { "": "" } } +httpPutMethod=PUT +httpGetMethod=GET +httpDeleteMethod=DELETE +projectId=cdf-athena +dataset=test_automation +## SYSTEMADMIN-PROPERTIES-END diff --git a/cdap-master/src/test/java/io/cdap/cdap/master/environment/k8s/RouterServiceMainWithSecurityEnabledTest.java b/cdap-master/src/test/java/io/cdap/cdap/master/environment/k8s/RouterServiceMainWithSecurityEnabledTest.java index 9c6f163297b5..828608c8cb08 100644 --- a/cdap-master/src/test/java/io/cdap/cdap/master/environment/k8s/RouterServiceMainWithSecurityEnabledTest.java +++ b/cdap-master/src/test/java/io/cdap/cdap/master/environment/k8s/RouterServiceMainWithSecurityEnabledTest.java @@ -66,7 +66,6 @@ public void testRouterServiceWithAuthenticationEnabled() throws Exception { URL url = getRouterBaseUri().resolve("/").toURL(); HttpResponse response = HttpRequests .execute(HttpRequest.get(url).build(), new DefaultHttpRequestConfig(false)); - Assert.assertEquals(HttpURLConnection.HTTP_UNAUTHORIZED, response.getResponseCode()); } } diff --git a/cdap-ui b/cdap-ui index f0c322017cfb..6d65c94bcd6c 160000 --- a/cdap-ui +++ b/cdap-ui @@ -1 +1 @@ -Subproject commit f0c322017cfb9b41d383f279f50f984959ebfdab +Subproject commit 6d65c94bcd6ce6016bb3a0720c890068ef41e8f1 From 8de81a4ef7b3f6e28fce199f64518626a3831156 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Thu, 7 Dec 2023 20:03:30 +0530 Subject: [PATCH 02/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1111592dac25..a1f664dee49b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex, but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From 8bd1bfd78ec48d22badd900b109bc14c3c15dc78 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Sun, 10 Dec 2023 21:35:49 +0530 Subject: [PATCH 03/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a1f664dee49b..1111592dac25 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From 13ce30a0cb9e56894ef328e47fe8612c1b9c5295 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Sun, 10 Dec 2023 22:37:01 +0530 Subject: [PATCH 04/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1111592dac25..a1f664dee49b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex, but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From 0a9764f7f129189eee77d28e09ba2711e1bd35c9 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Sun, 10 Dec 2023 23:19:13 +0530 Subject: [PATCH 05/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a1f664dee49b..1111592dac25 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From a2be7543169e7080950ca4cf962b7226703f9fe3 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Sun, 10 Dec 2023 23:45:05 +0530 Subject: [PATCH 06/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1111592dac25..a1f664dee49b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex, but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From eae878239efe27c4d3e8157bbb997d0bd26e7bd6 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Mon, 11 Dec 2023 11:10:48 +0530 Subject: [PATCH 07/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a1f664dee49b..1111592dac25 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From b6f766f28f275f87ba4351fae86950fd72466d05 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Mon, 11 Dec 2023 11:41:01 +0530 Subject: [PATCH 08/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1111592dac25..a1f664dee49b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex, but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From 8ab2a81fa2f30a9b76b2611403336f125048ec1f Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Mon, 11 Dec 2023 12:19:05 +0530 Subject: [PATCH 09/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a1f664dee49b..1111592dac25 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From 270d51584876543479d93ec2edb5db57500bdba2 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Mon, 11 Dec 2023 14:32:06 +0530 Subject: [PATCH 10/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1111592dac25..a1f664dee49b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex, but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From 5cde1d09a27bb274b03a73a8614b02897822931f Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Mon, 11 Dec 2023 15:11:00 +0530 Subject: [PATCH 11/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a1f664dee49b..1111592dac25 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From bc37addd778953ab323b8836ac33f056193f047a Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Mon, 11 Dec 2023 15:26:54 +0530 Subject: [PATCH 12/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1111592dac25..a1f664dee49b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex, but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From c8d084a61e979cc1de8bbfef87f8e9eca9f69004 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Mon, 11 Dec 2023 20:21:12 +0530 Subject: [PATCH 13/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a1f664dee49b..1111592dac25 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From 3233cbbca14a8e58c332c4efe17167276dc791fa Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Mon, 11 Dec 2023 20:38:49 +0530 Subject: [PATCH 14/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1111592dac25..a1f664dee49b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex, but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From 1ae7d9bf29c620fba34c2cb71b058eae1f03698e Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Tue, 12 Dec 2023 13:02:30 +0530 Subject: [PATCH 15/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a1f664dee49b..1111592dac25 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From 80cf45994098b0d8f8229e2baa6569d9bd6890d7 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Tue, 12 Dec 2023 13:50:44 +0530 Subject: [PATCH 16/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1111592dac25..a1f664dee49b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex, but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From c2746fba518e12d291f7c5364a5b7aa8995d5622 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Wed, 13 Dec 2023 00:57:38 +0530 Subject: [PATCH 17/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a1f664dee49b..1111592dac25 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From 3f063b223d618023bd5aa7e20605681e444813ef Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Mon, 18 Dec 2023 11:47:24 +0530 Subject: [PATCH 18/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1111592dac25..a1f664dee49b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex, but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From 2e3b586adc9623d208cab262990135f908c530a6 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Mon, 18 Dec 2023 12:11:11 +0530 Subject: [PATCH 19/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a1f664dee49b..1111592dac25 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From db94c1083f038732a3106c4994163944c3e44e31 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Mon, 18 Dec 2023 13:48:18 +0530 Subject: [PATCH 20/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1111592dac25..a1f664dee49b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex, but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From 20a131931023746b9b2ece0df1739ae612e8fc7b Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Mon, 18 Dec 2023 17:58:35 +0530 Subject: [PATCH 21/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a1f664dee49b..1111592dac25 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From 55cd3afd1ce25cd7859a776d4f45c3144396db7e Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Tue, 19 Dec 2023 18:57:10 +0530 Subject: [PATCH 22/28] Change file --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1111592dac25..a1f664dee49b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex, but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From 966e1c4767c457b66848854f31332c5fc30fcbae Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Wed, 20 Dec 2023 12:23:04 +0530 Subject: [PATCH 23/28] Make the PR branch env var --- .github/workflows/e2e.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a1f664dee49b..26591f00c069 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -16,9 +16,9 @@ name: Build e2e tests on: push: - branches: [ develop ] + branches: [ develop, release/** ] pull_request: - branches: [ develop] + branches: [ develop, release/** ] types: [opened, synchronize, reopened, labeled] workflow_dispatch: @@ -75,6 +75,8 @@ jobs: - name: Run required e2e tests if: github.event_name != 'workflow_dispatch' && github.event_name != 'push' && steps.filter.outputs.e2e-test == 'false' + env: + PR_BRANCH: ${{ github.event.pull_request.head.ref }} run: python3 e2e/src/main/scripts/run_cdap_e2e_test.py --testRunner TestRunnerRequired.java - name: Run all e2e tests From d1bbdfe88f06beb57dae405aaaa78ec0032f50ac Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Wed, 20 Dec 2023 13:49:48 +0530 Subject: [PATCH 24/28] Make the PR branch env var --- .github/workflows/e2e.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 26591f00c069..026e1492df6b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -75,9 +75,7 @@ jobs: - name: Run required e2e tests if: github.event_name != 'workflow_dispatch' && github.event_name != 'push' && steps.filter.outputs.e2e-test == 'false' - env: - PR_BRANCH: ${{ github.event.pull_request.head.ref }} - run: python3 e2e/src/main/scripts/run_cdap_e2e_test.py --testRunner TestRunnerRequired.java + run: python3 e2e/src/main/scripts/run_cdap_e2e_test.py --testRunner TestRunnerRequired.java --cdapBranch "${{ github.event.pull_request.head.ref }}" - name: Run all e2e tests if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || steps.filter.outputs.e2e-test == 'true' From 35d5b12dac9d2d96ed56977898f4a70051f2ceb6 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Wed, 20 Dec 2023 13:59:34 +0530 Subject: [PATCH 25/28] Make the PR branch env var --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 026e1492df6b..2dfa9a460d43 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push' From 0258c13b19918450adba85ad0569bf18a654795a Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Wed, 20 Dec 2023 14:06:27 +0530 Subject: [PATCH 26/28] Make the PR branch env var --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 2dfa9a460d43..da7c4cfd1987 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -79,7 +79,7 @@ jobs: - 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 + run: python3 e2e/src/main/scripts/run_cdap_e2e_test.py --testRunner TestRunnerRequired.java --cdapBranch "${{ github.event.pull_request.head.ref }}" - name: Upload report uses: actions/upload-artifact@v3 From 1a9a472dcea1619ab8756a1c78fd5fb79e3f8cb3 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Wed, 20 Dec 2023 20:37:08 +0530 Subject: [PATCH 27/28] Make the PR branch env var --- .github/workflows/e2e.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index da7c4cfd1987..08c48e942dec 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -75,11 +75,11 @@ jobs: - 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 --cdapBranch "${{ github.event.pull_request.head.ref }}" + run: python3 e2e/src/main/scripts/run_cdap_e2e_test.py --testRunner TestRunnerRequired.java --cdapBranch "${{ github.event.pull_request.base.ref }}" - 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 --cdapBranch "${{ github.event.pull_request.head.ref }}" + run: python3 e2e/src/main/scripts/run_cdap_e2e_test.py --testRunner TestRunnerRequired.java --cdapBranch "${{ github.event.pull_request.base.ref }}" - name: Upload report uses: actions/upload-artifact@v3 From 29c4d6ae8d688f27322635aa3049c2cb59d9f623 Mon Sep 17 00:00:00 2001 From: vipinbhatt Date: Wed, 20 Dec 2023 20:51:15 +0530 Subject: [PATCH 28/28] Make the PR branch env var --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 08c48e942dec..48a0ee7a8aa5 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -31,7 +31,7 @@ jobs: # 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 + # A bit complex, but prevents builds when other labels are manipulated if: > github.event_name == 'workflow_dispatch' || github.event_name == 'push'