Skip to content

Commit 6401b9e

Browse files
committed
chore: add integration tests
1 parent 4a74be6 commit 6401b9e

19 files changed

Lines changed: 1234 additions & 64 deletions

File tree

AWS.AgentCore.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
<Folder Name="/test/">
1616
<Project Path="test/AWS.AgentCore.UnitTests/AWS.AgentCore.UnitTests.csproj" />
1717
<Project Path="test/AWS.AgentCore.SourceGenerator.UnitTests/AWS.AgentCore.SourceGenerator.UnitTests.csproj" />
18+
<Project Path="test/AWS.AgentCore.IntegrationTests/AWS.AgentCore.IntegrationTests.csproj" />
1819
</Folder>
1920
</Solution>
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
2-
USER $APP_UID
3-
WORKDIR /app
4-
EXPOSE 8080
5-
EXPOSE 8081
6-
7-
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
1+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build
82
ARG BUILD_CONFIGURATION=Release
93
WORKDIR /src
104
COPY ["sampleapps/AnnotationsSample/AnnotationsSample.csproj", "sampleapps/AnnotationsSample/"]
@@ -13,14 +7,11 @@ COPY ["src/AWS.AgentCore.SourceGenerator/AWS.AgentCore.SourceGenerator.csproj",
137
RUN dotnet restore "sampleapps/AnnotationsSample/AnnotationsSample.csproj"
148
COPY . .
159
WORKDIR "/src/sampleapps/AnnotationsSample"
16-
RUN dotnet build "./AnnotationsSample.csproj" -c $BUILD_CONFIGURATION -o /app/build
17-
18-
FROM build AS publish
19-
ARG BUILD_CONFIGURATION=Release
2010
RUN dotnet publish "./AnnotationsSample.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
2111

22-
FROM base AS final
12+
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
13+
USER $APP_UID
2314
WORKDIR /app
24-
COPY --from=publish /app/publish .
15+
EXPOSE 8080
16+
COPY --from=build /app/publish .
2517
ENTRYPOINT ["dotnet", "AnnotationsSample.dll"]
26-
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
2-
USER $APP_UID
3-
WORKDIR /app
4-
EXPOSE 8080
5-
EXPOSE 8081
6-
7-
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
1+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build
82
ARG BUILD_CONFIGURATION=Release
93
WORKDIR /src
104
COPY ["sampleapps/AnnotationsStreamingAgent/AnnotationsStreamingAgent.csproj", "sampleapps/AnnotationsStreamingAgent/"]
@@ -13,14 +7,11 @@ COPY ["src/AWS.AgentCore.SourceGenerator/AWS.AgentCore.SourceGenerator.csproj",
137
RUN dotnet restore "sampleapps/AnnotationsStreamingAgent/AnnotationsStreamingAgent.csproj"
148
COPY . .
159
WORKDIR "/src/sampleapps/AnnotationsStreamingAgent"
16-
RUN dotnet build "./AnnotationsStreamingAgent.csproj" -c $BUILD_CONFIGURATION -o /app/build
17-
18-
FROM build AS publish
19-
ARG BUILD_CONFIGURATION=Release
2010
RUN dotnet publish "./AnnotationsStreamingAgent.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
2111

22-
FROM base AS final
12+
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
13+
USER $APP_UID
2314
WORKDIR /app
24-
COPY --from=publish /app/publish .
15+
EXPOSE 8080
16+
COPY --from=build /app/publish .
2517
ENTRYPOINT ["dotnet", "AnnotationsStreamingAgent.dll"]
26-
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
2-
USER $APP_UID
3-
WORKDIR /app
4-
EXPOSE 8080
5-
EXPOSE 8081
6-
7-
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
1+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build
82
ARG BUILD_CONFIGURATION=Release
93
WORKDIR /src
104
COPY ["sampleapps/MicrosoftAgentFrameworkSample/MicrosoftAgentFrameworkSample.csproj", "sampleapps/MicrosoftAgentFrameworkSample/"]
@@ -13,14 +7,11 @@ COPY ["src/AWS.AgentCore.SourceGenerator/AWS.AgentCore.SourceGenerator.csproj",
137
RUN dotnet restore "sampleapps/MicrosoftAgentFrameworkSample/MicrosoftAgentFrameworkSample.csproj"
148
COPY . .
159
WORKDIR "/src/sampleapps/MicrosoftAgentFrameworkSample"
16-
RUN dotnet build "./MicrosoftAgentFrameworkSample.csproj" -c $BUILD_CONFIGURATION -o /app/build
17-
18-
FROM build AS publish
19-
ARG BUILD_CONFIGURATION=Release
2010
RUN dotnet publish "./MicrosoftAgentFrameworkSample.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
2111

22-
FROM base AS final
12+
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
13+
USER $APP_UID
2314
WORKDIR /app
24-
COPY --from=publish /app/publish .
15+
EXPOSE 8080
16+
COPY --from=build /app/publish .
2517
ENTRYPOINT ["dotnet", "MicrosoftAgentFrameworkSample.dll"]
26-

sampleapps/NativeAotAnnotations/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
1+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0-aot AS build
22
ARG BUILD_CONFIGURATION=Release
3-
RUN apt-get update && apt-get install -y clang zlib1g-dev && rm -rf /var/lib/apt/lists/*
3+
ARG TARGETARCH
44
WORKDIR /src
55
COPY ["sampleapps/NativeAotAnnotations/NativeAotAnnotations.csproj", "sampleapps/NativeAotAnnotations/"]
66
COPY ["src/AWS.AgentCore/AWS.AgentCore.csproj", "src/AWS.AgentCore/"]
77
COPY ["src/AWS.AgentCore.SourceGenerator/AWS.AgentCore.SourceGenerator.csproj", "src/AWS.AgentCore.SourceGenerator/"]
8-
RUN dotnet restore "sampleapps/NativeAotAnnotations/NativeAotAnnotations.csproj"
8+
RUN dotnet restore "sampleapps/NativeAotAnnotations/NativeAotAnnotations.csproj" -a $TARGETARCH
99
COPY . .
1010
WORKDIR "/src/sampleapps/NativeAotAnnotations"
11-
RUN dotnet publish "./NativeAotAnnotations.csproj" -c $BUILD_CONFIGURATION -o /app/publish
11+
RUN dotnet publish "./NativeAotAnnotations.csproj" -c $BUILD_CONFIGURATION -a $TARGETARCH -o /app/publish /p:LinkerFlavor=lld
1212

1313
FROM mcr.microsoft.com/dotnet/runtime-deps:10.0 AS final
1414
USER $APP_UID

sampleapps/NativeAotExtensions/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
1+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0-aot AS build
22
ARG BUILD_CONFIGURATION=Release
3-
RUN apt-get update && apt-get install -y clang zlib1g-dev && rm -rf /var/lib/apt/lists/*
3+
ARG TARGETARCH
44
WORKDIR /src
55
COPY ["sampleapps/NativeAotExtensions/NativeAotExtensions.csproj", "sampleapps/NativeAotExtensions/"]
66
COPY ["src/AWS.AgentCore/AWS.AgentCore.csproj", "src/AWS.AgentCore/"]
77
COPY ["src/AWS.AgentCore.SourceGenerator/AWS.AgentCore.SourceGenerator.csproj", "src/AWS.AgentCore.SourceGenerator/"]
8-
RUN dotnet restore "sampleapps/NativeAotExtensions/NativeAotExtensions.csproj"
8+
RUN dotnet restore "sampleapps/NativeAotExtensions/NativeAotExtensions.csproj" -a $TARGETARCH
99
COPY . .
1010
WORKDIR "/src/sampleapps/NativeAotExtensions"
11-
RUN dotnet publish "./NativeAotExtensions.csproj" -c $BUILD_CONFIGURATION -o /app/publish
11+
RUN dotnet publish "./NativeAotExtensions.csproj" -c $BUILD_CONFIGURATION -a $TARGETARCH -o /app/publish /p:LinkerFlavor=lld
1212

1313
FROM mcr.microsoft.com/dotnet/runtime-deps:10.0 AS final
1414
USER $APP_UID
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
2-
USER $APP_UID
3-
WORKDIR /app
4-
EXPOSE 8080
5-
EXPOSE 8081
6-
7-
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
1+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build
82
ARG BUILD_CONFIGURATION=Release
93
WORKDIR /src
104
COPY ["sampleapps/StreamingAgent/StreamingAgent.csproj", "sampleapps/StreamingAgent/"]
@@ -13,14 +7,11 @@ COPY ["src/AWS.AgentCore.SourceGenerator/AWS.AgentCore.SourceGenerator.csproj",
137
RUN dotnet restore "sampleapps/StreamingAgent/StreamingAgent.csproj"
148
COPY . .
159
WORKDIR "/src/sampleapps/StreamingAgent"
16-
RUN dotnet build "./StreamingAgent.csproj" -c $BUILD_CONFIGURATION -o /app/build
17-
18-
FROM build AS publish
19-
ARG BUILD_CONFIGURATION=Release
2010
RUN dotnet publish "./StreamingAgent.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
2111

22-
FROM base AS final
12+
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
13+
USER $APP_UID
2314
WORKDIR /app
24-
COPY --from=publish /app/publish .
15+
EXPOSE 8080
16+
COPY --from=build /app/publish .
2517
ENTRYPOINT ["dotnet", "StreamingAgent.dll"]
26-
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<IsPackable>false</IsPackable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="AWSSDK.BedrockAgentCore" Version="4.0.20.1" />
13+
<PackageReference Include="AWSSDK.BedrockAgentCoreControl" Version="4.0.30" />
14+
<PackageReference Include="AWSSDK.ECR" Version="4.0.13.3" />
15+
<PackageReference Include="AWSSDK.IdentityManagement" Version="4.0.9.20" />
16+
<PackageReference Include="AWSSDK.SecurityToken" Version="4.0.6.2" />
17+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
18+
<PackageReference Include="xunit.v3" Version="3.2.2" />
19+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
20+
</ItemGroup>
21+
22+
</Project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
using AWS.AgentCore.IntegrationTests.Infrastructure;
5+
6+
namespace AWS.AgentCore.IntegrationTests.Fixtures;
7+
8+
public class MicrosoftAgentFrameworkFixture : SampleAppFixture
9+
{
10+
public MicrosoftAgentFrameworkFixture() : base("MicrosoftAgentFrameworkSample") { }
11+
}
12+
13+
public class AnnotationsSampleFixture : SampleAppFixture
14+
{
15+
public AnnotationsSampleFixture() : base("AnnotationsSample") { }
16+
}
17+
18+
public class StreamingAgentFixture : SampleAppFixture
19+
{
20+
public StreamingAgentFixture() : base("StreamingAgent") { }
21+
}
22+
23+
public class AnnotationsStreamingAgentFixture : SampleAppFixture
24+
{
25+
public AnnotationsStreamingAgentFixture() : base("AnnotationsStreamingAgent") { }
26+
}
27+
28+
public class NativeAotExtensionsFixture : SampleAppFixture
29+
{
30+
public NativeAotExtensionsFixture() : base("NativeAotExtensions") { }
31+
}
32+
33+
public class NativeAotAnnotationsFixture : SampleAppFixture
34+
{
35+
public NativeAotAnnotationsFixture() : base("NativeAotAnnotations") { }
36+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
global using Xunit;

0 commit comments

Comments
 (0)