From db0141eaebfa2bbc0e0cc4843b84be96644a2238 Mon Sep 17 00:00:00 2001 From: Phil Asmar Date: Fri, 18 Jul 2025 09:27:05 -0400 Subject: [PATCH 1/2] fix: stop copying test tool static assets manually --- .../Amazon.Lambda.TestTool.csproj | 4 -- .../PackagingTests.cs | 69 ++++++++++++++++++- .../Utilities/DirectoryHelpers.cs | 2 +- 3 files changed, 69 insertions(+), 6 deletions(-) diff --git a/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj b/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj index 546ec3a84..d8e87b598 100644 --- a/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj +++ b/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj @@ -21,10 +21,6 @@ README.md - - - - diff --git a/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/PackagingTests.cs b/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/PackagingTests.cs index 7d47bf3ab..0402506fa 100644 --- a/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/PackagingTests.cs +++ b/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/PackagingTests.cs @@ -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); + + _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"); + _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 { diff --git a/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/Utilities/DirectoryHelpers.cs b/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/Utilities/DirectoryHelpers.cs index 6599cf13d..9303cd590 100644 --- a/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/Utilities/DirectoryHelpers.cs +++ b/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/Utilities/DirectoryHelpers.cs @@ -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); From a25dadc882c0e98e1731489ff17bf3b1e87f91df Mon Sep 17 00:00:00 2001 From: aws-sdk-dotnet-automation Date: Tue, 15 Jul 2025 20:08:35 +0000 Subject: [PATCH 2/2] chore: ASP.NET Core version update in Dockerfiles --- LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile | 4 ++-- LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile | 4 ++-- LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile | 4 ++-- LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile index 897d97f88..ae8e8142d 100644 --- a/LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile @@ -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 diff --git a/LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile index 846536c84..f6fa73967 100644 --- a/LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile @@ -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 diff --git a/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile index 63ede4b5b..206096dbe 100644 --- a/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile @@ -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 diff --git a/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile index 2d9630e83..4d5a18318 100644 --- a/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile @@ -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