Skip to content

Commit 998aecd

Browse files
azure-sdksima-zhu
andauthored
Sync eng/common directory with azure-sdk-tools for PR 4880 (Azure#24279)
* Migrate from Win-2019 image to Win-2022 image * Update perf.yml * fixed tests Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Co-authored-by: sima-zhu <sizhu@microsoft.com>
1 parent 93edd75 commit 998aecd

File tree

6 files changed

+51
-51
lines changed

6 files changed

+51
-51
lines changed

eng/common/pipelines/templates/jobs/docindex.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
jobs:
22
- job: CreateDocIndex
33
pool:
4-
vmImage: windows-2019
4+
vmImage: windows-2022
55
steps:
66
- task: UsePythonVersion@0
77
displayName: 'Use Python 3.9'

eng/common/scripts/job-matrix/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Example:
100100
```
101101
"matrix": {
102102
"operatingSystem": [
103-
"windows-2019",
103+
"windows-2022",
104104
"ubuntu-18.04",
105105
"macos-11"
106106
],
@@ -386,14 +386,14 @@ In the matrix job output that azure pipelines consumes, the format is a dictiona
386386
"framework": "net50",
387387
"operatingSystem": "ubuntu-18.04"
388388
},
389-
"netcoreapp21_windows2019": {
389+
"netcoreapp21_windows2022": {
390390
"framework": "netcoreapp2.1",
391-
"operatingSystem": "windows-2019"
391+
"operatingSystem": "windows-2022"
392392
},
393-
"UseProjectRef_net461_windows2019": {
393+
"UseProjectRef_net461_windows2022": {
394394
"additionalTestArguments": "/p:UseProjectReferenceToAzureClients=true",
395395
"framework": "net461",
396-
"operatingSystem": "windows-2019"
396+
"operatingSystem": "windows-2022"
397397
}
398398
}
399399
```
@@ -510,7 +510,7 @@ Given a matrix like below with `JavaTestVersion` marked as a non-sparse paramete
510510
{
511511
"matrix": {
512512
"Agent": {
513-
"windows-2019": { "OSVmImage": "MMS2019", "Pool": "azsdk-pool-mms-win-2019-general" },
513+
"windows-2022": { "OSVmImage": "MMS2022", "Pool": "azsdk-pool-mms-win-2022-general" },
514514
"ubuntu-1804": { "OSVmImage": "MMSUbuntu18.04", "Pool": "azsdk-pool-mms-ubuntu-1804-general" },
515515
"macos-11": { "OSVmImage": "macos-11", "Pool": "Azure Pipelines" }
516516
},

eng/common/scripts/job-matrix/samples/matrix.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
"matrix": {
66
"Agent": {
77
"ubuntu": { "OSVmImage": "ubuntu-18.04", "Pool": "Azure Pipelines" },
8-
"windows": { "OSVmImage": "windows-2019", "Pool": "Azure Pipelines" },
8+
"windows": { "OSVmImage": "windows-2022", "Pool": "Azure Pipelines" },
99
"macOS": { "OSVmImage": "macos-11", "Pool": "Azure Pipelines" }
1010
},
1111
"TestTargetFramework": [ "netcoreapp2.1", "net461", "net5.0" ]
1212
},
1313
"include": [
1414
{
1515
"Agent": {
16-
"windows": { "OSVmImage": "windows-2019", "Pool": "Azure Pipelines" }
16+
"windows": { "OSVmImage": "windows-2022", "Pool": "Azure Pipelines" }
1717
},
1818
"TestTargetFramework": [ "net461", "net5.0" ],
1919
"AdditionalTestArguments": "/p:UseProjectReferenceToAzureClients=true"
2020
}
2121
],
2222
"exclude": [
2323
{
24-
"OSVmImage": "MMS2019",
24+
"OSVmImage": "MMS2022",
2525
"framework": "netcoreapp2.1"
2626
}
2727
]

eng/common/scripts/job-matrix/tests/job-matrix-functions.filter.tests.ps1

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ BeforeAll {
66
$matrixConfig = @"
77
{
88
"matrix": {
9-
"operatingSystem": [ "windows-2019", "ubuntu-18.04", "macos-11" ],
9+
"operatingSystem": [ "windows-2022", "ubuntu-18.04", "macos-11" ],
1010
"framework": [ "net461", "netcoreapp2.1" ],
1111
"additionalArguments": [ "", "mode=test" ]
1212
}
@@ -17,8 +17,8 @@ BeforeAll {
1717

1818
Describe "Matrix Filter" -Tag "filter" {
1919
It "Should filter by matrix display name" -TestCases @(
20-
@{ regex = "windows.*"; expectedFirst = "windows2019_net461"; length = 4 }
21-
@{ regex = "windows2019_netcoreapp21_modetest"; expectedFirst = "windows2019_netcoreapp21_modetest"; length = 1 }
20+
@{ regex = "windows.*"; expectedFirst = "windows2022_net461"; length = 4 }
21+
@{ regex = "windows2022_netcoreapp21_modetest"; expectedFirst = "windows2022_netcoreapp21_modetest"; length = 1 }
2222
@{ regex = ".*ubuntu.*"; expectedFirst = "ubuntu1804_net461"; length = 4 }
2323
) {
2424
[array]$matrix = GenerateMatrix $config "all" $regex
@@ -33,20 +33,20 @@ Describe "Matrix Filter" -Tag "filter" {
3333
}
3434

3535
It "Should filter by matrix key/value" -TestCases @(
36-
@{ filterString = "operatingSystem=windows.*"; expectedFirst = "windows2019_net461"; length = 4 }
37-
@{ filterString = "operatingSystem=windows-2019"; expectedFirst = "windows2019_net461"; length = 4 }
38-
@{ filterString = "framework=.*"; expectedFirst = "windows2019_net461"; length = 12 }
39-
@{ filterString = "additionalArguments=mode=test"; expectedFirst = "windows2019_net461_modetest"; length = 6 }
40-
@{ filterString = "additionalArguments=^$"; expectedFirst = "windows2019_net461"; length = 6 }
36+
@{ filterString = "operatingSystem=windows.*"; expectedFirst = "windows2022_net461"; length = 4 }
37+
@{ filterString = "operatingSystem=windows-2022"; expectedFirst = "windows2022_net461"; length = 4 }
38+
@{ filterString = "framework=.*"; expectedFirst = "windows2022_net461"; length = 12 }
39+
@{ filterString = "additionalArguments=mode=test"; expectedFirst = "windows2022_net461_modetest"; length = 6 }
40+
@{ filterString = "additionalArguments=^$"; expectedFirst = "windows2022_net461"; length = 6 }
4141
) {
4242
[array]$matrix = GenerateMatrix $config "all" -filters @($filterString)
4343
$matrix.Length | Should -Be $length
4444
$matrix[0].Name | Should -Be $expectedFirst
4545
}
4646

4747
It "Should filter by optional matrix key/value" -TestCases @(
48-
@{ filterString = "operatingSystem=^$|windows.*"; expectedFirst = "windows2019_net461"; length = 4 }
49-
@{ filterString = "doesnotexist=^$|.*"; expectedFirst = "windows2019_net461"; length = 12 }
48+
@{ filterString = "operatingSystem=^$|windows.*"; expectedFirst = "windows2022_net461"; length = 4 }
49+
@{ filterString = "doesnotexist=^$|.*"; expectedFirst = "windows2022_net461"; length = 12 }
5050
) {
5151
[array]$matrix = GenerateMatrix $config "all" -filters @($filterString)
5252
$matrix.Length | Should -Be $length
@@ -56,7 +56,7 @@ Describe "Matrix Filter" -Tag "filter" {
5656
It "Should handle multiple matrix key/value filters " {
5757
[array]$matrix = GenerateMatrix $config "all" -filters "operatingSystem=windows.*","framework=.*","additionalArguments=mode=test"
5858
$matrix.Length | Should -Be 2
59-
$matrix[0].Name | Should -Be "windows2019_net461_modetest"
59+
$matrix[0].Name | Should -Be "windows2022_net461_modetest"
6060
}
6161

6262
It "Should handle no matrix key/value filter matches" {

eng/common/scripts/job-matrix/tests/job-matrix-functions.modification.tests.ps1

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Describe "Platform Matrix nonSparse" -Tag "nonsparse" {
8888
$matrixJson = @'
8989
{
9090
"matrix": {
91-
"$IMPORT": "./test-import-matrix.json",
91+
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
9292
"TestField1": "test1"
9393
},
9494
"exclude": [ { "Baz": "importedBaz" } ]
@@ -130,7 +130,7 @@ Describe "Platform Matrix Import" -Tag "import" {
130130
$matrixJson = @'
131131
{
132132
"matrix": {
133-
"$IMPORT": "./test-import-matrix.json"
133+
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json"
134134
},
135135
"include": [
136136
{
@@ -173,7 +173,7 @@ Describe "Platform Matrix Import" -Tag "import" {
173173
$matrixJson = @'
174174
{
175175
"matrix": {
176-
"$IMPORT": "./test-import-matrix.json",
176+
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
177177
"TestField1": "test1",
178178
"TestField2": "test2"
179179
},
@@ -206,7 +206,7 @@ Describe "Platform Matrix Import" -Tag "import" {
206206
$matrixJson = @'
207207
{
208208
"matrix": {
209-
"$IMPORT": "./test-import-matrix.json",
209+
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
210210
"testField": [ "test1", "test2" ]
211211
}
212212
}
@@ -235,7 +235,7 @@ Describe "Platform Matrix Import" -Tag "import" {
235235
"importedBaz": "importedBazNameOverride"
236236
},
237237
"matrix": {
238-
"$IMPORT": "./test-import-matrix.json",
238+
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
239239
"testField": [ "test1", "test2" ]
240240
}
241241
}
@@ -251,7 +251,7 @@ Describe "Platform Matrix Import" -Tag "import" {
251251
$matrixJson = @'
252252
{
253253
"matrix": {
254-
"$IMPORT": "./test-import-matrix.json",
254+
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
255255
"testField1": [ "test11", "test12" ],
256256
"testField2": [ "test21", "test22" ]
257257
}
@@ -299,7 +299,7 @@ Describe "Platform Matrix Import" -Tag "import" {
299299
$matrixJson = @'
300300
{
301301
"matrix": {
302-
"$IMPORT": "./test-import-matrix.json",
302+
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
303303
"testField": [ "test1", "test2", "test3" ],
304304
},
305305
"include": [
@@ -364,7 +364,7 @@ Describe "Platform Matrix Import" -Tag "import" {
364364
$matrixJson = @'
365365
{
366366
"matrix": {
367-
"$IMPORT": "./test-import-matrix.json",
367+
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
368368
"Foo": [ "fooOverride1", "fooOverride2" ],
369369
}
370370
}
@@ -450,7 +450,7 @@ Describe "Platform Matrix Replace" -Tag "replace" {
450450
$matrixJson = @'
451451
{
452452
"matrix": {
453-
"$IMPORT": "./test-import-matrix.json",
453+
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
454454
"testField": [ "test1", "test2" ]
455455
}
456456
}
@@ -550,7 +550,7 @@ Describe "Platform Matrix Replace" -Tag "replace" {
550550
"replaceme": ""
551551
},
552552
"matrix": {
553-
"$IMPORT": "./test-import-matrix.json",
553+
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
554554
"replaceme": "replaceme"
555555
}
556556
}

eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ BeforeAll {
1010
},
1111
"matrix": {
1212
"operatingSystem": [
13-
"windows-2019",
13+
"windows-2022",
1414
"ubuntu-18.04",
1515
"macos-11"
1616
],
@@ -25,14 +25,14 @@ BeforeAll {
2525
},
2626
"include": [
2727
{
28-
"operatingSystem": "windows-2019",
28+
"operatingSystem": "windows-2022",
2929
"framework": ["net461", "netcoreapp2.1", "net50"],
3030
"additionalArguments": "--enableWindowsFoo"
3131
}
3232
],
3333
"exclude": [
3434
{
35-
"operatingSystem": "windows-2019",
35+
"operatingSystem": "windows-2022",
3636
"framework": "net461"
3737
},
3838
{
@@ -273,7 +273,7 @@ Describe "Platform Matrix Generation" -Tag "generate" {
273273
},
274274
"matrix": {
275275
"operatingSystem": [
276-
"windows-2019",
276+
"windows-2022",
277277
"ubuntu-18.04",
278278
"macos-11"
279279
],
@@ -288,7 +288,7 @@ Describe "Platform Matrix Generation" -Tag "generate" {
288288
},
289289
"include": [
290290
{
291-
"operatingSystem": "windows-2019",
291+
"operatingSystem": "windows-2022",
292292
"framework": "net461",
293293
"additionalTestArguments": "/p:UseProjectReferenceToAzureClients=true"
294294
}
@@ -315,13 +315,13 @@ Describe "Platform Matrix Generation" -Tag "generate" {
315315
$matrix = GenerateFullMatrix $generateConfig.matrixParameters $generateconfig.displayNamesLookup
316316

317317
$element = GetNdMatrixElement @(0, 0, 0) $matrix $dimensions
318-
$element.name | Should -Be "windows2019_net461"
318+
$element.name | Should -Be "windows2022_net461"
319319

320320
$element = GetNdMatrixElement @(1, 1, 1) $matrix $dimensions
321321
$element.name | Should -Be "ubuntu1804_netcoreapp21_withFoo"
322322

323323
$element = GetNdMatrixElement @(2, 1, 1) $matrix $dimensions
324-
$element.name | Should -Be "macOS1015_netcoreapp21_withFoo"
324+
$element.name | Should -Be "macOS11_netcoreapp21_withFoo"
325325
}
326326

327327
It "Should initialize an N-dimensional matrix from all parameter permutations" {
@@ -330,7 +330,7 @@ Describe "Platform Matrix Generation" -Tag "generate" {
330330
$matrix.Count | Should -Be 12
331331

332332
$element = $matrix[0].parameters
333-
$element.operatingSystem | Should -Be "windows-2019"
333+
$element.operatingSystem | Should -Be "windows-2022"
334334
$element.framework | Should -Be "net461"
335335
$element.additionalArguments | Should -Be ""
336336

@@ -346,7 +346,7 @@ Describe "Platform Matrix Generation" -Tag "generate" {
346346
}
347347

348348
It "Should initialize a sparse matrix from an N-dimensional matrix" -TestCases @(
349-
@{ i = 0; name = "windows2019_net461"; operatingSystem = "windows-2019"; framework = "net461"; additionalArguments = ""; }
349+
@{ i = 0; name = "windows2022_net461"; operatingSystem = "windows-2022"; framework = "net461"; additionalArguments = ""; }
350350
@{ i = 1; name = "ubuntu1804_netcoreapp21_withfoo"; operatingSystem = "ubuntu-18.04"; framework = "netcoreapp2.1"; additionalArguments = "--enableFoo"; }
351351
@{ i = 2; name = "macOS11_net461"; operatingSystem = "macos-11"; framework = "net461"; additionalArguments = ""; }
352352
) {
@@ -380,7 +380,7 @@ Describe "Config File Object Conversion" -Tag "convert" {
380380

381381
It "Should convert a matrix config" {
382382
$config.matrixParameters[0].Name | Should -Be "operatingSystem"
383-
$config.matrixParameters[0].Flatten()[0].Value | Should -Be "windows-2019"
383+
$config.matrixParameters[0].Flatten()[0].Value | Should -Be "windows-2022"
384384

385385
$config.displayNamesLookup | Should -BeOfType [Hashtable]
386386
$config.displayNamesLookup["--enableFoo"] | Should -Be "withFoo"
@@ -425,13 +425,13 @@ Describe "Platform Matrix Post Transformation" -Tag "transform" {
425425
[Array]$matrix = GenerateMatrix $config "all"
426426
$matrix.Length | Should -Be 8
427427

428-
$matrix[0].name | Should -Be "windows2019_netcoreapp21"
429-
$matrix[0].parameters.operatingSystem | Should -Be "windows-2019"
428+
$matrix[0].name | Should -Be "windows2022_netcoreapp21"
429+
$matrix[0].parameters.operatingSystem | Should -Be "windows-2022"
430430
$matrix[0].parameters.framework | Should -Be "netcoreapp2.1"
431431
$matrix[0].parameters.additionalArguments | Should -Be ""
432432

433-
$matrix[1].name | Should -Be "windows2019_netcoreapp21_withfoo"
434-
$matrix[1].parameters.operatingSystem | Should -Be "windows-2019"
433+
$matrix[1].name | Should -Be "windows2022_netcoreapp21_withfoo"
434+
$matrix[1].parameters.operatingSystem | Should -Be "windows-2022"
435435
$matrix[1].parameters.framework | Should -Be "netcoreapp2.1"
436436
$matrix[1].parameters.additionalArguments | Should -Be "--enableFoo"
437437

@@ -445,9 +445,9 @@ Describe "Platform Matrix Post Transformation" -Tag "transform" {
445445
$matrix[4].parameters.operatingSystem | Should -Be "macos-11"
446446
$matrix[4].parameters.additionalArguments | Should -Be ""
447447

448-
$matrix[7].name | Should -Be "windows2019_net50_enableWindowsFoo"
448+
$matrix[7].name | Should -Be "windows2022_net50_enableWindowsFoo"
449449
$matrix[7].parameters.framework | Should -Be "net50"
450-
$matrix[7].parameters.operatingSystem | Should -Be "windows-2019"
450+
$matrix[7].parameters.operatingSystem | Should -Be "windows-2022"
451451
$matrix[7].parameters.additionalArguments | Should -Be "--enableWindowsFoo"
452452
}
453453

@@ -456,7 +456,7 @@ Describe "Platform Matrix Post Transformation" -Tag "transform" {
456456
{
457457
"include": [
458458
{
459-
"operatingSystem": "windows-2019",
459+
"operatingSystem": "windows-2022",
460460
"framework": "net461"
461461
}
462462
]
@@ -466,14 +466,14 @@ Describe "Platform Matrix Post Transformation" -Tag "transform" {
466466
$config = GetMatrixConfigFromJson $matrixConfigForIncludeOnly
467467
[Array]$matrix = GenerateMatrix $config "all"
468468
$matrix.Length | Should -Be 1
469-
$matrix[0].name | Should -Be "windows2019_net461"
469+
$matrix[0].name | Should -Be "windows2022_net461"
470470
}
471471

472472
It "Should parse a config with an empty include" {
473473
$matrixConfigForIncludeOnly = @"
474474
{
475475
"matrix": {
476-
"operatingSystem": "windows-2019",
476+
"operatingSystem": "windows-2022",
477477
"framework": "net461"
478478
}
479479
}
@@ -482,7 +482,7 @@ Describe "Platform Matrix Post Transformation" -Tag "transform" {
482482
$config = GetMatrixConfigFromJson $matrixConfigForIncludeOnly
483483
[Array]$matrix = GenerateMatrix $config "all"
484484
$matrix.Length | Should -Be 1
485-
$matrix[0].name | Should -Be "windows2019_net461"
485+
$matrix[0].name | Should -Be "windows2022_net461"
486486
}
487487
}
488488

0 commit comments

Comments
 (0)