Skip to content

Commit 408ba3c

Browse files
committed
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python into enum-meta
* 'master' of https://github.com/Azure/azure-sdk-for-python: bump six dependencies in some libraries (#16496) call on_error if timeout in flush (#16485) Sync eng/common directory with azure-sdk-tools for PR 1365 (#16505) Fix min dependency tests - update azure core (#16504) Sync eng/common directory with azure-sdk-tools for PR 1364 (#16503) Ma arch feedback (#16502) Adding a new limitation to the README file. (#16475) [Blob][Datalake] STG76 Preview (#16349) append code coverage over each other (#16202) Arch preview feedback (#16441) Support CAE in azure-identity (#16323) [EventHubs] Support for Custom endpoint adddress and custom certificate (#16295) [Communication] - Phone Number Management - Added support for AAD auth (#16075) fix live tests (#16495)
2 parents 0770f6f + 52ff963 commit 408ba3c

File tree

199 files changed

+10895
-3457
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+10895
-3457
lines changed

.coveragerc

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ omit =
66
*/test*
77
env*
88

9+
[paths]
10+
source =
11+
sdk/
12+
**/sdk
13+
914
[report]
1015
exclude_lines =
1116
pragma: no cover

eng/ci_tools.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cryptography==3.1
33
setuptools==44.1.0; python_version == '2.7'
44
setuptools==46.4.0; python_version >= '3.5'
55
virtualenv==20.0.23
6-
wheel==0.34.2
6+
wheel==0.34.2
77
Jinja2==2.11.2
88
packaging==20.4
99
tox==3.15.0
@@ -18,6 +18,7 @@ coverage==4.5.4
1818
codecov==2.1.0
1919
beautifulsoup4==4.9.1
2020
pkginfo==1.5.0.1
21+
pip==20.2
2122

2223
# locking packages defined as deps from azure-sdk-tools or azure-devtools
2324
pytoml==0.1.21

eng/common/pipelines/templates/steps/cosmos-emulator.yml

+81-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,87 @@ steps:
99
Write-Host "Target Dir: $targetDir"
1010
msiexec /a ${{ parameters.EmulatorMsiUrl }} TARGETDIR=$targetDir /qn | wait-process
1111
displayName: Download and Extract Public Cosmos DB Emulator
12+
- powershell: |
13+
Write-Host "Deleting Cosmos DB Emulator data"
14+
if (Test-Path $Env:LOCALAPPDATA\CosmosDbEmulator) { Remove-Item -Recurse -Force $Env:LOCALAPPDATA\CosmosDbEmulator }
15+
displayName: Delete Cosmos DB Emulator data
16+
- powershell: |
17+
Write-Host "Getting Cosmos DB Emulator Version"
18+
$ProductName = "Azure Cosmos DB Emulator"
19+
$Emulator = (Join-Path $env:temp (Join-Path $ProductName "Microsoft.Azure.Cosmos.Emulator.exe"))
20+
$fileVersion = Get-ChildItem $Emulator
21+
Write-Host $Emulator $fileVersion.VersionInfo
22+
displayName: Get Cosmos DB Emulator Version
1223
- powershell: |
1324
Write-Host "Launching Cosmos DB Emulator"
14-
Import-Module "$env:temp\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator"
15-
Start-CosmosDbEmulator -NoUI ${{ parameters.StartParameters }}
25+
$ProductName = "Azure Cosmos DB Emulator"
26+
$Emulator = (Join-Path $env:temp (Join-Path $ProductName "Microsoft.Azure.Cosmos.Emulator.exe"))
27+
if (!(Test-Path $Emulator)) {
28+
Write-Error "The emulator is not installed where expected at '$Emulator'"
29+
return
30+
}
31+
$process = Start-Process $Emulator -ArgumentList "/getstatus" -PassThru -Wait
32+
switch ($process.ExitCode) {
33+
1 {
34+
Write-Host "The emulator is already starting"
35+
return
36+
}
37+
2 {
38+
Write-Host "The emulator is already running"
39+
return
40+
}
41+
3 {
42+
Write-Host "The emulator is stopped"
43+
}
44+
default {
45+
Write-Host "Unrecognized exit code $process.ExitCode"
46+
return
47+
}
48+
}
49+
$argumentList = ""
50+
if (-not [string]::IsNullOrEmpty("${{ parameters.StartParameters }}")) {
51+
$argumentList += , "${{ parameters.StartParameters }}"
52+
} else {
53+
# Use the default params if none provided
54+
$argumentList = "/noexplorer /noui /enablepreview /disableratelimiting /enableaadauthentication"
55+
}
56+
Write-Host "Starting emulator process: $Emulator $argumentList"
57+
$process=Start-Process $Emulator -ArgumentList $argumentList -ErrorAction Stop -PassThru
58+
Write-Host "Emulator process started: $($process.Name), $($process.FileVersion)"
59+
$Timeout = 600
60+
$result="NotYetStarted"
61+
$complete = if ($Timeout -gt 0) {
62+
$start = [DateTimeOffset]::Now
63+
$stop = $start.AddSeconds($Timeout)
64+
{
65+
$result -eq "Running" -or [DateTimeOffset]::Now -ge $stop
66+
}
67+
}
68+
else {
69+
{
70+
$result -eq "Running"
71+
}
72+
}
73+
do {
74+
$process = Start-Process $Emulator -ArgumentList "/getstatus" -PassThru -Wait
75+
switch ($process.ExitCode) {
76+
1 {
77+
Write-Host "The emulator is starting"
78+
}
79+
2 {
80+
Write-Host "The emulator is running"
81+
$result="Running"
82+
return
83+
}
84+
3 {
85+
Write-Host "The emulator is stopped"
86+
}
87+
default {
88+
Write-Host "Unrecognized exit code $process.ExitCode"
89+
}
90+
}
91+
Start-Sleep -Seconds 5
92+
}
93+
until ($complete.Invoke())
94+
Write-Error "The emulator failed to reach Running status within ${Timeout} seconds"
1695
displayName: Start Cosmos DB Emulator

eng/common/scripts/Create-APIReview.ps1

+7-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Param (
88
[string] $APIKey,
99
[Parameter(Mandatory=$True)]
1010
[string] $APILabel,
11-
[string] $PackageName = ""
11+
[string] $PackageName,
12+
[string] $ConfigFileDir = ""
1213
)
1314

1415

@@ -82,17 +83,19 @@ else
8283
}
8384

8485
$FoundFailure = $False
85-
$pkgInfoPath = Join-Path -Path $ArtifactPath "PackageInfo"
86+
if (-not $ConfigFileDir)
87+
{
88+
$ConfigFileDir = Join-Path -Path $ArtifactPath "PackageInfo"
89+
}
8690
foreach ($pkgName in $responses.Keys)
8791
{
8892
$respCode = $responses[$pkgName]
8993
if ($respCode -ne '200')
9094
{
91-
$pkgPropPath = Join-Path -Path $pkgInfoPath ($PackageName + ".json")
95+
$pkgPropPath = Join-Path -Path $ConfigFileDir "$PackageName.json"
9296
if (-Not (Test-Path $pkgPropPath))
9397
{
9498
Write-Host " Package property file path $($pkgPropPath) is invalid."
95-
$FoundFailure = $True
9699
}
97100
else
98101
{

eng/common/scripts/Save-Package-Properties.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if ($allPackageProperties)
1313
New-Item -ItemType Directory -Force -Path $outDirectory
1414
foreach($pkg in $allPackageProperties)
1515
{
16-
if ($pkg.IsNewSDK)
16+
if ($pkg.IsNewSdk)
1717
{
1818
Write-Host "Package Name: $($pkg.Name)"
1919
Write-Host "Package Version: $($pkg.Version)"

eng/pipelines/templates/jobs/archetype-sdk-client.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -39,31 +39,31 @@ parameters:
3939
Pool: $(LinuxPool)
4040
OSVmImage:
4141
PythonVersion: '2.7'
42-
CoverageArg: ''
42+
CoverageArg: '--disablecov'
4343
RunForPR: true
4444
Linux_Python35:
4545
Pool: $(LinuxPool)
4646
OSVmImage:
4747
PythonVersion: '3.5'
48-
CoverageArg: ''
48+
CoverageArg: '--disablecov'
4949
RunForPR: false
5050
Linux_Python38:
5151
Pool: $(LinuxPool)
5252
OSVmImage:
5353
PythonVersion: '3.8'
54-
CoverageArg: ''
54+
CoverageArg: '--disablecov'
5555
RunForPR: true
5656
Windows_Python35:
5757
Pool: $(WindowsPool)
5858
OSVmImage:
5959
PythonVersion: '3.5'
60-
CoverageArg: ''
60+
CoverageArg: '--disablecov'
6161
RunForPR: true
6262
MacOS_Python27:
6363
Pool:
6464
OSVmImage: 'macOS-10.15'
6565
PythonVersion: '2.7'
66-
CoverageArg: ''
66+
CoverageArg: '--disablecov'
6767
RunForPR: false
6868
Linux_pypy3:
6969
Pool: $(LinuxPool)
@@ -100,7 +100,7 @@ jobs:
100100

101101
steps:
102102
- template: ../steps/build-artifacts.yml
103-
parameters:
103+
parameters:
104104
ServiceDirectory: ${{ parameters.ServiceDirectory }}
105105
BuildTargetingString: ${{ parameters.BuildTargetingString }}
106106
BeforePublishSteps: ${{ parameters.BeforePublishSteps }}
@@ -133,7 +133,7 @@ jobs:
133133
CheckLinkGuidance: $true
134134

135135
- template: ../steps/analyze.yml
136-
parameters:
136+
parameters:
137137
ServiceDirectory: ${{ parameters.ServiceDirectory }}
138138
BuildTargetingString: ${{ parameters.BuildTargetingString }}
139139
TestMarkArgument: ${{ parameters.TestMarkArgument }}
@@ -168,7 +168,7 @@ jobs:
168168
${{ if or(eq(matrixEntry.value.RunForPR, 'true'), ne(variables['Build.Reason'], 'PullRequest')) }}:
169169
${{ matrixEntry.key }}:
170170
${{ insert }}: ${{ matrixEntry.value }}
171-
171+
172172
pool:
173173
name: $[coalesce(variables['Pool'], '')]
174174
vmImage: $[coalesce(variables['OSVmImage'], '')]
@@ -195,7 +195,7 @@ jobs:
195195
{
196196
$toxenvvar = '$(Run.ToxCustomEnvs)'
197197
}
198-
198+
199199
echo "##vso[task.setvariable variable=toxenv]$toxenvvar"
200200
displayName: "Set Tox Environment"
201201
@@ -211,10 +211,10 @@ jobs:
211211
ToxTestEnv: $(toxenv)
212212
ToxEnvParallel: ${{ parameters.ToxEnvParallel }}
213213
InjectedPackages: $(InjectedPackages)
214-
BeforeTestSteps:
214+
BeforeTestSteps:
215215
- task: DownloadPipelineArtifact@0
216216
inputs:
217-
artifactName: 'artifacts'
217+
artifactName: 'artifacts'
218218
targetPath: $(Build.ArtifactStagingDirectory)
219219

220220
- template: ../steps/set-dev-build.yml
@@ -237,6 +237,6 @@ jobs:
237237

238238
steps:
239239
- template: ../steps/test_regression.yml
240-
parameters:
240+
parameters:
241241
ServiceDirectory: ${{ parameters.ServiceDirectory }}
242242
BuildTargetingString: ${{ parameters.BuildTargetingString }}

eng/pipelines/templates/jobs/archetype-sdk-tests.yml

+81-45
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,85 @@
11
parameters:
2-
ServiceDirectory: ''
3-
EnvVars: {}
4-
MaxParallel: 0
5-
BeforeTestSteps: []
6-
AfterTestSteps: []
7-
BuildTargetingString: 'azure-*'
8-
AdditionalTestArgs: ''
9-
TestMarkArgument: ''
10-
InjectedPackages: ''
11-
BuildDocs: true
12-
JobName: Test
13-
AllocateResourceGroup: true
14-
DeployArmTemplate: false
15-
TestTimeoutInMinutes: 120
16-
TestSamples: false
17-
Location: ''
18-
Matrix:
19-
Linux_Python35:
20-
Pool: azsdk-pool-mms-ubuntu-1804-general
21-
OSVmImage: MMSUbuntu18.04
22-
PythonVersion: '3.5'
23-
CoverageArg: '--disablecov'
24-
MacOs_Python37:
25-
Pool: Azure Pipelines
26-
OSVmImage: 'macOS-10.15'
27-
PythonVersion: '3.7'
28-
CoverageArg: '--disablecov'
29-
Windows_Python27:
30-
Pool: azsdk-pool-mms-win-2019-general
31-
OSVmImage: MMS2019
32-
PythonVersion: '2.7'
33-
CoverageArg: '--disablecov'
34-
Linux_PyPy3:
35-
Pool: azsdk-pool-mms-ubuntu-1804-general
36-
OSVmImage: MMSUbuntu18.04
37-
PythonVersion: 'pypy3'
38-
CoverageArg: '--disablecov'
39-
Linux_Python39:
40-
Pool: azsdk-pool-mms-ubuntu-1804-general
41-
OSVmImage: MMSUbuntu18.04
42-
PythonVersion: '3.9'
43-
CoverageArg: ''
44-
CloudConfigurations:
45-
AzureCloud:
46-
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
2+
- name: ServiceDirectory
3+
type: string
4+
default: ''
5+
- name: EnvVars
6+
type: object
7+
default: {}
8+
- name: MaxParallel
9+
type: number
10+
default: 0
11+
- name: BeforeTestSteps
12+
type: object
13+
default: []
14+
- name: AfterTestSteps
15+
type: object
16+
default: []
17+
- name: BuildTargetingString
18+
type: string
19+
default: 'azure-*'
20+
- name: AdditionalTestArgs
21+
type: string
22+
default: ''
23+
- name: TestMarkArgument
24+
type: string
25+
default: ''
26+
- name: InjectedPackages
27+
type: string
28+
default: ''
29+
- name: BuildDocs
30+
type: boolean
31+
default: true
32+
- name: JobName
33+
type: string
34+
default: 'Test'
35+
- name: AllocateResourceGroup
36+
type: boolean
37+
default: true
38+
- name: DeployArmTemplate
39+
type: boolean
40+
default: false
41+
- name: TestTimeoutInMinutes
42+
type: number
43+
default: 120
44+
- name: TestSamples
45+
type: boolean
46+
default: false
47+
- name: Location
48+
type: string
49+
default: ''
50+
- name: Matrix
51+
type: object
52+
default:
53+
Linux_Python35:
54+
Pool: azsdk-pool-mms-ubuntu-1804-general
55+
OSVmImage: MMSUbuntu18.04
56+
PythonVersion: '3.5'
57+
CoverageArg: '--disablecov'
58+
MacOs_Python37:
59+
Pool: Azure Pipelines
60+
OSVmImage: 'macOS-10.15'
61+
PythonVersion: '3.7'
62+
CoverageArg: '--disablecov'
63+
Windows_Python27:
64+
Pool: azsdk-pool-mms-win-2019-general
65+
OSVmImage: MMS2019
66+
PythonVersion: '2.7'
67+
CoverageArg: '--disablecov'
68+
Linux_PyPy3:
69+
Pool: azsdk-pool-mms-ubuntu-1804-general
70+
OSVmImage: MMSUbuntu18.04
71+
PythonVersion: 'pypy3'
72+
CoverageArg: '--disablecov'
73+
Linux_Python39:
74+
Pool: azsdk-pool-mms-ubuntu-1804-general
75+
OSVmImage: MMSUbuntu18.04
76+
PythonVersion: '3.9'
77+
CoverageArg: ''
78+
- name: CloudConfigurations
79+
type: object
80+
default:
81+
AzureCloud:
82+
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
4783

4884
jobs:
4985
- ${{ each cloudConfig in parameters.CloudConfigurations }}:

0 commit comments

Comments
 (0)