Skip to content

Sync Dev and Master #2116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Based on Docker image from: https://github.com/dotnet/dotnet-docker/

ARG ASPNET_VERSION=10.0.0-preview.5.25277.114
ARG ASPNET_SHA512=6E69A85F7E18B8EEBB5F99A7E8099DB2FA5DA34BCF078BECBB123C0863D4BE7B4252C7CFC6B21B9585F4F800C058A12CAE55EF2A63B9BEA886CA3D1D8A0EC113
ARG ASPNET_VERSION=10.0.0-preview.6.25358.103
ARG ASPNET_SHA512=15ccea434f5e33b4af872bda00d30d3fee4494113a1e5d7b1e8ce206ab0a2e09384fa5a223afdde4b94ea3b7e12b796c1a45138be833288bd68741ae843fb6c8

ARG LAMBDA_RUNTIME_NAME=dotnet10
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023
Expand Down
4 changes: 2 additions & 2 deletions LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Based on Docker image from: https://github.com/dotnet/dotnet-docker/

ARG ASPNET_VERSION=10.0.0-preview.5.25277.114
ARG ASPNET_SHA512=AC99EBEC4E7ABD660A27317D37DA56AE1FA8E9EBDBF4A88FE5F9BE58E1F4D7E8F05BEC32D5E902C0FDD1E9D9E250CDB49448266682010E4CF7F4640F9699B9F1
ARG ASPNET_VERSION=10.0.0-preview.6.25358.103
ARG ASPNET_SHA512=88667d66d90aaba30649f84d10d057da7c0db479cdb36b76824dc8e0f02a44a6bf5d269d74daa0d6b78376f2dc66b60238558267555e2ced40cbd06aac745d6a

ARG LAMBDA_RUNTIME_NAME=dotnet10
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023
Expand Down
4 changes: 2 additions & 2 deletions LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Based on Docker image from: https://github.com/dotnet/dotnet-docker/

ARG ASPNET_VERSION=9.0.6
ARG ASPNET_SHA512=54c122c4c6127ce7e0f0ad0479a101db1455484c9e5bffa8fdc0dd72d2db028be86861f331f2c7c1cb2eaee9a92e741e4e5da567795533e46af27e4e481c0451
ARG ASPNET_VERSION=9.0.7
ARG ASPNET_SHA512=b175d4d0578f9f5d735d59def3f44459462ef36b4bd07d9ca0ed9853bf42d90c7bace195ff264a9dcf6dd4d6d452c87059085146268fce3540ed58eaf39629eb

ARG LAMBDA_RUNTIME_NAME=dotnet9
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023
Expand Down
4 changes: 2 additions & 2 deletions LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Based on Docker image from: https://github.com/dotnet/dotnet-docker/

ARG ASPNET_VERSION=9.0.6
ARG ASPNET_SHA512=8a7024bd144254f400c0758efd5c39854eba5d7e3187fbde2dc857cedd9012ae93aceeb1683bf6bf390cefba40c50f95cc3295a1a8eb83133a8e01b91289dfc5
ARG ASPNET_VERSION=9.0.7
ARG ASPNET_SHA512=79b28df2bc522d47bd0ea3f8b4aaa447102f92019d038670743fbbc1e6b31dd206499ff6dfc2d31623dedb64a9e2ca23608c7ea7225f1f071745de72c9f81bf4

ARG LAMBDA_RUNTIME_NAME=dotnet9
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup Condition="$(Configuration) == 'Release'">
<None Include="$(OutputPath)\publish\wwwroot\" Pack="true" PackagePath="tools\net8.0\any\wwwroot" Visible="false" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Amazon.Lambda.SQSEvents" Version="2.2.0" />
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,78 @@ public PackagingTests(ITestOutputHelper output)
_workingDirectory = DirectoryHelpers.GetTempTestAppDirectory(solutionRoot);
}

[Fact]
public void VerifyPackageContentsHasStaticAssets()
{
var projectPath = Path.Combine(_workingDirectory, "Tools", "LambdaTestTool-v2", "src", "Amazon.Lambda.TestTool", "Amazon.Lambda.TestTool.csproj");
_output.WriteLine("Packing TestTool...");
var packProcess = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "dotnet",
Arguments = $"pack -c Release --no-build --no-restore {projectPath}",
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
CreateNoWindow = true,
}
};

packProcess.Start();
string packOutput = packProcess.StandardOutput.ReadToEnd();
string packError = packProcess.StandardError.ReadToEnd();
packProcess.WaitForExit(int.MaxValue);
Copy link
Preview

Copilot AI Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using int.MaxValue as timeout could cause the test to hang indefinitely if the pack process fails. Consider using a reasonable timeout value like 30000ms (30 seconds).

Suggested change
packProcess.WaitForExit(int.MaxValue);
packProcess.WaitForExit(30000);

Copilot uses AI. Check for mistakes.


_output.WriteLine("Pack Output:");
_output.WriteLine(packOutput);
if (!string.IsNullOrEmpty(packError))
{
_output.WriteLine("Pack Errors:");
_output.WriteLine(packError);
}

Assert.Equal(0, packProcess.ExitCode);

var packageDir = Path.Combine(Path.GetDirectoryName(projectPath)!, "bin", "Release");
Copy link
Preview

Copilot AI Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The hardcoded 'Release' configuration string should be consistent with the configuration used in the pack command. Consider extracting this as a constant or variable.

Suggested change
var packageDir = Path.Combine(Path.GetDirectoryName(projectPath)!, "bin", "Release");
var packageDir = Path.Combine(Path.GetDirectoryName(projectPath)!, "bin", Configuration);

Copilot uses AI. Check for mistakes.

_output.WriteLine($"Looking for package in: {packageDir}");

var packageFiles = Directory.GetFiles(packageDir, "*.nupkg", SearchOption.AllDirectories);
Assert.True(packageFiles.Length > 0, $"No .nupkg files found in {packageDir}");

var packagePath = packageFiles[0];
_output.WriteLine($"Found package: {packagePath}");

using var archive = ZipFile.OpenRead(packagePath);

// Get all files for this framework
var frameworkFiles = archive.Entries
.Where(e => e.FullName.StartsWith($"tools/net8.0/any/wwwroot"))
.Select(e => e.FullName)
.ToList();

// Verify essential files exist
var essentialFiles = new[]
{
$"tools/net8.0/any/wwwroot/bootstrap-icons/",
$"tools/net8.0/any/wwwroot/bootstrap/",
$"tools/net8.0/any/wwwroot/_content/BlazorMonaco/"
};

var missingFiles = essentialFiles.Where(f => !frameworkFiles.Any(x => x.StartsWith(f))).ToList();

if (missingFiles.Any())
{
Assert.Fail($"The following static assets are missing:\n" +
string.Join("\n", missingFiles));
}
}

[Fact]
public void VerifyPackageContentsHasRuntimeSupport()
{
var projectPath = Path.Combine(_workingDirectory, "Tools", "LambdaTestTool-v2", "src", "Amazon.Lambda.TestTool", "Amazon.Lambda.TestTool.csproj");
var expectedFrameworks = new string[] { "net6.0", "net8.0", "net9.0" };
var expectedFrameworks = new string[] { "net6.0", "net8.0", "net9.0", "net10.0" };
_output.WriteLine("Packing TestTool...");
var packProcess = new Process
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private static void CopyDirectory(DirectoryInfo dir, string destDirName)
File.SetAttributes(tempPath, FileAttributes.Normal);
}

foreach (var subdir in dirs.Where(x => !x.Name.Equals(".git")))
foreach (var subdir in dirs.Where(x => !x.Name.Equals(".git") && !x.Name.Equals(".vs")))
{
var tempPath = Path.Combine(destDirName, subdir.Name);
var subDir = new DirectoryInfo(subdir.FullName);
Expand Down
Loading