forked from Azure/azure-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
{Regression test} Enhance Bump Version Pipeline to be Regression Test…
… Pipeline (Azure#23931) * accept custom repo & branch * condition variable * login password * docs
- Loading branch information
Showing
8 changed files
with
72 additions
and
38 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: CLI BUMP VERSION $(PACKAGE) $(TARGET_PACKAGE_VERSION) $(Date:yyyyMMdd)$(Rev:.r) | ||
name: CLI REGRESSION TEST $(Date:yyyyMMdd)$(Rev:.r) | ||
|
||
resources: | ||
- repo: self | ||
|
@@ -14,6 +14,7 @@ variables: | |
jobs: | ||
- job: UpdateVersionFiles | ||
displayName: CLI Bump Version Update Version Files | ||
condition: ne(variables['PACKAGE'], '') | ||
pool: | ||
name: ${{ variables.ubuntu_pool }} | ||
steps: | ||
|
@@ -59,9 +60,10 @@ jobs: | |
git push --set-upstream azclibot bump_version_$(Build.BuildId) | ||
- job: RerunTests | ||
displayName: CLI Bump Version Rerun tests | ||
displayName: CLI Regression tests | ||
dependsOn: UpdateVersionFiles | ||
timeoutInMinutes: 9999 | ||
condition: in(dependencies.UpdateVersionFiles.result, 'Succeeded', 'Skipped') | ||
timeoutInMinutes: 0 | ||
strategy: | ||
maxParallel: 8 | ||
matrix: | ||
|
@@ -96,21 +98,28 @@ jobs: | |
inlineScript: | | ||
set -ev | ||
# git config | ||
GITHUB_TOKEN=$(az keyvault secret show --vault-name kv-azuresdk --name azclibot-pat --query value -otsv) | ||
if [[ -n "$(CUSTOM_REPO)" && -n "$(CUSTOM_BRANCH)" && -n "$(CUSTOM_GITHUB_TOKEN)" ]]; then | ||
GITHUB_REPO=$(CUSTOM_REPO) | ||
GITHUB_BRANCH=$(CUSTOM_BRANCH) | ||
GITHUB_TOKEN=$(CUSTOM_GITHUB_TOKEN) | ||
else | ||
GITHUB_REPO="azclibot" | ||
GITHUB_BRANCH="bump_version_$(Build.BuildId)" | ||
GITHUB_TOKEN=$(az keyvault secret show --vault-name kv-azuresdk --name azclibot-pat --query value -otsv) | ||
fi | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Azure CLI Team" | ||
git remote add azclibot https://azclibot:${GITHUB_TOKEN}@github.com/azclibot/azure-cli.git | ||
git fetch azclibot | ||
git remote add ${GITHUB_REPO} https://${GITHUB_REPO}:${GITHUB_TOKEN}@github.com/${GITHUB_REPO}/azure-cli.git | ||
git fetch ${GITHUB_REPO} | ||
git checkout -b bump_version_$(Build.BuildId) azclibot/bump_version_$(Build.BuildId) | ||
git checkout -b ${GITHUB_BRANCH} ${GITHUB_REPO}/${GITHUB_BRANCH} | ||
- template: ../../.azure-pipelines/templates/azdev_setup.yml | ||
- bash: | | ||
set -ev | ||
source env/bin/activate | ||
pip show $(PACKAGE) | ||
az login -u $(CLI_LIVE_TEST_ACCOUNT) -p $(CLI_LIVE_TEST_PASSWORD) | ||
az login -u $(CLI_LIVE_TEST_ACCOUNT) -p "$(CLI_LIVE_TEST_PASSWORD)" | ||
az account set -s 0b1f6471-1bf0-4dda-aec3-cb9272f09590 | ||
serial_modules="appservice botservice cloud network azure-cli-core azure-cli-telemetry" | ||
|
@@ -119,10 +128,10 @@ jobs: | |
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFiles: '/mnt/vss/.azdev/env_config/mnt/vss/_work/1/s/env/test_results_*.xml' | ||
testRunTitle: 'CLI Bump Version test results of instance $(Instance_idx)' | ||
testRunTitle: 'CLI Regression test results of instance $(Instance_idx)' | ||
|
||
- job: CreatePR | ||
displayName: CLI Bump Version Create PR | ||
displayName: CLI Regression Test Create PR | ||
dependsOn: RerunTests | ||
pool: | ||
name: ${{ variables.ubuntu_pool }} | ||
|
@@ -135,14 +144,20 @@ jobs: | |
inlineScript: | | ||
set -ev | ||
# git config | ||
GITHUB_TOKEN=$(az keyvault secret show --vault-name kv-azuresdk --name azclibot-pat --query value -otsv) | ||
if [[ -n "$(CUSTOM_REPO)" && -n "$(CUSTOM_BRANCH)" && -n "$(CUSTOM_GITHUB_TOKEN)" ]]; then | ||
GITHUB_TOKEN=$(CUSTOM_GITHUB_TOKEN) | ||
pr_title="Regression Test for $(CUSTOM_REPO)/$(CUSTOM_BRANCH)" | ||
pr_body="Triggered by CLI Regression Test Pipeline - ADO_BUILD_ID=$(Build.BuildId)\n\nRegression test for $(CUSTOM_REPO)/$(CUSTOM_BRANCH)\nThere may still exist some failed tests, see [details](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=$(Build.BuildId)&view=ms.vss-test-web.build-test-results-tab) in ADO pipeline" | ||
pr_head="$(CUSTOM_REPO):$(CUSTOM_BRANCH)" | ||
else | ||
GITHUB_TOKEN=$(az keyvault secret show --vault-name kv-azuresdk --name azclibot-pat --query value -otsv) | ||
pr_title="Regression Test for $(PACKAGE) to $(TARGET_PACKAGE_VERSION)" | ||
pr_body="Triggered by CLI Regression Test Pipeline - ADO_BUILD_ID=$(Build.BuildId)\n\npackage: $(PACKAGE) $(TARGET_PACKAGE_VERSION)\nresource_type: $(RESOURCE_TYPE) $(TARGET_API_VERSION)\n\nThere may still exist some failed tests, see [details](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=$(Build.BuildId)&view=ms.vss-test-web.build-test-results-tab) in ADO pipeline" | ||
pr_head="azclibot:bump_version_$(Build.BuildId)" | ||
fi | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Azure CLI Team" | ||
pr_title="{Package} Bump version for $(PACKAGE) to $(TARGET_PACKAGE_VERSION)" | ||
pr_body="Triggered by CLI Bump Version Pipeline - ADO_BUILD_ID=$(Build.BuildId)\n\npackage: $(PACKAGE) $(TARGET_PACKAGE_VERSION)\nresource_type: $(RESOURCE_TYPE) $(TARGET_API_VERSION)\n\nThere may still exist some failed tests, see [details](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=$(Build.BuildId)&view=ms.vss-test-web.build-test-results-tab) in ADO pipeline" | ||
pr_head="azclibot:bump_version_$(Build.BuildId)" | ||
curl \ | ||
-H "Authorization: token ${GITHUB_TOKEN}" \ | ||
-d "{\"title\": \"${pr_title}\", \"body\": \"${pr_body}\", \"head\": \"${pr_head}\", \"base\": \"dev\"}" \ | ||
|
File renamed without changes.