diff --git a/hadoop-tools/hadoop-azure/.gitignore b/hadoop-tools/hadoop-azure/.gitignore index a7d3296d0fff3a..e0762bbc66d62c 100644 --- a/hadoop-tools/hadoop-azure/.gitignore +++ b/hadoop-tools/hadoop-azure/.gitignore @@ -5,3 +5,4 @@ src/test/resources/abfs-combination-test-configs.xml dev-support/testlogs src/test/resources/accountSettings/* !src/test/resources/accountSettings/accountName_settings.xml.template +dev-support/testrun-scripts/cronjob.sh \ No newline at end of file diff --git a/hadoop-tools/hadoop-azure/dev-support/testrun-scripts/cronjob.sh b/hadoop-tools/hadoop-azure/dev-support/testrun-scripts/cronjob.sh deleted file mode 100755 index a1dfb90b24cff8..00000000000000 --- a/hadoop-tools/hadoop-azure/dev-support/testrun-scripts/cronjob.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash - -set -eo pipefail - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. - -branchNames=$1 -IFS=',' read -r -a branches <<< "$branchNames" - -for branch in "${branches[@]}" -do - echo "Branch: $branch" - git checkout "$branch" - git pull origin "$branch" - bash "PATH_TO_RUNTESTS_SCRIPT" "$branch" -done - diff --git a/hadoop-tools/hadoop-azure/dev-support/testrun-scripts/runtests.sh b/hadoop-tools/hadoop-azure/dev-support/testrun-scripts/runtests.sh index 3e7b2d06d73820..db587ee7d85020 100755 --- a/hadoop-tools/hadoop-azure/dev-support/testrun-scripts/runtests.sh +++ b/hadoop-tools/hadoop-azure/dev-support/testrun-scripts/runtests.sh @@ -121,15 +121,15 @@ cleanUpTestContainers=false if [ "$IS_CRON_JOB" = "true" ]; then runTest=true runHNSOAuthDFSTest - runHNSSharedKeyDFSTest - runNonHNSSharedKeyDFSTest - runAppendBlobHNSOAuthDFSTest - runNonHNSSharedKeyBlobTest - runNonHNSOAuthDFSTest - runNonHNSOAuthBlobTest - runAppendBlobNonHNSOAuthBlobTest - runHNSOAuthDFSIngressBlobTest - runNonHNSOAuthDFSIngressBlobTest +# runHNSSharedKeyDFSTest +# runNonHNSSharedKeyDFSTest +# runAppendBlobHNSOAuthDFSTest +# runNonHNSSharedKeyBlobTest +# runNonHNSOAuthDFSTest +# runNonHNSOAuthBlobTest +# runAppendBlobNonHNSOAuthBlobTest +# runHNSOAuthDFSIngressBlobTest +# runNonHNSOAuthDFSIngressBlobTest uploadToAzure else @@ -267,7 +267,7 @@ do done fi -if [[ $runTest == true && $"$IS_CRON_JOB" != "true" ]] +if [[ $runTest && $"$IS_CRON_JOB" != "true" ]] then printAggregate fi diff --git a/hadoop-tools/hadoop-azure/dev-support/testrun-scripts/testsupport.sh b/hadoop-tools/hadoop-azure/dev-support/testrun-scripts/testsupport.sh index 9e7e8e098163a6..c57bef35191355 100644 --- a/hadoop-tools/hadoop-azure/dev-support/testrun-scripts/testsupport.sh +++ b/hadoop-tools/hadoop-azure/dev-support/testrun-scripts/testsupport.sh @@ -45,8 +45,8 @@ ENDTIME=$(date +%s) outputFormatOn="\033[0;95m" outputFormatOff="\033[0m" -targetWord="dfs" -replacementWord="blob" +targetWord=".dfs." +replacementWord=".blob." accountSettingsDir="src/test/resources/accountSettings/" accountConfigFileSuffix="_settings.xml" @@ -64,15 +64,16 @@ fnsBlobConfigFileCheck() { fi } -if ! command -v az &> /dev/null -then - echo "Azure CLI (az) could not be found. Installing Azure CLI..." - if ! sudo apt update || ! sudo apt install -y azure-cli; then - echo "Failed to install Azure CLI. Exiting..." - exit 1 +checkCronjobDependencies() { + if ! [ "$(command -v az)" ]; then + echo "Azure CLI (az) could not be found. Installing Azure CLI..." + if ! sudo apt update || ! sudo apt install -y azure-cli; then + echo "Failed to install Azure CLI. Exiting..." + exit 1 + fi + echo "Azure CLI installed successfully." fi - echo "Azure CLI installed successfully." -fi +} uploadToAzure() { azureConfigFilePath="${accountSettingsDir}runresult${accountConfigFileSuffix}" @@ -89,6 +90,7 @@ uploadToAzure() { directoryStructure="$year-$month-$day/$branchName" AggregatedTestFolder="$testOutputLogFolder" + checkCronjobDependencies az storage container create --name $containerName --account-name $testResultsAccountName --account-key "$testResultsAccountKey" az storage blob upload-batch --destination "$containerName/$directoryStructure" --source $AggregatedTestFolder --account-name $testResultsAccountName --account-key "$testResultsAccountKey"