From fe279690e3df56a97271ce2cc9f1127a768eb762 Mon Sep 17 00:00:00 2001
From: sima-zhu <sizhu@microsoft.com>
Date: Tue, 26 Jul 2022 10:16:36 -0700
Subject: [PATCH 1/3] Bump MacOs version to macos-11

---
 eng/common/scripts/job-matrix/README.md            |  6 +++---
 eng/common/scripts/job-matrix/samples/matrix.json  |  2 +-
 .../tests/job-matrix-functions.filter.tests.ps1    |  2 +-
 .../tests/job-matrix-functions.tests.ps1           | 14 +++++++-------
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/eng/common/scripts/job-matrix/README.md b/eng/common/scripts/job-matrix/README.md
index b9f540e42e7d..51c57506f9ca 100644
--- a/eng/common/scripts/job-matrix/README.md
+++ b/eng/common/scripts/job-matrix/README.md
@@ -102,7 +102,7 @@ Example:
   "operatingSystem": [
     "windows-2019",
     "ubuntu-18.04",
-    "macOS-10.15"
+    "macos-11"
   ],
   "framework": [
     "net461",
@@ -380,7 +380,7 @@ In the matrix job output that azure pipelines consumes, the format is a dictiona
 {
   "net461_macOS1015": {
     "framework": "net461",
-    "operatingSystem": "macOS-10.15"
+    "operatingSystem": "macos-11"
   },
   "net50_ubuntu1804": {
     "framework": "net50",
@@ -512,7 +512,7 @@ Given a matrix like below with `JavaTestVersion` marked as a non-sparse paramete
     "Agent": {
       "windows-2019": { "OSVmImage": "MMS2019", "Pool": "azsdk-pool-mms-win-2019-general" },
       "ubuntu-1804": { "OSVmImage": "MMSUbuntu18.04", "Pool": "azsdk-pool-mms-ubuntu-1804-general" },
-      "macOS-10.15": { "OSVmImage": "macOS-10.15", "Pool": "Azure Pipelines" }
+      "macos-11": { "OSVmImage": "macos-11", "Pool": "Azure Pipelines" }
     },
     "JavaTestVersion": [ "1.8", "1.11" ],
     "AZURE_TEST_HTTP_CLIENTS": "netty",
diff --git a/eng/common/scripts/job-matrix/samples/matrix.json b/eng/common/scripts/job-matrix/samples/matrix.json
index a9e291604d07..98e1dd757f35 100644
--- a/eng/common/scripts/job-matrix/samples/matrix.json
+++ b/eng/common/scripts/job-matrix/samples/matrix.json
@@ -6,7 +6,7 @@
     "Agent": {
       "ubuntu": { "OSVmImage": "ubuntu-18.04", "Pool": "Azure Pipelines" },
       "windows": { "OSVmImage": "windows-2019", "Pool": "Azure Pipelines" },
-      "macOS": { "OSVmImage": "macOS-10.15", "Pool": "Azure Pipelines" }
+      "macOS": { "OSVmImage": "macos-11", "Pool": "Azure Pipelines" }
     },
     "TestTargetFramework": [ "netcoreapp2.1", "net461", "net5.0" ]
   },
diff --git a/eng/common/scripts/job-matrix/tests/job-matrix-functions.filter.tests.ps1 b/eng/common/scripts/job-matrix/tests/job-matrix-functions.filter.tests.ps1
index a25367bebff6..7c327eb27dd0 100644
--- a/eng/common/scripts/job-matrix/tests/job-matrix-functions.filter.tests.ps1
+++ b/eng/common/scripts/job-matrix/tests/job-matrix-functions.filter.tests.ps1
@@ -6,7 +6,7 @@ BeforeAll {
     $matrixConfig = @"
 {
     "matrix": {
-        "operatingSystem": [ "windows-2019", "ubuntu-18.04", "macOS-10.15" ],
+        "operatingSystem": [ "windows-2019", "ubuntu-18.04", "macos-11" ],
         "framework": [ "net461", "netcoreapp2.1" ],
         "additionalArguments": [ "", "mode=test" ]
     }
diff --git a/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1 b/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1
index 38b7e44429c5..747d5e5e8653 100644
--- a/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1
+++ b/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1
@@ -12,7 +12,7 @@ BeforeAll {
         "operatingSystem": [
           "windows-2019",
           "ubuntu-18.04",
-          "macOS-10.15"
+          "macos-11"
         ],
         "framework": [
           "net461",
@@ -36,11 +36,11 @@ BeforeAll {
             "framework": "net461"
         },
         {
-            "operatingSystem": "macOS-10.15",
+            "operatingSystem": "macos-11",
             "framework": "netcoreapp2.1"
         },
         {
-            "operatingSystem": ["macOS-10.15", "ubuntu-18.04"],
+            "operatingSystem": ["macos-11", "ubuntu-18.04"],
             "additionalArguments": "--enableFoo"
         }
     ]
@@ -275,7 +275,7 @@ Describe "Platform Matrix Generation" -Tag "generate" {
         "operatingSystem": [
           "windows-2019",
           "ubuntu-18.04",
-          "macOS-10.15"
+          "macos-11"
         ],
         "framework": [
           "net461",
@@ -340,7 +340,7 @@ Describe "Platform Matrix Generation" -Tag "generate" {
         $element.parameters.additionalArguments | Should -Be "--enableFoo"
 
         $element = GetNdMatrixElement @(2, 1, 1) $matrix $dimensions
-        $element.parameters.operatingSystem | Should -Be "macOS-10.15"
+        $element.parameters.operatingSystem | Should -Be "macos-11"
         $element.parameters.framework | Should -Be "netcoreapp2.1"
         $element.parameters.additionalArguments | Should -Be "--enableFoo"
     }
@@ -348,7 +348,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 = 1; name = "ubuntu1804_netcoreapp21_withfoo"; operatingSystem = "ubuntu-18.04"; framework = "netcoreapp2.1"; additionalArguments = "--enableFoo"; }
-        @{ i = 2; name = "macOS1015_net461"; operatingSystem = "macOS-10.15"; framework = "net461"; additionalArguments = ""; }
+        @{ i = 2; name = "macOS1015_net461"; operatingSystem = "macos-11"; framework = "net461"; additionalArguments = ""; }
     ) {
         $sparseMatrix = GenerateSparseMatrix $generateConfig.matrixParameters $generateConfig.displayNamesLookup
         $dimensions = GetMatrixDimensions $generateConfig.matrixParameters
@@ -442,7 +442,7 @@ Describe "Platform Matrix Post Transformation" -Tag "transform" {
 
         $matrix[4].name | Should -Be "macOS1015_net461"
         $matrix[4].parameters.framework | Should -Be "net461"
-        $matrix[4].parameters.operatingSystem | Should -Be "macOS-10.15"
+        $matrix[4].parameters.operatingSystem | Should -Be "macos-11"
         $matrix[4].parameters.additionalArguments | Should -Be ""
 
         $matrix[7].name | Should -Be "windows2019_net50_enableWindowsFoo"

From 25f00cdedf9eb4f3562495a5a95cf6915382716d Mon Sep 17 00:00:00 2001
From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com>
Date: Wed, 27 Jul 2022 15:09:05 -0700
Subject: [PATCH 2/3] Update
 eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
---
 .../scripts/job-matrix/tests/job-matrix-functions.tests.ps1     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1 b/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1
index 747d5e5e8653..8b442dc1e8f0 100644
--- a/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1
+++ b/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1
@@ -440,7 +440,7 @@ Describe "Platform Matrix Post Transformation" -Tag "transform" {
         $matrix[2].parameters.operatingSystem | Should -Be "ubuntu-18.04"
         $matrix[2].parameters.additionalArguments | Should -Be ""
 
-        $matrix[4].name | Should -Be "macOS1015_net461"
+        $matrix[4].name | Should -Be "macOS11_net461"
         $matrix[4].parameters.framework | Should -Be "net461"
         $matrix[4].parameters.operatingSystem | Should -Be "macos-11"
         $matrix[4].parameters.additionalArguments | Should -Be ""

From 7724a18d28665f5154701604e6c7a8ec5080e59a Mon Sep 17 00:00:00 2001
From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com>
Date: Wed, 27 Jul 2022 15:09:19 -0700
Subject: [PATCH 3/3] Update
 eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
---
 .../scripts/job-matrix/tests/job-matrix-functions.tests.ps1     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1 b/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1
index 8b442dc1e8f0..689ed910837b 100644
--- a/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1
+++ b/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1
@@ -348,7 +348,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 = 1; name = "ubuntu1804_netcoreapp21_withfoo"; operatingSystem = "ubuntu-18.04"; framework = "netcoreapp2.1"; additionalArguments = "--enableFoo"; }
-        @{ i = 2; name = "macOS1015_net461"; operatingSystem = "macos-11"; framework = "net461"; additionalArguments = ""; }
+        @{ i = 2; name = "macOS11_net461"; operatingSystem = "macos-11"; framework = "net461"; additionalArguments = ""; }
     ) {
         $sparseMatrix = GenerateSparseMatrix $generateConfig.matrixParameters $generateConfig.displayNamesLookup
         $dimensions = GetMatrixDimensions $generateConfig.matrixParameters