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
This commit is contained in:
Francisco Gamino 2023-03-28 11:48:42 -07:00 коммит произвёл GitHub
Родитель 092e05d8dd
Коммит 8c31f217b1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 47 добавлений и 13 удалений

Просмотреть файл

@ -26,7 +26,7 @@ namespace Build
public const string TemplateJsonVersion = "3.1.1648";
public static readonly string SBOMManifestToolPath = Path.GetFullPath("../ManifestTool/Microsoft.ManifestTool.dll");
public static readonly string SrcProjectPath = Path.GetFullPath("../src/Azure.Functions.Cli/");
public static readonly string ConstantsFile = Path.Combine(SrcProjectPath, "Common", "Constants.cs");
@ -79,6 +79,43 @@ namespace Build
"win7-x64"
};
private static readonly string[] _linPowershellRuntimes = new[]
{
"linux",
"linux-x64",
"unix",
"linux-musl-x64"
};
private static readonly string[] _osxPowershellRuntimes = new[]
{
"osx",
"osx-x64",
"unix"
};
private static readonly string[] _osxARMPowershellRuntimes = new[]
{
"osx",
"osx-arm64",
"unix"
};
private static Dictionary<string, string[]> GetPowerShellRuntimes()
{
var runtimes = new Dictionary<string, string[]>
{
{ "win-x86", _winPowershellRuntimes },
{ "win-x64", _winPowershellRuntimes },
{ "win-arm64", _winPowershellRuntimes },
{ "linux-x64", _linPowershellRuntimes },
{ "osx-x64", _osxPowershellRuntimes },
{ "osx-arm64", _osxARMPowershellRuntimes }
};
return runtimes;
}
public static readonly Dictionary<string, Dictionary<string, string[]>> ToolsRuntimeToPowershellRuntimes = new Dictionary<string, Dictionary<string, string[]>>
{
{
@ -88,8 +125,8 @@ namespace Build
{ "win-x86", _winPowershellRuntimes },
{ "win-x64", _winPowershellRuntimes },
{ "win-arm64", _winPowershellRuntimes },
{ "linux-x64", new [] { "linux", "linux-x64", "unix", "linux-musl-x64" } },
{ "osx-x64", new [] { "osx", "osx-x64", "unix" } },
{ "linux-x64", _linPowershellRuntimes },
{ "osx-x64", _osxPowershellRuntimes },
// NOTE: PowerShell 7.0 does not support arm. First version supporting it is 7.2
// https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos?view=powershell-7.2#supported-versions
// 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 @@ namespace Build
},
{
"7.2",
new Dictionary<string, string[]>
{
{ "win-x86", _winPowershellRuntimes },
{ "win-x64", _winPowershellRuntimes },
{ "win-arm64", _winPowershellRuntimes },
{ "linux-x64", new [] { "linux", "linux-x64", "unix", "linux-musl-x64" } },
{ "osx-x64", new [] { "osx", "osx-x64", "unix" } },
{ "osx-arm64", new [] { "osx", "osx-arm64", "unix" } }
}
GetPowerShellRuntimes()
},
{
"7.4",
GetPowerShellRuntimes()
}
};

Просмотреть файл

@ -257,6 +257,7 @@
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="3.5.2" />
<PackageReference Include="Microsoft.Azure.Functions.PowerShellWorker.PS7.0" Version="4.0.2302" />
<PackageReference Include="Microsoft.Azure.Functions.PowerShellWorker.PS7.2" Version="4.0.2673" />
<PackageReference Include="Microsoft.Azure.Functions.PowerShellWorker.PS7.4" Version="4.0.2669" />
<PackageReference Include="Microsoft.Azure.Functions.PythonWorker" Version="4.10.1" />
</ItemGroup>
<Target Name="ExcludeWorkersFromReadyToRun">

Просмотреть файл

@ -64,7 +64,7 @@ function getHostFileContent([string]$filePath) {
$hostCsprojContent = getHostFileContent "src/WebJobs.Script/WebJobs.Script.csproj"
$pythonPropsContent = getHostFileContent "build/python.props"
$workers = "JavaWorker", "NodeJsWorker", "PowerShellWorker.PS7.0", "PowerShellWorker.PS7.2", "PythonWorker"
$workers = "JavaWorker", "NodeJsWorker", "PowerShellWorker.PS7.0", "PowerShellWorker.PS7.2", "PowerShellWorker.PS7.4", "PythonWorker"
$failedValidation = $false
foreach($worker in $workers) {