Skip to content

Commit 8c31f21

Browse files
Add PowerShell 7.4 language worker for integration testing (#3270)
* Add PowerShell 7.4 language worker * Filter runtimes for PowerShell 7.4 * Add PowerShell 7.4 to the list of workers to validate
1 parent 092e05d commit 8c31f21

File tree

3 files changed

+47
-13
lines changed

3 files changed

+47
-13
lines changed

build/Settings.cs

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ private static string config(string @default = null, [CallerMemberName] string k
2626
public const string TemplateJsonVersion = "3.1.1648";
2727

2828
public static readonly string SBOMManifestToolPath = Path.GetFullPath("../ManifestTool/Microsoft.ManifestTool.dll");
29-
29+
3030
public static readonly string SrcProjectPath = Path.GetFullPath("../src/Azure.Functions.Cli/");
3131

3232
public static readonly string ConstantsFile = Path.Combine(SrcProjectPath, "Common", "Constants.cs");
@@ -79,6 +79,43 @@ private static string config(string @default = null, [CallerMemberName] string k
7979
"win7-x64"
8080
};
8181

82+
private static readonly string[] _linPowershellRuntimes = new[]
83+
{
84+
"linux",
85+
"linux-x64",
86+
"unix",
87+
"linux-musl-x64"
88+
};
89+
90+
private static readonly string[] _osxPowershellRuntimes = new[]
91+
{
92+
"osx",
93+
"osx-x64",
94+
"unix"
95+
};
96+
97+
private static readonly string[] _osxARMPowershellRuntimes = new[]
98+
{
99+
"osx",
100+
"osx-arm64",
101+
"unix"
102+
};
103+
104+
private static Dictionary<string, string[]> GetPowerShellRuntimes()
105+
{
106+
var runtimes = new Dictionary<string, string[]>
107+
{
108+
{ "win-x86", _winPowershellRuntimes },
109+
{ "win-x64", _winPowershellRuntimes },
110+
{ "win-arm64", _winPowershellRuntimes },
111+
{ "linux-x64", _linPowershellRuntimes },
112+
{ "osx-x64", _osxPowershellRuntimes },
113+
{ "osx-arm64", _osxARMPowershellRuntimes }
114+
};
115+
116+
return runtimes;
117+
}
118+
82119
public static readonly Dictionary<string, Dictionary<string, string[]>> ToolsRuntimeToPowershellRuntimes = new Dictionary<string, Dictionary<string, string[]>>
83120
{
84121
{
@@ -88,8 +125,8 @@ private static string config(string @default = null, [CallerMemberName] string k
88125
{ "win-x86", _winPowershellRuntimes },
89126
{ "win-x64", _winPowershellRuntimes },
90127
{ "win-arm64", _winPowershellRuntimes },
91-
{ "linux-x64", new [] { "linux", "linux-x64", "unix", "linux-musl-x64" } },
92-
{ "osx-x64", new [] { "osx", "osx-x64", "unix" } },
128+
{ "linux-x64", _linPowershellRuntimes },
129+
{ "osx-x64", _osxPowershellRuntimes },
93130
// NOTE: PowerShell 7.0 does not support arm. First version supporting it is 7.2
94131
// https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos?view=powershell-7.2#supported-versions
95132
// That being said, we might as well include "osx" and "unix" since it'll hardly affect package size and should lead to more accurate error messages
@@ -98,15 +135,11 @@ private static string config(string @default = null, [CallerMemberName] string k
98135
},
99136
{
100137
"7.2",
101-
new Dictionary<string, string[]>
102-
{
103-
{ "win-x86", _winPowershellRuntimes },
104-
{ "win-x64", _winPowershellRuntimes },
105-
{ "win-arm64", _winPowershellRuntimes },
106-
{ "linux-x64", new [] { "linux", "linux-x64", "unix", "linux-musl-x64" } },
107-
{ "osx-x64", new [] { "osx", "osx-x64", "unix" } },
108-
{ "osx-arm64", new [] { "osx", "osx-arm64", "unix" } }
109-
}
138+
GetPowerShellRuntimes()
139+
},
140+
{
141+
"7.4",
142+
GetPowerShellRuntimes()
110143
}
111144
};
112145

src/Azure.Functions.Cli/Azure.Functions.Cli.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@
257257
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="3.5.2" />
258258
<PackageReference Include="Microsoft.Azure.Functions.PowerShellWorker.PS7.0" Version="4.0.2302" />
259259
<PackageReference Include="Microsoft.Azure.Functions.PowerShellWorker.PS7.2" Version="4.0.2673" />
260+
<PackageReference Include="Microsoft.Azure.Functions.PowerShellWorker.PS7.4" Version="4.0.2669" />
260261
<PackageReference Include="Microsoft.Azure.Functions.PythonWorker" Version="4.10.1" />
261262
</ItemGroup>
262263
<Target Name="ExcludeWorkersFromReadyToRun">

validateWorkerVersions.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function getHostFileContent([string]$filePath) {
6464
$hostCsprojContent = getHostFileContent "src/WebJobs.Script/WebJobs.Script.csproj"
6565
$pythonPropsContent = getHostFileContent "build/python.props"
6666

67-
$workers = "JavaWorker", "NodeJsWorker", "PowerShellWorker.PS7.0", "PowerShellWorker.PS7.2", "PythonWorker"
67+
$workers = "JavaWorker", "NodeJsWorker", "PowerShellWorker.PS7.0", "PowerShellWorker.PS7.2", "PowerShellWorker.PS7.4", "PythonWorker"
6868

6969
$failedValidation = $false
7070
foreach($worker in $workers) {

0 commit comments

Comments
 (0)