Skip to content

Commit

Permalink
Merge pull request #5 from Azure/dev
Browse files Browse the repository at this point in the history
Update 4/8
  • Loading branch information
BigCat20196 authored Apr 8, 2021
2 parents 783635e + c808ba4 commit 1e0ede2
Showing 87 changed files with 24,728 additions and 6,365 deletions.
27 changes: 22 additions & 5 deletions .azure-pipelines/templates/automation_test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Azure DevOps task for automation test using azdev and pytest

parameters:
pythonVersion: ''
profile: ''
- name: pythonVersion
type: string
default: 3.8
- name: profile
type: string
default: latest
- name: fullTest
displayName: 'Run full test?'
type: boolean
default: false

steps:
- task: UsePythonVersion@0
@@ -13,10 +23,17 @@ steps:
source env/bin/activate
if [[ "$(System.PullRequest.TargetBranch)" != "" ]]; then
azdev test --series --no-exitfirst --repo=./ --src=HEAD --tgt=origin/$(System.PullRequest.TargetBranch) --cli-ci --profile ${{ parameters.profile }}
echo pythonVersion: ${{ parameters.pythonVersion }}
echo profile: ${{ parameters.profile }}
echo fullTest: ${{ parameters.fullTest }}
echo Build.Reason: $(Build.Reason)
if [[ "$(Build.Reason)" == "PullRequest" && "${{ parameters.fullTest }}" == 'False' ]]; then
echo "Running incremental test"
azdev test --no-exitfirst --repo=./ --src=HEAD --tgt=origin/$(System.PullRequest.TargetBranch) --cli-ci --profile ${{ parameters.profile }} --verbose --series
else
azdev test --series --no-exitfirst --profile ${{ parameters.profile }}
echo "Running full test"
azdev test --no-exitfirst --profile ${{ parameters.profile }} --verbose --series
fi
displayName: "Test on Profile ${{ parameters.profile }}"
env:
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
"name": "Azure CLI Debug (Integrated Console)",
"type": "python",
"request": "launch",
"pythonPath": "${command:python.interpreterPath}",
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/src/azure-cli/azure/cli/__main__.py",
"cwd": "${workspaceRoot}",
"args": [
@@ -24,7 +24,7 @@
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${command:python.interpreterPath}",
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/src/azure-cli/azure/cli/__main__.py",
"cwd": "${workspaceRoot}",
"args": [
@@ -40,7 +40,7 @@
"name": "Azdev Scripts",
"type": "python",
"request": "launch",
"pythonPath": "${command:python.interpreterPath}",
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/tools/automation/__main__.py",
"cwd": "${workspaceRoot}",
"args": [
206 changes: 68 additions & 138 deletions azure-pipelines-full-tests.yml
Original file line number Diff line number Diff line change
@@ -13,144 +13,74 @@ pr:
- '*'

jobs:
- job: ExtractMetadata
displayName: Extract Metadata
- job: AutomationTest
displayName: Automation Test (Profile Latest)
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
Python36:
python.version: '3.6'
Python38:
python.version: '3.8'
steps:
- template: .azure-pipelines/templates/automation_test.yml
parameters:
pythonVersion: '$(python.version)'
profile: 'latest'
fullTest: true

condition: succeeded()
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: Bash@3
displayName: 'Extract Version'
inputs:
targetType: 'filePath'
filePath: scripts/release/get_version.sh
- task: PublishPipelineArtifact@0
displayName: 'Publish Artifact: metadata'
inputs:
TargetPath: $(Build.ArtifactStagingDirectory)
ArtifactName: metadata
- job: AutomationTest20200901
displayName: Automation Test (Profile 2020-09-01)
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
Python36:
python.version: '3.6'
Python38:
python.version: '3.8'
steps:
- template: .azure-pipelines/templates/automation_test.yml
parameters:
pythonVersion: '$(python.version)'
profile: '2020-09-01-hybrid'
fullTest: true

- job: BuildPythonWheel
displayName: Build Python Wheels
dependsOn: ExtractMetadata
condition: succeeded()
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.7'
inputs:
versionSpec: 3.7
- job: AutomationTest20190301
displayName: Automation Test (Profile 2019-03-01)
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
Python36:
python.version: '3.6'
Python38:
python.version: '3.8'
steps:
- template: .azure-pipelines/templates/automation_test.yml
parameters:
pythonVersion: '$(python.version)'
profile: '2019-03-01-hybrid'
fullTest: true

- script: |
if [[ "$(Build.Reason)" == "PullRequest" ]]; then
branch=$(System.PullRequest.TargetBranch)
else
branch=$(Build.SourceBranchName)
fi
scripts/release/pypi/build.sh $branch
displayName: 'Run Wheel Build Script'
- task: PublishPipelineArtifact@0
displayName: 'Publish Artifact: pypi'
inputs:
TargetPath: $(Build.ArtifactStagingDirectory)
ArtifactName: pypi

- job: AutomationTest
displayName: Automation Test
dependsOn: BuildPythonWheel
condition: succeeded()
timeoutInMinutes: 90

pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
Python36:
python.version: '3.6'
Python38:
python.version: '3.8'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
inputs:
versionSpec: '$(python.version)'
- task: DownloadPipelineArtifact@1
displayName: 'Download Python Wheels'
inputs:
TargetPath: '$(Build.ArtifactStagingDirectory)/pypi'
artifactName: pypi
- bash: |
pip install --force-reinstall wheel
- task: Bash@3
displayName: 'Run Test Automation'
inputs:
targetType: 'filePath'
filePath: ./scripts/ci/test_automation.sh

- job: RunAutomationReduced20190301
displayName: Run Automation Reduced, Profile 2019-03-01
dependsOn: BuildPythonWheel
condition: succeeded()
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
Python36:
python.version: '3.6'
Python38:
python.version: '3.8'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
inputs:
versionSpec: '$(python.version)'
- task: DownloadPipelineArtifact@1
displayName: 'Download Python Wheels'
inputs:
TargetPath: '$(Build.ArtifactStagingDirectory)/pypi'
artifactName: pypi
- bash: |
pip install --force-reinstall wheel
- task: Bash@3
displayName: 'Run Test Automation'
inputs:
targetType: 'filePath'
filePath: ./scripts/ci/test_automation.sh
env:
REDUCE_SDK: 'True'
AZURE_CLI_TEST_TARGET_PROFILE: '2019-03-01'

- job: RunAutomation20180301
displayName: Run Automation, Profile 2018-03-01
dependsOn: BuildPythonWheel
condition: succeeded()
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
Python36:
python.version: '3.6'
Python38:
python.version: '3.8'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
inputs:
versionSpec: '$(python.version)'
- task: DownloadPipelineArtifact@1
displayName: 'Download Python Wheels'
inputs:
TargetPath: '$(Build.ArtifactStagingDirectory)/pypi'
artifactName: pypi
- bash: |
pip install --force-reinstall wheel
- task: Bash@3
displayName: 'Run Test Automation'
inputs:
targetType: 'filePath'
filePath: ./scripts/ci/test_automation.sh
env:
AZURE_CLI_TEST_TARGET_PROFILE: '2018-03-01'
- job: AutomationTest20180301
displayName: Automation Test (Profile 2018-03-01)
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
Python36:
python.version: '3.6'
Python38:
python.version: '3.8'
steps:
- template: .azure-pipelines/templates/automation_test.yml
parameters:
pythonVersion: '$(python.version)'
profile: '2018-03-01-hybrid'
fullTest: true
4 changes: 2 additions & 2 deletions doc/track_2_migration_roadmap.md
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ This document provides the roadmap for Track 2 SDK migration in Azure CLI. When
| KeyVault | Yes|**Completed** | 04/30/2021 |Catherine||GA (8.0.0) | GA (2.2.0) | Medium (Once three months) | Module |
| Monitor |Yes |**Completed** | 04/30/2021 |Yong||Monitor: GA (2.0.0)<br> LogAnalytics: GA (8.0.0) | Monitor: Preview (0.12.0)<br> LogAnalytics: GA (2.0.0) | Medium (Once two months) | Module |
| Resource | Yes |**Doing** | 04/30/2021 |Yong ||GA (15.0.0) | GA (12.0.0) | Medium (Once two months) | Module |
| AppService | Yes|Not Started | 04/30/2021 |Catherine||GA (1.0.0) | Preview (0.48.0) | Medium (Once three months) | Module |
| AppService | Yes | **In progress** | 04/30/2021 |Catherine||GA (1.0.0) | Preview (0.48.0) | Medium (Once three months) | Module |
| ACS | Yes |Not Started | 04/30/2021 |Catherine||ContainerService: GA (14.0.0)<br> ContainerInstance: GA (7.0.0) | ContainerService: GA (11.0.0)<br> ContainerInstance: GA (2.0.0) | Medium (Once two months) | Module |
| ACR | Yes |Not Started | 04/30/2021 |Catherine||Preview (8.0.0b1) | Preview (3.0.0rc16) | Medium (Once two months) | Module |
| CosmosDB | Yes |**Doing** | 04/30/2021 |Yong||GA (6.0.0) | Preview (2.0.0rc1) | Medium (Once two months) |Module|
@@ -59,7 +59,7 @@ This document provides the roadmap for Track 2 SDK migration in Azure CLI. When
| Synapse | |Not Started | N/A |||Preview (1.0.0b1) | Preview (0.6.0) | Medium (Once two months) | Module |
| EventHub | |Not Started | N/A |||GA (8.0.0) | GA (4.2.0) | Low (Once a year) | Module |
| Search | |**Completed** | N/A |||GA (8.0.0) | GA (3.0.0) | Low (Once a year) | Module |
| AppConfiguration | |Not Started | N/A |||GA (1.0.1) | Preview (0.6.0) | Medium (Once three months) | Module |
| AppConfiguration | |**Completed** | N/A |||GA (1.0.1) | Preview (0.6.0) | Medium (Once three months) | Module |
| Security | |Not Started | N/A |||GA (1.0.0) | Preview (0.6.0) | Medium (Once three months) | Module |
| Batch | |Not Started | N/A |||GA (14.0.0) | GA (9.0.0) | Low (Once half year) | Module |
| CognitiveServices | |Not Started | N/A ||| GA (11.0.0) | GA (6.3.0) | Low (Once half year) | Module |
57 changes: 0 additions & 57 deletions scripts/ci/test_automation.sh

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/release/debian/prepare.sh
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ override_dh_install:
${TAB}mkdir -p debian/azure-cli/opt/az
${TAB}cp -a python_env/* debian/azure-cli/opt/az
${TAB}mkdir -p debian/azure-cli/usr/bin/
${TAB}echo "\043!/usr/bin/env bash\nAZ_INSTALLER=DEB /opt/az/bin/python3 -Im azure.cli \"\044\100\"" > debian/azure-cli/usr/bin/az
${TAB}echo "\043!/usr/bin/env bash\nbin_dir=\140cd \"\044(dirname \"\044BASH_SOURCE[0]\")\"; pwd\140\nAZ_INSTALLER=DEB \"\044bin_dir\"/../../opt/az/bin/python3 -Im azure.cli \"\044\100\"" > debian/azure-cli/usr/bin/az
${TAB}chmod 0755 debian/azure-cli/usr/bin/az
${TAB}mkdir -p debian/azure-cli/etc/bash_completion.d/
${TAB}cat ${completion_script} > debian/azure-cli/etc/bash_completion.d/azure-cli
4 changes: 3 additions & 1 deletion scripts/release/rpm/azure-cli.spec
Original file line number Diff line number Diff line change
@@ -26,6 +26,8 @@ Release: %{release}
Url: https://docs.microsoft.com/cli/azure/install-azure-cli
BuildArch: x86_64
Requires: %{python_cmd}
Prefix: /usr
Prefix: /etc

BuildRequires: gcc, libffi-devel, openssl-devel, perl
BuildRequires: %{python_cmd}-devel
@@ -52,7 +54,7 @@ for d in %{buildroot}%{cli_lib_dir}/bin/*; do perl -p -i -e "s#%{buildroot}##g"
# Create executable
mkdir -p %{buildroot}%{_bindir}
python_version=$(ls %{buildroot}%{cli_lib_dir}/lib/ | head -n 1)
printf "#!/usr/bin/env bash\nAZ_INSTALLER=RPM PYTHONPATH=%{cli_lib_dir}/lib/${python_version}/site-packages /usr/bin/%{python_cmd} -sm azure.cli \"\$@\"" > %{buildroot}%{_bindir}/az
printf "#!/usr/bin/env bash\nbin_dir=\`cd \"\$(dirname \"\$BASH_SOURCE[0]\")\"; pwd\`\nAZ_INSTALLER=RPM PYTHONPATH=\"\$bin_dir\"/../%{_lib}/az/lib/${python_version}/site-packages %{python_cmd} -sm azure.cli \"\$@\"" > %{buildroot}%{_bindir}/az
rm %{buildroot}%{cli_lib_dir}/bin/python* %{buildroot}%{cli_lib_dir}/bin/pip*

# Remove unused Network SDK API versions
1 change: 1 addition & 0 deletions src/azure-cli-core/azure/cli/core/_profile.py
Original file line number Diff line number Diff line change
@@ -113,6 +113,7 @@ def _load_tokens_from_file(file_path):
raise CLIError("Failed to load token files. If you have a repro, please log an issue at "
"https://github.com/Azure/azure-cli/issues. At the same time, you can clean "
"up by running 'az account clear' and then 'az login'. (Inner Error: {})".format(ex))
logger.debug("'%s' is not a file or doesn't exist.", file_path)
return []


Loading

0 comments on commit 1e0ede2

Please sign in to comment.