Skip to content

Commit 8f18bb2

Browse files
authored
fix: fix skipped tests (#1964)
1 parent fa24fc4 commit 8f18bb2

35 files changed

+538
-738
lines changed

Diff for: Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
<PropertyGroup Condition=" '$(ExecutableOutputType)'=='true' ">
2020
<OutputType>Exe</OutputType>
21+
<DefineConstants>$(DefineConstants);ExecutableOutputType</DefineConstants>
2122
</PropertyGroup>
2223

2324
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0' or '$(TargetFramework)' == 'net9.0'">

Diff for: Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/InvokeDelegateBuilder.cs

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ namespace Amazon.Lambda.RuntimeSupport.Bootstrap
2929
/// <summary>
3030
/// Builds user delegate from the handler information.
3131
/// </summary>
32+
#if NET8_0_OR_GREATER
33+
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("InvokeDelegateBuilder does not support trimming and is meant to be used in class library based Lambda functions.")]
34+
#endif
3235
internal class InvokeDelegateBuilder
3336
{
3437
private readonly InternalLogger _logger;

Diff for: Libraries/src/Amazon.Lambda.RuntimeSupport/Program.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
@@ -23,6 +23,8 @@ namespace Amazon.Lambda.RuntimeSupport
2323
{
2424
class Program
2525
{
26+
27+
#if ExecutableOutputType
2628
#if NET8_0_OR_GREATER
2729
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode(
2830
"The Main entry point is used in the managed runtime which loads Lambda functions as a class library. " +
@@ -42,6 +44,7 @@ private static async Task Main(string[] args)
4244
RuntimeSupportInitializer runtimeSupportInitializer = new RuntimeSupportInitializer(handler);
4345
await runtimeSupportInitializer.RunLambdaBootstrap();
4446
}
47+
#endif
4548

4649
#if NET8_0_OR_GREATER
4750
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This code is only exercised in the class library programming model. Native AOT will not use this code path.")]

Diff for: Tools/LambdaTestTool-v2/Amazon.Lambda.TestTool.sln

+6-36
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Amazon.Lambda.TestTool", "s
66
EndProject
77
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0AB3BF05-4346-4AA6-1389-037BE0695223}"
88
EndProject
9-
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}"
10-
EndProject
11-
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}"
12-
EndProject
139
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}"
1410
EndProject
15-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambdaTestFunctionV2", "testapps\LambdaTestFunctionV2\LambdaTestFunctionV2.csproj", "{803C76E6-8804-A4DF-8896-DDBC9FBEE8DD}"
16-
EndProject
17-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambdaBinaryFunction", "testapps\LambdaBinaryFunction\LambdaBinaryFunction.csproj", "{F625BA55-B999-6F5D-4DA1-9D4C77996D6A}"
18-
EndProject
19-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambdaReturnStringFunction", "testapps\LambdaReturnStringFunction\LambdaReturnStringFunction.csproj", "{54F64435-2082-3F4E-D3A8-B90BE58EF2EB}"
20-
EndProject
21-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambdaTestFunctionV1", "testapps\LambdaTestFunctionV1\LambdaTestFunctionV1.csproj", "{B532EEC5-2AA9-88BA-8D0B-46ECC392791A}"
11+
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}"
2212
EndProject
23-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "testapps", "testapps", "{4553EF99-1D3C-14C7-0D22-5364D18C373B}"
13+
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}"
2414
EndProject
2515
Global
2616
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -32,6 +22,10 @@ Global
3222
{97EE2E8A-D1F4-CB11-B664-B99B036E9F7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
3323
{97EE2E8A-D1F4-CB11-B664-B99B036E9F7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
3424
{97EE2E8A-D1F4-CB11-B664-B99B036E9F7B}.Release|Any CPU.Build.0 = Release|Any CPU
25+
{F7B6DF0E-EEB2-4B3F-47B7-49B188A2A216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26+
{F7B6DF0E-EEB2-4B3F-47B7-49B188A2A216}.Debug|Any CPU.Build.0 = Debug|Any CPU
27+
{F7B6DF0E-EEB2-4B3F-47B7-49B188A2A216}.Release|Any CPU.ActiveCfg = Release|Any CPU
28+
{F7B6DF0E-EEB2-4B3F-47B7-49B188A2A216}.Release|Any CPU.Build.0 = Release|Any CPU
3529
{E4D6D10C-C65F-E5E7-F865-FA931477FBCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3630
{E4D6D10C-C65F-E5E7-F865-FA931477FBCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
3731
{E4D6D10C-C65F-E5E7-F865-FA931477FBCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -40,33 +34,9 @@ Global
4034
{80A4F809-28B7-61EC-6539-DF3C7A0733FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
4135
{80A4F809-28B7-61EC-6539-DF3C7A0733FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
4236
{80A4F809-28B7-61EC-6539-DF3C7A0733FD}.Release|Any CPU.Build.0 = Release|Any CPU
43-
{F7B6DF0E-EEB2-4B3F-47B7-49B188A2A216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
44-
{F7B6DF0E-EEB2-4B3F-47B7-49B188A2A216}.Debug|Any CPU.Build.0 = Debug|Any CPU
45-
{F7B6DF0E-EEB2-4B3F-47B7-49B188A2A216}.Release|Any CPU.ActiveCfg = Release|Any CPU
46-
{F7B6DF0E-EEB2-4B3F-47B7-49B188A2A216}.Release|Any CPU.Build.0 = Release|Any CPU
47-
{803C76E6-8804-A4DF-8896-DDBC9FBEE8DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
48-
{803C76E6-8804-A4DF-8896-DDBC9FBEE8DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
49-
{803C76E6-8804-A4DF-8896-DDBC9FBEE8DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
50-
{803C76E6-8804-A4DF-8896-DDBC9FBEE8DD}.Release|Any CPU.Build.0 = Release|Any CPU
51-
{F625BA55-B999-6F5D-4DA1-9D4C77996D6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
52-
{F625BA55-B999-6F5D-4DA1-9D4C77996D6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
53-
{F625BA55-B999-6F5D-4DA1-9D4C77996D6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
54-
{F625BA55-B999-6F5D-4DA1-9D4C77996D6A}.Release|Any CPU.Build.0 = Release|Any CPU
55-
{54F64435-2082-3F4E-D3A8-B90BE58EF2EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
56-
{54F64435-2082-3F4E-D3A8-B90BE58EF2EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
57-
{54F64435-2082-3F4E-D3A8-B90BE58EF2EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
58-
{54F64435-2082-3F4E-D3A8-B90BE58EF2EB}.Release|Any CPU.Build.0 = Release|Any CPU
59-
{B532EEC5-2AA9-88BA-8D0B-46ECC392791A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
60-
{B532EEC5-2AA9-88BA-8D0B-46ECC392791A}.Debug|Any CPU.Build.0 = Debug|Any CPU
61-
{B532EEC5-2AA9-88BA-8D0B-46ECC392791A}.Release|Any CPU.ActiveCfg = Release|Any CPU
62-
{B532EEC5-2AA9-88BA-8D0B-46ECC392791A}.Release|Any CPU.Build.0 = Release|Any CPU
6337
EndGlobalSection
6438
GlobalSection(NestedProjects) = preSolution
6539
{97EE2E8A-D1F4-CB11-B664-B99B036E9F7B} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
66-
{F625BA55-B999-6F5D-4DA1-9D4C77996D6A} = {4553EF99-1D3C-14C7-0D22-5364D18C373B}
67-
{54F64435-2082-3F4E-D3A8-B90BE58EF2EB} = {4553EF99-1D3C-14C7-0D22-5364D18C373B}
68-
{B532EEC5-2AA9-88BA-8D0B-46ECC392791A} = {4553EF99-1D3C-14C7-0D22-5364D18C373B}
69-
{803C76E6-8804-A4DF-8896-DDBC9FBEE8DD} = {4553EF99-1D3C-14C7-0D22-5364D18C373B}
7040
{F7B6DF0E-EEB2-4B3F-47B7-49B188A2A216} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
7141
{E4D6D10C-C65F-E5E7-F865-FA931477FBCC} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
7242
{80A4F809-28B7-61EC-6539-DF3C7A0733FD} = {0AB3BF05-4346-4AA6-1389-037BE0695223}

Diff for: Tools/LambdaTestTool-v2/Amazon.Lambda.TestTool.slnx

-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
<Folder Name="/src/">
33
<Project Path="src\Amazon.Lambda.TestTool\Amazon.Lambda.TestTool.csproj" />
44
</Folder>
5-
<Folder Name="/testapps/">
6-
<Project Path="testapps\LambdaBinaryFunction\LambdaBinaryFunction.csproj" />
7-
<Project Path="testapps\LambdaReturnStringFunction\LambdaReturnStringFunction.csproj" />
8-
<Project Path="testapps\LambdaTestFunctionV1\LambdaTestFunctionV1.csproj" />
9-
<Project Path="testapps\LambdaTestFunctionV2\LambdaTestFunctionV2.csproj" />
10-
</Folder>
115
<Folder Name="/tests/">
126
<Project Path="tests\Amazon.Lambda.TestTool.IntegrationTests\Amazon.Lambda.TestTool.IntegrationTests.csproj" />
137
<Project Path="tests\Amazon.Lambda.TestTool.Tests.Common\Amazon.Lambda.TestTool.Tests.Common.csproj" Type="Classic C#" />

Diff for: Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<Import Project="..\..\..\..\buildtools\common.props" />
44
<PropertyGroup>
@@ -37,17 +37,18 @@
3737
<Exec Command="dotnet msbuild ../../../../Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj --getProperty:TargetFrameworks" ConsoleToMSBuild="true">
3838
<Output TaskParameter="ConsoleOutput" PropertyName="RuntimeSupportTargetFrameworks" />
3939
</Exec>
40-
</Target>
41-
42-
<Target Name="CopyRuntimeSupportFiles" DependsOnTargets="GetRuntimeSupportTargetFrameworks" BeforeTargets="_GetPackageFiles">
40+
4341
<ItemGroup>
4442
<TempFrameworks Include="$(RuntimeSupportTargetFrameworks.Split(';'))" />
45-
4643
<TargetFrameworks Include="@(TempFrameworks)" Condition="'%(Identity)' != 'netstandard2.0'" />
4744
</ItemGroup>
45+
</Target>
4846

47+
<Target Name="PublishRuntimeSupportFiles" DependsOnTargets="GetRuntimeSupportTargetFrameworks" BeforeTargets="Build">
4948
<Exec Command="dotnet publish &quot;$(MSBuildThisFileDirectory)../../../../Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj&quot; -c $(Configuration) -f %(TargetFrameworks.Identity) /p:ExecutableOutputType=true" />
49+
</Target>
5050

51+
<Target Name="CopyRuntimeSupportFiles" DependsOnTargets="GetRuntimeSupportTargetFrameworks" BeforeTargets="_GetPackageFiles">
5152
<ItemGroup>
5253
<None Include="$(MSBuildThisFileDirectory)../../../../Libraries/src/Amazon.Lambda.RuntimeSupport/bin/$(Configuration)/%(TargetFrameworks.Identity)/publish/**/*.*">
5354
<Pack>true</Pack>

Diff for: Tools/LambdaTestTool-v2/testapps/LambdaBinaryFunction/Function.cs

-29
This file was deleted.

Diff for: Tools/LambdaTestTool-v2/testapps/LambdaBinaryFunction/LambdaBinaryFunction.csproj

-20
This file was deleted.

Diff for: Tools/LambdaTestTool-v2/testapps/LambdaBinaryFunction/aws-lambda-tools-defaults.json

-15
This file was deleted.

Diff for: Tools/LambdaTestTool-v2/testapps/LambdaReturnStringFunction/Function.cs

-13
This file was deleted.

Diff for: Tools/LambdaTestTool-v2/testapps/LambdaReturnStringFunction/LambdaReturnStringFunction.csproj

-21
This file was deleted.

Diff for: Tools/LambdaTestTool-v2/testapps/LambdaReturnStringFunction/aws-lambda-tools-defaults.json

-15
This file was deleted.

Diff for: Tools/LambdaTestTool-v2/testapps/LambdaTestFunctionV1/Function.cs

-18
This file was deleted.

Diff for: Tools/LambdaTestTool-v2/testapps/LambdaTestFunctionV1/LambdaTestFunctionV1.csproj

-20
This file was deleted.

Diff for: Tools/LambdaTestTool-v2/testapps/LambdaTestFunctionV1/aws-lambda-tools-defaults.json

-15
This file was deleted.

Diff for: Tools/LambdaTestTool-v2/testapps/LambdaTestFunctionV2/Function.cs

-17
This file was deleted.

Diff for: Tools/LambdaTestTool-v2/testapps/LambdaTestFunctionV2/LambdaTestFunctionV2.csproj

-24
This file was deleted.

Diff for: Tools/LambdaTestTool-v2/testapps/LambdaTestFunctionV2/aws-lambda-tools-defaults.json

-15
This file was deleted.

0 commit comments

Comments
 (0)