Skip to content

Conversation

@manika137
Copy link
Collaborator

@manika137 manika137 commented Jul 26, 2024

Description of PR

Automating the daily script runs and saving the results on storage account.

  • Saves the branch name and commit number in the test-results file
  • Results saved as- container-name/YY-MM-DD/branch-name/result_files

Screenshot of the results stored.
image

@anmolanmol1234
Copy link
Collaborator

anmolanmol1234 commented Jul 26, 2024

Looks good, can you also share how the results are stored in the storage account ? Like a snapshot of the results stored.

@manika137
Copy link
Collaborator Author

Looks good, can you also share how the results are stored in the storage account ? Like a snapshot of the results stored.

Added

Copy link
Collaborator

@anujmodi2021 anujmodi2021 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few suggestions, rest looks good.

@anujmodi2021 anujmodi2021 changed the title CI automation scipts [POC] CI automation scipts Aug 28, 2024

runHNSOAuthDFSTest()
{
runHNSOAuthDFSTest() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these diffs are not needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken

exit 0
;;
*) logOutput "ERROR: Invalid selection"
echo ' '
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same dont see any change between new code and old one for this selection. minimizing the diffs would be better for backporting

azureConfigFilePath="${accountSettingsDir}runresult${accountConfigFileSuffix}"
testResultsAccountName=$(xmlstarlet sel -t -v '//property[name = "fs.azure.test.results.account.name"]/value' -n $azureConfigFilePath)
testResultsAccountKey=$(xmlstarlet sel -t -v '//property[name = "fs.azure.test.results.account.key"]/value' -n $azureConfigFilePath)
branchName="${branchName,,}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the two commas needed here ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are used to convert into lowercase letters in Bash

if ! command -v az &> /dev/null
then
echo "Azure CLI (az) could not be found. Installing Azure CLI..."
sudo apt update
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be under a wait process ? What happens if the installation fails

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Added a check for it

@manika137 manika137 force-pushed the automateScript branch 2 times, most recently from 74a8d40 to d5e93eb Compare December 23, 2024 03:16
@manika137 manika137 changed the title [POC] CI automation scipts [POC] CI automation scripts Dec 23, 2024
Copy link
Collaborator

@anujmodi2021 anujmodi2021 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few more comments.

dev-support/testlogs
src/test/resources/accountSettings/*
!src/test/resources/accountSettings/accountName_settings.xml.template
dev-support/testrun-scripts/cronjob.sh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EOF Error:
Every file should end with a new line.

Copy link
Collaborator

@anujmodi2021 anujmodi2021 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

if [[ ! -f "$accountSettingsFile" ]];
then
logOutput "No settings present. Creating new settings file ($accountSettingsFile) from template"
cp src/test/resources/azure-auth-keys.xml.template $accountSettingsFile
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path should be taken in variable

fi

if [ $runTest == true ]
if [[ $runTest && $"$IS_CRON_JOB" != "true" ]]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name format should be camelCase

AggregatedTestFolder="$testOutputLogFolder"

checkCronjobDependencies
az storage container create --name $containerName --account-name $testResultsAccountName --account-key "$testResultsAccountKey"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if az copy command execution fails ?

summarycontent
} >> "$aggregatedTestResult"
printf "\n :::: AGGREGATED TEST RESULT :::: \n" >> "$aggregatedTestResult"
printf "\n----- Test results -----\n"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we not need to redirect the results now ?

testResultsAccountName=$(xmlstarlet sel -t -v '//property[name = "fs.azure.test.results.account.name"]/value' -n $azureConfigFilePath)
testResultsAccountKey=$(xmlstarlet sel -t -v '//property[name = "fs.azure.test.results.account.key"]/value' -n $azureConfigFilePath)
branchName="${branchName,,}"
containerName="$(xmlstarlet sel -t -v '//property[name = "fs.azure.container.name"]/value' -n $azureConfigFilePath)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this can also be fs.azure.test.results.container.name?


uploadToAzure() {
azureConfigFilePath="${accountSettingsDir}runresult${accountConfigFileSuffix}"
testResultsAccountName=$(xmlstarlet sel -t -v '//property[name = "fs.azure.test.results.account.name"]/value' -n $azureConfigFilePath)
Copy link
Collaborator

@anujmodi2021 anujmodi2021 Feb 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if cron job is running and these test result account details are not added?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants