Skip to content

Commit 25145b5

Browse files
authored
Merge pull request #5 from Azure/main
Update 7/9
2 parents 23da66e + a3f454d commit 25145b5

File tree

554 files changed

+140589
-12156
lines changed

Some content is hidden

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

554 files changed

+140589
-12156
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
aiohttp==3.5.4
1+
aiohttp==3.7.4

doc/dev/debug_guide.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Debug
2+
3+
This guide is to help Python SDK users to get the process about how SDK call REST api
4+
5+
(1) Copy the following code in your .py file
6+
```
7+
import sys
8+
import logging
9+
10+
logger = logging.getLogger('')
11+
logger.setLevel(logging.DEBUG)
12+
handler = logging.StreamHandler(stream=sys.stdout, )
13+
logger.addHandler(handler)
14+
formatter = logging.Formatter(
15+
'%(asctime)s - %(name)s - %(levelname)s - %(message)s')
16+
handler.setFormatter(formatter)
17+
```
18+
19+
![Position example](./debug_guide_position.png "Position example")
20+
21+
(2) Run your .py program and you could find the log info in screen. It is convenient to get the process about how SDK call REST api:
22+
23+
![example](./debug_guide_example.png "example")

doc/dev/debug_guide_example.png

179 KB
Loading

doc/dev/debug_guide_position.png

41.4 KB
Loading

eng/ci_tools.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ pyOpenSSL==19.1.0
2727
json-delta==2.0
2828
ConfigArgParse==1.2.3
2929
six==1.14.0
30-
vcrpy==3.0.0
3130
pyyaml==5.3.1
3231
pytest==5.4.2; python_version >= '3.5'
3332
pytest==4.6.9; python_version == '2.7'

eng/common/TestResources/New-TestResources.ps1

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,26 @@ function MergeHashes([hashtable] $source, [psvariable] $dest) {
119119
}
120120
}
121121

122+
function BuildBicepFile([System.IO.FileSystemInfo] $file) {
123+
if (!(Get-Command bicep -ErrorAction Ignore)) {
124+
Write-Error "A bicep file was found at '$($file.FullName)' but the Azure Bicep CLI is not installed. See https://aka.ms/install-bicep-pwsh"
125+
throw
126+
}
127+
128+
$tmp = $env:TEMP ? $env:TEMP : [System.IO.Path]::GetTempPath()
129+
$templateFilePath = Join-Path $tmp "test-resources.$(New-Guid).compiled.json"
130+
131+
# Az can deploy bicep files natively, but by compiling here it becomes easier to parse the
132+
# outputted json for mismatched parameter declarations.
133+
bicep build $file.FullName --outfile $templateFilePath
134+
if ($LASTEXITCODE) {
135+
Write-Error "Failure building bicep file '$($file.FullName)'"
136+
throw
137+
}
138+
139+
return $templateFilePath
140+
}
141+
122142
# Support actions to invoke on exit.
123143
$exitActions = @({
124144
if ($exitActions.Count -gt 1) {
@@ -140,15 +160,18 @@ try {
140160
# Enumerate test resources to deploy. Fail if none found.
141161
$repositoryRoot = "$PSScriptRoot/../../.." | Resolve-Path
142162
$root = [System.IO.Path]::Combine($repositoryRoot, "sdk", $ServiceDirectory) | Resolve-Path
143-
$templateFileName = 'test-resources.json'
144163
$templateFiles = @()
145164

146-
Write-Verbose "Checking for '$templateFileName' files under '$root'"
147-
Get-ChildItem -Path $root -Filter $templateFileName -Recurse | ForEach-Object {
148-
$templateFile = $_.FullName
149-
150-
Write-Verbose "Found template '$templateFile'"
151-
$templateFiles += $templateFile
165+
'test-resources.json', 'test-resources.bicep' | ForEach-Object {
166+
Write-Verbose "Checking for '$_' files under '$root'"
167+
Get-ChildItem -Path $root -Filter "$_" -Recurse | ForEach-Object {
168+
Write-Verbose "Found template '$($_.FullName)'"
169+
if ($_.Extension -eq '.bicep') {
170+
$templateFiles += (BuildBicepFile $_)
171+
} else {
172+
$templateFiles += $_.FullName
173+
}
174+
}
152175
}
153176

154177
if (!$templateFiles) {
@@ -556,6 +579,11 @@ try {
556579
Log "Invoking post-deployment script '$postDeploymentScript'"
557580
&$postDeploymentScript -ResourceGroupName $ResourceGroupName -DeploymentOutputs $deploymentOutputs @PSBoundParameters
558581
}
582+
583+
if ($templateFile.EndsWith('.compiled.json')) {
584+
Write-Verbose "Removing compiled bicep file $templateFile"
585+
Remove-Item $templateFile
586+
}
559587
}
560588

561589
} finally {

eng/common/TestResources/deploy-test-resources.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,5 @@ steps:
5858
-Force `
5959
-Verbose | Out-Null
6060
displayName: Deploy test resources
61+
env:
62+
TEMP: $(Agent.TempDirectory)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ parameters:
2727
default: []
2828
- name: Pool
2929
type: string
30-
default: azsdk-pool-mms-ubuntu-1804-general
30+
default: azsdk-pool-mms-ubuntu-2004-general
3131
- name: OsVmImage
3232
type: string
33-
default: MMSUbuntu18.04
33+
default: MMSUbuntu20.04
3434
# This parameter is only necessary if there are multiple invocations of this template within the SAME STAGE.
3535
# When that occurs, provide a name other than the default value.
3636
- name: GenerateJobName

eng/common/pipelines/templates/steps/sparse-checkout.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,15 @@ steps:
3939
Write-Host "Repository $($repository.Name) has already been initialized. Skipping this step."
4040
} else {
4141
Write-Host "Repository $($repository.Name) is being initialized."
42+
43+
Write-Host "git clone --no-checkout --filter=tree:0 git://github.com/$($repository.Name) ."
4244
git clone --no-checkout --filter=tree:0 git://github.com/$($repository.Name) .
45+
46+
Write-Host "git sparse-checkout init"
4347
git sparse-checkout init
44-
git sparse-checkout set eng
48+
49+
Write-Host "git sparse-checkout set '/*' '!/*/' '/eng'"
50+
git sparse-checkout set '/*' '!/*/' '/eng'
4551
}
4652
4753
$gitsparsecmd = "git sparse-checkout add $paths"

eng/test_tools.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ pyOpenSSL==19.1.0
1818
json-delta==2.0
1919
ConfigArgParse==1.2.3
2020
six==1.14.0
21-
vcrpy==3.0.0
2221
pyyaml==5.3.1
2322
packaging==20.4
2423
wheel==0.34.2

0 commit comments

Comments
 (0)