Skip to content

Commit

Permalink
Migrate from win2019 to new pool win2022 (#4880)
Browse files Browse the repository at this point in the history
Migrate to new pool
  • Loading branch information
azure-sdk authored Dec 20, 2022
1 parent ddd82dd commit da27ddb
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 74 deletions.
2 changes: 1 addition & 1 deletion eng/common/pipelines/templates/jobs/docindex.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
jobs:
- job: CreateDocIndex
pool:
vmImage: windows-2019
vmImage: windows-2022
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.9'
Expand Down
12 changes: 6 additions & 6 deletions eng/common/scripts/job-matrix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Example:
```
"matrix": {
"operatingSystem": [
"windows-2019",
"windows-2022",
"ubuntu-18.04",
"macos-11"
],
Expand Down Expand Up @@ -386,14 +386,14 @@ In the matrix job output that azure pipelines consumes, the format is a dictiona
"framework": "net50",
"operatingSystem": "ubuntu-18.04"
},
"netcoreapp21_windows2019": {
"netcoreapp21_windows2022": {
"framework": "netcoreapp2.1",
"operatingSystem": "windows-2019"
"operatingSystem": "windows-2022"
},
"UseProjectRef_net461_windows2019": {
"UseProjectRef_net461_windows2022": {
"additionalTestArguments": "/p:UseProjectReferenceToAzureClients=true",
"framework": "net461",
"operatingSystem": "windows-2019"
"operatingSystem": "windows-2022"
}
}
```
Expand Down Expand Up @@ -510,7 +510,7 @@ Given a matrix like below with `JavaTestVersion` marked as a non-sparse paramete
{
"matrix": {
"Agent": {
"windows-2019": { "OSVmImage": "MMS2019", "Pool": "azsdk-pool-mms-win-2019-general" },
"windows-2022": { "OSVmImage": "MMS2022", "Pool": "azsdk-pool-mms-win-2022-general" },
"ubuntu-1804": { "OSVmImage": "MMSUbuntu18.04", "Pool": "azsdk-pool-mms-ubuntu-1804-general" },
"macos-11": { "OSVmImage": "macos-11", "Pool": "Azure Pipelines" }
},
Expand Down
6 changes: 3 additions & 3 deletions eng/common/scripts/job-matrix/samples/matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
"matrix": {
"Agent": {
"ubuntu": { "OSVmImage": "ubuntu-18.04", "Pool": "Azure Pipelines" },
"windows": { "OSVmImage": "windows-2019", "Pool": "Azure Pipelines" },
"windows": { "OSVmImage": "windows-2022", "Pool": "Azure Pipelines" },
"macOS": { "OSVmImage": "macos-11", "Pool": "Azure Pipelines" }
},
"TestTargetFramework": [ "netcoreapp2.1", "net461", "net5.0" ]
},
"include": [
{
"Agent": {
"windows": { "OSVmImage": "windows-2019", "Pool": "Azure Pipelines" }
"windows": { "OSVmImage": "windows-2022", "Pool": "Azure Pipelines" }
},
"TestTargetFramework": [ "net461", "net5.0" ],
"AdditionalTestArguments": "/p:UseProjectReferenceToAzureClients=true"
}
],
"exclude": [
{
"OSVmImage": "MMS2019",
"OSVmImage": "MMS2022",
"framework": "netcoreapp2.1"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ BeforeAll {
$matrixConfig = @"
{
"matrix": {
"operatingSystem": [ "windows-2019", "ubuntu-18.04", "macos-11" ],
"operatingSystem": [ "windows-2022", "ubuntu-18.04", "macos-11" ],
"framework": [ "net461", "netcoreapp2.1" ],
"additionalArguments": [ "", "mode=test" ]
}
Expand All @@ -17,8 +17,8 @@ BeforeAll {

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

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

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

It "Should handle no matrix key/value filter matches" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Describe "Platform Matrix nonSparse" -Tag "nonsparse" {
$matrixJson = @'
{
"matrix": {
"$IMPORT": "./test-import-matrix.json",
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
"TestField1": "test1"
},
"exclude": [ { "Baz": "importedBaz" } ]
Expand Down Expand Up @@ -130,7 +130,7 @@ Describe "Platform Matrix Import" -Tag "import" {
$matrixJson = @'
{
"matrix": {
"$IMPORT": "./test-import-matrix.json"
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json"
},
"include": [
{
Expand Down Expand Up @@ -173,7 +173,7 @@ Describe "Platform Matrix Import" -Tag "import" {
$matrixJson = @'
{
"matrix": {
"$IMPORT": "./test-import-matrix.json",
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
"TestField1": "test1",
"TestField2": "test2"
},
Expand Down Expand Up @@ -206,7 +206,7 @@ Describe "Platform Matrix Import" -Tag "import" {
$matrixJson = @'
{
"matrix": {
"$IMPORT": "./test-import-matrix.json",
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
"testField": [ "test1", "test2" ]
}
}
Expand Down Expand Up @@ -235,7 +235,7 @@ Describe "Platform Matrix Import" -Tag "import" {
"importedBaz": "importedBazNameOverride"
},
"matrix": {
"$IMPORT": "./test-import-matrix.json",
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
"testField": [ "test1", "test2" ]
}
}
Expand All @@ -251,7 +251,7 @@ Describe "Platform Matrix Import" -Tag "import" {
$matrixJson = @'
{
"matrix": {
"$IMPORT": "./test-import-matrix.json",
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
"testField1": [ "test11", "test12" ],
"testField2": [ "test21", "test22" ]
}
Expand Down Expand Up @@ -299,7 +299,7 @@ Describe "Platform Matrix Import" -Tag "import" {
$matrixJson = @'
{
"matrix": {
"$IMPORT": "./test-import-matrix.json",
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
"testField": [ "test1", "test2", "test3" ],
},
"include": [
Expand Down Expand Up @@ -364,7 +364,7 @@ Describe "Platform Matrix Import" -Tag "import" {
$matrixJson = @'
{
"matrix": {
"$IMPORT": "./test-import-matrix.json",
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
"Foo": [ "fooOverride1", "fooOverride2" ],
}
}
Expand Down Expand Up @@ -450,7 +450,7 @@ Describe "Platform Matrix Replace" -Tag "replace" {
$matrixJson = @'
{
"matrix": {
"$IMPORT": "./test-import-matrix.json",
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
"testField": [ "test1", "test2" ]
}
}
Expand Down Expand Up @@ -550,7 +550,7 @@ Describe "Platform Matrix Replace" -Tag "replace" {
"replaceme": ""
},
"matrix": {
"$IMPORT": "./test-import-matrix.json",
"$IMPORT": "./eng/common/scripts/job-matrix/tests/test-import-matrix.json",
"replaceme": "replaceme"
}
}
Expand Down
40 changes: 20 additions & 20 deletions eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BeforeAll {
},
"matrix": {
"operatingSystem": [
"windows-2019",
"windows-2022",
"ubuntu-18.04",
"macos-11"
],
Expand All @@ -25,14 +25,14 @@ BeforeAll {
},
"include": [
{
"operatingSystem": "windows-2019",
"operatingSystem": "windows-2022",
"framework": ["net461", "netcoreapp2.1", "net50"],
"additionalArguments": "--enableWindowsFoo"
}
],
"exclude": [
{
"operatingSystem": "windows-2019",
"operatingSystem": "windows-2022",
"framework": "net461"
},
{
Expand Down Expand Up @@ -273,7 +273,7 @@ Describe "Platform Matrix Generation" -Tag "generate" {
},
"matrix": {
"operatingSystem": [
"windows-2019",
"windows-2022",
"ubuntu-18.04",
"macos-11"
],
Expand All @@ -288,7 +288,7 @@ Describe "Platform Matrix Generation" -Tag "generate" {
},
"include": [
{
"operatingSystem": "windows-2019",
"operatingSystem": "windows-2022",
"framework": "net461",
"additionalTestArguments": "/p:UseProjectReferenceToAzureClients=true"
}
Expand All @@ -315,13 +315,13 @@ Describe "Platform Matrix Generation" -Tag "generate" {
$matrix = GenerateFullMatrix $generateConfig.matrixParameters $generateconfig.displayNamesLookup

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

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

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

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

$element = $matrix[0].parameters
$element.operatingSystem | Should -Be "windows-2019"
$element.operatingSystem | Should -Be "windows-2022"
$element.framework | Should -Be "net461"
$element.additionalArguments | Should -Be ""

Expand All @@ -346,7 +346,7 @@ Describe "Platform Matrix Generation" -Tag "generate" {
}

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

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

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

$matrix[0].name | Should -Be "windows2019_netcoreapp21"
$matrix[0].parameters.operatingSystem | Should -Be "windows-2019"
$matrix[0].name | Should -Be "windows2022_netcoreapp21"
$matrix[0].parameters.operatingSystem | Should -Be "windows-2022"
$matrix[0].parameters.framework | Should -Be "netcoreapp2.1"
$matrix[0].parameters.additionalArguments | Should -Be ""

$matrix[1].name | Should -Be "windows2019_netcoreapp21_withfoo"
$matrix[1].parameters.operatingSystem | Should -Be "windows-2019"
$matrix[1].name | Should -Be "windows2022_netcoreapp21_withfoo"
$matrix[1].parameters.operatingSystem | Should -Be "windows-2022"
$matrix[1].parameters.framework | Should -Be "netcoreapp2.1"
$matrix[1].parameters.additionalArguments | Should -Be "--enableFoo"

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

$matrix[7].name | Should -Be "windows2019_net50_enableWindowsFoo"
$matrix[7].name | Should -Be "windows2022_net50_enableWindowsFoo"
$matrix[7].parameters.framework | Should -Be "net50"
$matrix[7].parameters.operatingSystem | Should -Be "windows-2019"
$matrix[7].parameters.operatingSystem | Should -Be "windows-2022"
$matrix[7].parameters.additionalArguments | Should -Be "--enableWindowsFoo"
}

Expand All @@ -456,7 +456,7 @@ Describe "Platform Matrix Post Transformation" -Tag "transform" {
{
"include": [
{
"operatingSystem": "windows-2019",
"operatingSystem": "windows-2022",
"framework": "net461"
}
]
Expand All @@ -466,14 +466,14 @@ Describe "Platform Matrix Post Transformation" -Tag "transform" {
$config = GetMatrixConfigFromJson $matrixConfigForIncludeOnly
[Array]$matrix = GenerateMatrix $config "all"
$matrix.Length | Should -Be 1
$matrix[0].name | Should -Be "windows2019_net461"
$matrix[0].name | Should -Be "windows2022_net461"
}

It "Should parse a config with an empty include" {
$matrixConfigForIncludeOnly = @"
{
"matrix": {
"operatingSystem": "windows-2019",
"operatingSystem": "windows-2022",
"framework": "net461"
}
}
Expand All @@ -482,7 +482,7 @@ Describe "Platform Matrix Post Transformation" -Tag "transform" {
$config = GetMatrixConfigFromJson $matrixConfigForIncludeOnly
[Array]$matrix = GenerateMatrix $config "all"
$matrix.Length | Should -Be 1
$matrix[0].name | Should -Be "windows2019_net461"
$matrix[0].name | Should -Be "windows2022_net461"
}
}

Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/apiview-review-gen-swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pr: none
trigger: none

pool:
name: azsdk-pool-mms-win-2019-general
vmImage: MMS2019
name: azsdk-pool-mms-win-2022-general
vmImage: MMS2022

variables:
SwaggerParserInstallPath: $(Pipeline.Workspace)/SwaggerApiParser
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/branch-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ parameters:
jobs:
- job: CleanUp
pool:
vmImage: windows-2019
vmImage: windows-2022
variables:
- template: ./templates/variables/globals.yml
steps:
Expand Down
Loading

0 comments on commit da27ddb

Please sign in to comment.