Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{CI} Extension regression test pipeline #25026

Merged
merged 25 commits into from
Jan 13, 2023
Merged

Conversation

evelyn-ys
Copy link
Member

Description

This PR implements CLI Extension regression test pipeline


This checklist is used to make sure that common guidelines for a pull request are followed.

@ghost ghost added Auto-Assign Auto assign by bot CI CI labels Jan 3, 2023
@ghost ghost requested review from yonzhan and jsntcy January 3, 2023 06:47
@ghost ghost requested a review from bebound January 3, 2023 06:48
@ghost ghost assigned wangzelin007 Jan 3, 2023
@yonzhan yonzhan added this to the Dec 2022 (2023-01-10) milestone Jan 3, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Jan 3, 2023

CI

displayName: "Rerun tests"
- bash: |
publishErrorModules='false'
if [[ -f '/mnt/vss/.azdev/env_config/mnt/vss/_work/1/s/env/test_results_error_modules_$(Instance_idx).txt' ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

We may use variables instead of hard-coding the path /mnt/vss (#24201 (comment)).

Copy link
Member Author

Choose a reason for hiding this comment

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

Per @wangzelin007 and my test, $HOME, ~ directs to /home/cloudtest instead of /mnt/vss

Agent.HomeDirectory -> /usr/local/vss-agent/2.214.1
Pipeline.Workspace -> /mnt/vss/_work/1

I can't find the exact variable for /mnt/vss☹️

Copy link
Member Author

Choose a reason for hiding this comment

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

Or else we can use $(Pipeline.Workspace)/../..? Looks a liitle bit ugly to me

Copy link
Member

Choose a reason for hiding this comment

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

☹️

Copy link
Member Author

@evelyn-ys evelyn-ys Jan 12, 2023

Choose a reason for hiding this comment

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

We changed the .azdev folder from /home/vsts/.azdev to /mnt/vss/.azdev by mistake in #24201

It should always be ~/.azdev, which is /home/cloudtest/.azdev in new pipeline. I have changed all .azdev path back.

Comment on lines 128 to 132
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '/mnt/vss/.azdev/env_config/mnt/vss/_work/1/s/env/test_results_*.xml'
testRunTitle: 'CLI Regression test results of instance $(Instance_idx)'
Copy link
Member

@jiasli jiasli Jan 5, 2023

Choose a reason for hiding this comment

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

It will be great if we can adopt this PublishTestResults task in Azure.azure-cli Full Test pipeline.

Comment on lines 172 to 177
REGRESSION_BRANCHES=$(curl -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/repos/azclibot/azure-cli-extensions/git/matching-refs/heads/regression_test_$(Build.BuildId)_ | jq '.[] | .ref')

for branch in ${REGRESSION_BRANCHES[@]}
do
branch=${branch##*/}
branch=${branch%\"*}
Copy link
Member

Choose a reason for hiding this comment

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

Can we add an example to better understand these code?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

if [[ -f '/mnt/vss/.azdev/env_config/mnt/vss/_work/1/s/env/test_results_error_modules_$(Instance_idx).txt' ]]; then
publishErrorModules='true'
fi
echo "##vso[task.setvariable variable=publishErrorModules]$publishErrorModules"
Copy link
Member

@wangzelin007 wangzelin007 Jan 12, 2023

Choose a reason for hiding this comment

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

This handling is clever and worth a 👍

@evelyn-ys evelyn-ys merged commit 0bf8f41 into dev Jan 13, 2023
avgale pushed a commit to avgale/azure-cli that referenced this pull request Aug 24, 2023
* init

* extension regression test

* checkout repo

* variable path

* checkout extension branch

* dependson

* typo

* extension repo path

* script

* fix extension command

* fix Nonetype

* test extension one by one

* commit recordings

* script path

* publish test results

* task condition

* prepare results

* branch name & artifacts path

* result summary

* fix

* create PR

* bash array

* path and comments
@wangzelin007 wangzelin007 deleted the extension_regression_test branch November 18, 2024 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot CI CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants