Skip to content

Commit 8363494

Browse files
ReubenBondCopilot
andcommitted
test(streaming): split Kinesis tests into provider project
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3f5060d4-b229-476c-bdf3-9923ad459bb2
1 parent 05e1a5f commit 8363494

20 files changed

Lines changed: 73 additions & 41 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ jobs:
981981
done
982982
- name: Test
983983
run: dotnet test
984-
test/Extensions/Orleans.AWS.Tests/Orleans.AWS.Tests.csproj
984+
test/Extensions/Orleans.Streaming.Kinesis.Tests/Orleans.Streaming.Kinesis.Tests.csproj
985985
--framework ${{ matrix.framework }}
986986
--filter "Category=${{ matrix.provider }}"
987987
--blame-hang-timeout 10m

Orleans.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@
157157
<Folder Name="/test/Extensions/">
158158
<Project Path="test/Extensions/Orleans.AWS.Tests/Orleans.AWS.Tests.csproj" />
159159
<Project Path="test/Extensions/Orleans.Clustering.Consul.Tests/Orleans.Clustering.Consul.Tests.csproj" />
160+
<Project Path="test/Extensions/Orleans.Streaming.Kinesis.Tests/Orleans.Streaming.Kinesis.Tests.csproj" />
160161
<Project Path="test/Extensions/Orleans.Streaming.EventHubs.Tests/Orleans.Streaming.EventHubs.Tests.csproj" />
161162
<Project Path="test/Extensions/Orleans.Clustering.Cassandra.Tests/Orleans.Clustering.Cassandra.Tests.csproj" />
162163
<Project Path="test/Extensions/Orleans.Cosmos.Tests/Orleans.Cosmos.Tests.csproj" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
using System.Runtime.CompilerServices;
22

3-
[assembly: InternalsVisibleTo("Orleans.AWS.Tests")]
3+
[assembly: InternalsVisibleTo("Orleans.Streaming.Kinesis.Tests")]

src/Orleans.TestingHost/Orleans.TestingHost.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
<InternalsVisibleTo Include="Orleans.Placement.Tests" />
2727
<InternalsVisibleTo Include="Orleans.Runtime.Internal.Tests" />
2828
<InternalsVisibleTo Include="Orleans.Streaming.Tests" />
29+
<InternalsVisibleTo Include="Orleans.Streaming.Kinesis.Tests" />
2930
</ItemGroup>
3031
</Project>
31-

test/Extensions/Orleans.AWS.Tests/Orleans.AWS.Tests.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@
1313

1414
<ItemGroup>
1515
<PackageReference Include="Microsoft.NET.Test.Sdk" />
16-
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" />
17-
<PackageReference Include="NSubstitute" />
1816
</ItemGroup>
1917

2018
<ItemGroup>
2119
<ProjectReference Include="$(SourceRoot)src\AWS\Orleans.Clustering.DynamoDB\Orleans.Clustering.DynamoDB.csproj" />
2220
<ProjectReference Include="$(SourceRoot)src\AWS\Orleans.Persistence.DynamoDB\Orleans.Persistence.DynamoDB.csproj" />
2321
<ProjectReference Include="$(SourceRoot)src\AWS\Orleans.Reminders.DynamoDB\Orleans.Reminders.DynamoDB.csproj" />
24-
<ProjectReference Include="$(SourceRoot)src\AWS\Orleans.Streaming.Kinesis\Orleans.Streaming.Kinesis.csproj" />
2522
<ProjectReference Include="$(SourceRoot)src\AWS\Orleans.Streaming.SQS\Orleans.Streaming.SQS.csproj" />
2623
<ProjectReference Include="$(SourceRoot)test\Orleans.Runtime.Internal.Tests\Orleans.Runtime.Internal.Tests.csproj" />
2724
<ProjectReference Include="$(SourceRoot)test\Orleans.Streaming.Tests\Orleans.Streaming.Tests.csproj" />

test/Extensions/Orleans.AWS.Tests/StorageTests/AWSTestConstants.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,9 @@ public class AWSTestConstants
5151
public static string DynamoDbAccessKey { get; set; } = TestDefaultConfiguration.DynamoDbAccessKey!;
5252
public static string DynamoDbSecretKey { get; set; } = TestDefaultConfiguration.DynamoDbSecretKey!;
5353
public static string DynamoDbService { get; set; } = TestDefaultConfiguration.DynamoDbService!;
54-
public static string KinesisConnectionString { get; set; } = TestDefaultConfiguration.KinesisConnectionString!;
5554
public static string SqsConnectionString { get; set; } = TestDefaultConfiguration.SqsConnectionString!;
5655

5756
public static bool IsDynamoDbAvailable => _isDynamoDbAvailable.Value;
58-
public static bool IsKinesisAvailable => !string.IsNullOrWhiteSpace(KinesisConnectionString);
5957
public static bool IsSqsAvailable => !string.IsNullOrWhiteSpace(SqsConnectionString);
6058
}
6159
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using TestExtensions;
2+
using Xunit;
3+
4+
namespace Orleans.Streaming.Kinesis.Tests;
5+
6+
[CollectionDefinition(TestEnvironmentFixture.DefaultCollection)]
7+
public sealed class TestEnvironmentFixtureCollection : ICollectionFixture<TestEnvironmentFixture>;

test/Extensions/Orleans.AWS.Tests/Streaming/KinesisAdapterTests.cs renamed to test/Extensions/Orleans.Streaming.Kinesis.Tests/KinesisAdapterTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@
77
using Orleans.Runtime;
88
using Orleans.Streams;
99
using Orleans.Streaming.Kinesis;
10-
using AWSUtils.Tests.StorageTests;
1110
using TestExtensions;
1211
using Xunit;
1312
using Xunit.Abstractions;
1413
using Orleans.Configuration;
1514
using Orleans.Serialization;
1615
using Microsoft.Extensions.DependencyInjection;
1716

18-
namespace AWSUtils.Tests.Streaming
17+
namespace Orleans.Streaming.Kinesis.Tests
1918
{
2019
/// <summary>
2120
/// Tests Kinesis adapter functionality for sending and receiving messages through Orleans streaming.
@@ -34,7 +33,7 @@ public class KinesisAdapterTests : IAsyncLifetime
3433

3534
public KinesisAdapterTests(ITestOutputHelper output, TestEnvironmentFixture fixture)
3635
{
37-
if (!AWSTestConstants.IsKinesisAvailable)
36+
if (!KinesisTestConstants.IsAvailable)
3837
{
3938
throw new SkipException("Empty connection string");
4039
}
@@ -57,7 +56,7 @@ public async Task SendAndReceiveFromKinesis()
5756
{
5857
var options = new KinesisStreamOptions
5958
{
60-
ConnectionString = AWSTestConstants.KinesisConnectionString,
59+
ConnectionString = KinesisTestConstants.ConnectionString,
6160
StreamName = KinesisStreamName,
6261
};
6362
var serviceCollection = new ServiceCollection();

test/Extensions/Orleans.AWS.Tests/Streaming/KinesisBatchContainerTests.cs renamed to test/Extensions/Orleans.Streaming.Kinesis.Tests/KinesisBatchContainerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using Xunit;
77
using KinesisRecord = Amazon.Kinesis.Model.Record;
88

9-
namespace AWSUtils.Tests.Streaming;
9+
namespace Orleans.Streaming.Kinesis.Tests;
1010

1111
[TestCategory("AWS"), TestCategory("Kinesis")]
1212
[Collection(TestEnvironmentFixture.DefaultCollection)]

test/Extensions/Orleans.AWS.Tests/Streaming/KinesisClientStreamTests.cs renamed to test/Extensions/Orleans.Streaming.Kinesis.Tests/KinesisClientStreamTests.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using AWSUtils.Tests.StorageTests;
21
using Orleans.TestingHost;
32
using Microsoft.Extensions.Logging.Abstractions;
43
using Tester.StreamingTests;
@@ -10,7 +9,7 @@
109
using Microsoft.Extensions.Logging;
1110
using Orleans.Configuration;
1211

13-
namespace AWSUtils.Tests.Streaming
12+
namespace Orleans.Streaming.Kinesis.Tests
1413
{
1514
/// <summary>
1615
/// Tests Kinesis streaming functionality from Orleans client perspective including producer dropout scenarios.
@@ -21,8 +20,6 @@ public class KinesisClientStreamTests : TestClusterPerTest
2120
private const string KinesisStreamProviderName = "KinesisProvider";
2221
private const string KinesisStreamName = "OrleansKinesisClientStreamTests";
2322
private const string StreamNamespace = "KinesisSubscriptionMultiplicityTestsNamespace";
24-
private readonly string StorageConnectionString = AWSTestConstants.KinesisConnectionString;
25-
2623
private readonly ITestOutputHelper output;
2724
private ClientStreamTestRunner runner = null!;
2825

@@ -39,7 +36,7 @@ public override async Task InitializeAsync()
3936

4037
protected override void ConfigureTestCluster(TestClusterBuilder builder)
4138
{
42-
if (!AWSTestConstants.IsKinesisAvailable)
39+
if (!KinesisTestConstants.IsAvailable)
4340
{
4441
throw new SkipException("Empty connection string");
4542
}
@@ -55,7 +52,7 @@ public void Configure(ISiloBuilder hostBuilder)
5552
hostBuilder
5653
.AddKinesisStreams(KinesisStreamProviderName, options =>
5754
{
58-
options.ConnectionString = AWSTestConstants.KinesisConnectionString;
55+
options.ConnectionString = KinesisTestConstants.ConnectionString;
5956
options.StreamName = KinesisStreamName;
6057
})
6158
.AddMemoryGrainStorage("PubSubStore")
@@ -70,7 +67,7 @@ public void Configure(IConfiguration configuration, IClientBuilder clientBuilder
7067
clientBuilder
7168
.AddKinesisStreams(KinesisStreamProviderName, options =>
7269
{
73-
options.ConnectionString = AWSTestConstants.KinesisConnectionString;
70+
options.ConnectionString = KinesisTestConstants.ConnectionString;
7471
options.StreamName = KinesisStreamName;
7572
});
7673
}

0 commit comments

Comments
 (0)