Skip to content

chore: fix errors in the test tool pipeline #1936

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
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 4 additions & 0 deletions .autover/autover.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@
{
"Name": "SnapshotRestore.Registry",
"Path": "Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj"
},
{
"Name": "Amazon.Lambda.TestTool",
"Path": "Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj"
}
],
"UseCommitsForChangelog": false,
Expand Down
75 changes: 39 additions & 36 deletions Tools/LambdaTestTool-v2/Amazon.Lambda.TestTool.sln
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.12.35527.113
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Amazon.Lambda.TestTool", "src\Amazon.Lambda.TestTool\Amazon.Lambda.TestTool.csproj", "{97EE2E8A-D1F4-CB11-B664-B99B036E9F7B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0AB3BF05-4346-4AA6-1389-037BE0695223}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Amazon.Lambda.TestTool.Tests.Common", "tests\Amazon.Lambda.TestTool.Tests.Common\Amazon.Lambda.TestTool.Tests.Common.csproj", "{E4D6D10C-C65F-E5E7-F865-FA931477FBCC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Amazon.Lambda.TestTool.UnitTests", "tests\Amazon.Lambda.TestTool.UnitTests\Amazon.Lambda.TestTool.UnitTests.csproj", "{80A4F809-28B7-61EC-6539-DF3C7A0733FD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Amazon.Lambda.TestTool.IntegrationTests", "tests\Amazon.Lambda.TestTool.IntegrationTests\Amazon.Lambda.TestTool.IntegrationTests.csproj", "{5C1B3E1C-DFEA-425B-8ED2-BB43BAECC3CB}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Amazon.Lambda.TestTool.IntegrationTests", "tests\Amazon.Lambda.TestTool.IntegrationTests\Amazon.Lambda.TestTool.IntegrationTests.csproj", "{F7B6DF0E-EEB2-4B3F-47B7-49B188A2A216}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambdaTestFunctionV2", "testapps\LambdaTestFunctionV2\LambdaTestFunctionV2.csproj", "{803C76E6-8804-A4DF-8896-DDBC9FBEE8DD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambdaTestFunctionV2", "tests\LambdaTestFunctionV2\src\LambdaTestFunctionV2\LambdaTestFunctionV2.csproj", "{C446785B-BC47-4513-B37D-0C4976D6C396}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambdaBinaryFunction", "testapps\LambdaBinaryFunction\LambdaBinaryFunction.csproj", "{F625BA55-B999-6F5D-4DA1-9D4C77996D6A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambdaBinaryFunction", "tests\LambdaBinaryFunction\src\LambdaBinaryFunction\LambdaBinaryFunction.csproj", "{457F786A-1537-4003-8D9E-FAD0A8773437}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambdaReturnStringFunction", "testapps\LambdaReturnStringFunction\LambdaReturnStringFunction.csproj", "{54F64435-2082-3F4E-D3A8-B90BE58EF2EB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambdaReturnStringFunction", "tests\LambdaReturnStringFunction\src\LambdaReturnStringFunction\LambdaReturnStringFunction.csproj", "{FADCD9E4-A5C0-4127-AA1D-EFB9833DFF5D}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambdaTestFunctionV1", "testapps\LambdaTestFunctionV1\LambdaTestFunctionV1.csproj", "{B532EEC5-2AA9-88BA-8D0B-46ECC392791A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambdaTestFunctionV1", "tests\LambdaTestFunctionV1\src\LambdaTestFunctionV1\LambdaTestFunctionV1.csproj", "{5B8A3222-1C8E-4796-B6C6-9EE1480CC920}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "testapps", "testapps", "{4553EF99-1D3C-14C7-0D22-5364D18C373B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -31,41 +32,43 @@ Global
{97EE2E8A-D1F4-CB11-B664-B99B036E9F7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97EE2E8A-D1F4-CB11-B664-B99B036E9F7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97EE2E8A-D1F4-CB11-B664-B99B036E9F7B}.Release|Any CPU.Build.0 = Release|Any CPU
{E4D6D10C-C65F-E5E7-F865-FA931477FBCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E4D6D10C-C65F-E5E7-F865-FA931477FBCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E4D6D10C-C65F-E5E7-F865-FA931477FBCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E4D6D10C-C65F-E5E7-F865-FA931477FBCC}.Release|Any CPU.Build.0 = Release|Any CPU
{80A4F809-28B7-61EC-6539-DF3C7A0733FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80A4F809-28B7-61EC-6539-DF3C7A0733FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80A4F809-28B7-61EC-6539-DF3C7A0733FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80A4F809-28B7-61EC-6539-DF3C7A0733FD}.Release|Any CPU.Build.0 = Release|Any CPU
{5C1B3E1C-DFEA-425B-8ED2-BB43BAECC3CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5C1B3E1C-DFEA-425B-8ED2-BB43BAECC3CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5C1B3E1C-DFEA-425B-8ED2-BB43BAECC3CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5C1B3E1C-DFEA-425B-8ED2-BB43BAECC3CB}.Release|Any CPU.Build.0 = Release|Any CPU
{C446785B-BC47-4513-B37D-0C4976D6C396}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C446785B-BC47-4513-B37D-0C4976D6C396}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C446785B-BC47-4513-B37D-0C4976D6C396}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C446785B-BC47-4513-B37D-0C4976D6C396}.Release|Any CPU.Build.0 = Release|Any CPU
{457F786A-1537-4003-8D9E-FAD0A8773437}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{457F786A-1537-4003-8D9E-FAD0A8773437}.Debug|Any CPU.Build.0 = Debug|Any CPU
{457F786A-1537-4003-8D9E-FAD0A8773437}.Release|Any CPU.ActiveCfg = Release|Any CPU
{457F786A-1537-4003-8D9E-FAD0A8773437}.Release|Any CPU.Build.0 = Release|Any CPU
{FADCD9E4-A5C0-4127-AA1D-EFB9833DFF5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FADCD9E4-A5C0-4127-AA1D-EFB9833DFF5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FADCD9E4-A5C0-4127-AA1D-EFB9833DFF5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FADCD9E4-A5C0-4127-AA1D-EFB9833DFF5D}.Release|Any CPU.Build.0 = Release|Any CPU
{5B8A3222-1C8E-4796-B6C6-9EE1480CC920}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B8A3222-1C8E-4796-B6C6-9EE1480CC920}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B8A3222-1C8E-4796-B6C6-9EE1480CC920}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B8A3222-1C8E-4796-B6C6-9EE1480CC920}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
{F7B6DF0E-EEB2-4B3F-47B7-49B188A2A216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F7B6DF0E-EEB2-4B3F-47B7-49B188A2A216}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7B6DF0E-EEB2-4B3F-47B7-49B188A2A216}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7B6DF0E-EEB2-4B3F-47B7-49B188A2A216}.Release|Any CPU.Build.0 = Release|Any CPU
{803C76E6-8804-A4DF-8896-DDBC9FBEE8DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{803C76E6-8804-A4DF-8896-DDBC9FBEE8DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{803C76E6-8804-A4DF-8896-DDBC9FBEE8DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{803C76E6-8804-A4DF-8896-DDBC9FBEE8DD}.Release|Any CPU.Build.0 = Release|Any CPU
{F625BA55-B999-6F5D-4DA1-9D4C77996D6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F625BA55-B999-6F5D-4DA1-9D4C77996D6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F625BA55-B999-6F5D-4DA1-9D4C77996D6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F625BA55-B999-6F5D-4DA1-9D4C77996D6A}.Release|Any CPU.Build.0 = Release|Any CPU
{54F64435-2082-3F4E-D3A8-B90BE58EF2EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{54F64435-2082-3F4E-D3A8-B90BE58EF2EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{54F64435-2082-3F4E-D3A8-B90BE58EF2EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{54F64435-2082-3F4E-D3A8-B90BE58EF2EB}.Release|Any CPU.Build.0 = Release|Any CPU
{B532EEC5-2AA9-88BA-8D0B-46ECC392791A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B532EEC5-2AA9-88BA-8D0B-46ECC392791A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B532EEC5-2AA9-88BA-8D0B-46ECC392791A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B532EEC5-2AA9-88BA-8D0B-46ECC392791A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{97EE2E8A-D1F4-CB11-B664-B99B036E9F7B} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{F625BA55-B999-6F5D-4DA1-9D4C77996D6A} = {4553EF99-1D3C-14C7-0D22-5364D18C373B}
{54F64435-2082-3F4E-D3A8-B90BE58EF2EB} = {4553EF99-1D3C-14C7-0D22-5364D18C373B}
{B532EEC5-2AA9-88BA-8D0B-46ECC392791A} = {4553EF99-1D3C-14C7-0D22-5364D18C373B}
{803C76E6-8804-A4DF-8896-DDBC9FBEE8DD} = {4553EF99-1D3C-14C7-0D22-5364D18C373B}
{F7B6DF0E-EEB2-4B3F-47B7-49B188A2A216} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
{E4D6D10C-C65F-E5E7-F865-FA931477FBCC} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
{80A4F809-28B7-61EC-6539-DF3C7A0733FD} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
{5C1B3E1C-DFEA-425B-8ED2-BB43BAECC3CB} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
{C446785B-BC47-4513-B37D-0C4976D6C396} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
{457F786A-1537-4003-8D9E-FAD0A8773437} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
{FADCD9E4-A5C0-4127-AA1D-EFB9833DFF5D} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
{5B8A3222-1C8E-4796-B6C6-9EE1480CC920} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
EndGlobalSection
EndGlobal
27 changes: 15 additions & 12 deletions Tools/LambdaTestTool-v2/Amazon.Lambda.TestTool.slnx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<Solution>
<Folder Name="/src/">
<Project Path="src\Amazon.Lambda.TestTool\Amazon.Lambda.TestTool.csproj" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests\Amazon.Lambda.TestTool.UnitTests\Amazon.Lambda.TestTool.UnitTests.csproj" />
<Project Path="tests\Amazon.Lambda.TestTool.IntegrationTests\Amazon.Lambda.TestTool.IntegrationTests.csproj" />
<Project Path="tests\LambdaTestFunctionV2\src\LambdaTestFunctionV2\LambdaTestFunctionV2.csproj" />
<Project Path="tests\LambdaBinaryFunction\src\LambdaBinaryFunction\LambdaBinaryFunction.csproj" />
<Project Path="tests\LambdaReturnStringFunction\src\LambdaReturnStringFunction\LambdaReturnStringFunction.csproj" />
<Project Path="tests\LambdaTestFunctionV1\src\LambdaTestFunctionV1\LambdaTestFunctionV1.csproj" />
</Folder>
</Solution>
<Folder Name="/src/">
<Project Path="src\Amazon.Lambda.TestTool\Amazon.Lambda.TestTool.csproj" />
</Folder>
<Folder Name="/testapps/">
<Project Path="testapps\LambdaBinaryFunction\LambdaBinaryFunction.csproj" />
<Project Path="testapps\LambdaReturnStringFunction\LambdaReturnStringFunction.csproj" />
<Project Path="testapps\LambdaTestFunctionV1\LambdaTestFunctionV1.csproj" />
<Project Path="testapps\LambdaTestFunctionV2\LambdaTestFunctionV2.csproj" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests\Amazon.Lambda.TestTool.IntegrationTests\Amazon.Lambda.TestTool.IntegrationTests.csproj" />
<Project Path="tests\Amazon.Lambda.TestTool.Tests.Common\Amazon.Lambda.TestTool.Tests.Common.csproj" Type="Classic C#" />
<Project Path="tests\Amazon.Lambda.TestTool.UnitTests\Amazon.Lambda.TestTool.UnitTests.csproj" />
</Folder>
</Solution>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<Description>A tool to help debug and test your .NET AWS Lambda functions locally.</Description>
Expand All @@ -12,8 +12,14 @@
<IsPackable>true</IsPackable>
<PackAsTool>true</PackAsTool>
<PackageId>Amazon.Lambda.TestTool</PackageId>
<ToolCommandName>lambda-test-tool</ToolCommandName>
<Version>0.0.1-beta.1</Version>
Copy link
Member

Choose a reason for hiding this comment

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

This should be dotnet-lambda-test-tool.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated it

</PropertyGroup>

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

<ItemGroup>
<PackageReference Include="AWSSDK.Lambda" Version="3.7.411.17" />
<PackageReference Include="Spectre.Console" Version="0.49.1" />
Expand All @@ -24,7 +30,6 @@
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="wwwroot\**" />
<EmbeddedResource Include="Resources\**" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Amazon.Lambda.TestTool.Components;
using Amazon.Lambda.TestTool.Services;
using Amazon.Lambda.TestTool.Services.IO;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Options;

namespace Amazon.Lambda.TestTool.Processes;
Expand Down Expand Up @@ -46,7 +47,11 @@ public static TestToolProcess Startup(RunCommandSettings settings, CancellationT

builder.Services.AddHttpContextAccessor();

builder.Services.AddTransient<IPostConfigureOptions<StaticFileOptions>, ConfigureStaticFilesOptions>();
var wwwrootPath = Path.Combine(AppContext.BaseDirectory, "wwwroot");
if (builder.Environment.IsProduction())
{
builder.Services.AddSingleton<IFileProvider>(new PhysicalFileProvider(wwwrootPath));
}
builder.Services.AddSingleton<IDirectoryManager, DirectoryManager>();

var serviceUrl = $"http://{settings.Host}:{settings.Port}";
Expand All @@ -57,7 +62,17 @@ public static TestToolProcess Startup(RunCommandSettings settings, CancellationT

app.UseDeveloperExceptionPage();

app.UseStaticFiles();
if (app.Environment.IsProduction())
{
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(wwwrootPath)
});
}
else
{
app.UseStaticFiles();
}
app.UseAntiforgery();

app.MapRazorComponents<App>()
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@

<ItemGroup>
<PackageReference Include="Amazon.Lambda.APIGatewayEvents" Version="2.7.1" />
<PackageReference Include="AWSSDK.APIGateway" Version="3.7.401.18" />
<PackageReference Include="AWSSDK.CloudFormation" Version="3.7.401.21" />
<PackageReference Include="AWSSDK.IdentityManagement" Version="3.7.403.23" />
<PackageReference Include="AWSSDK.ApiGatewayV2" Version="3.7.400.74" />
<PackageReference Include="AWSSDK.Lambda" Version="3.7.411.17" />
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="AWSSDK.APIGateway" Version="3.7.401.19" />
<PackageReference Include="AWSSDK.CloudFormation" Version="3.7.401.22" />
<PackageReference Include="AWSSDK.IdentityManagement" Version="3.7.403.24" />
<PackageReference Include="AWSSDK.ApiGatewayV2" Version="3.7.400.75" />
<PackageReference Include="AWSSDK.Lambda" Version="3.7.411.18" />
<PackageReference Include="AWSSDK.SecurityToken" Version="3.7.401.24" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>


<ItemGroup>
<ProjectReference Include="..\..\src\Amazon.Lambda.TestTool\Amazon.Lambda.TestTool.csproj" />
<ProjectReference Include="..\Amazon.Lambda.TestTool.UnitTests\Amazon.Lambda.TestTool.UnitTests.csproj" />
<ProjectReference Include="..\Amazon.Lambda.TestTool.Tests.Common\Amazon.Lambda.TestTool.Tests.Common.csproj" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="cloudformation-template-apigateway.yaml" />
</ItemGroup>


<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

</Project>
Loading
Loading