Skip to content
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

Create functional tests for additional integrations #4741

Open
2 of 10 tasks
radical opened this issue Jul 1, 2024 · 4 comments
Open
2 of 10 tasks

Create functional tests for additional integrations #4741

radical opened this issue Jul 1, 2024 · 4 comments
Labels
area-integrations Issues pertaining to Aspire Integrations packages testing ☑️ tracking Tracking issue for some TODOs untriaged New issue has not been triaged

Comments

@radical
Copy link
Member

radical commented Jul 1, 2024

Split from #1566

We are missing the EntityFramework components in our functional integration tests added in #1217. We should add them, plus any other missing components that would be valuable.

TODO:

  • cosmos
  • 🔴 blocked: dapr (needs dapr cli installed)
  • nats
  • seq
  • qdrant
  • orleans

Tests needed that reference these nugets too:

  • Microsoft.Extensions.ServiceDiscovery
  • Microsoft.Extensions.ServiceDiscovery.Abstractions
  • Microsoft.Extensions.ServiceDiscovery.Dns
  • Microsoft.Extensions.ServiceDiscovery.Yarp

cc @eerhardt

@radical radical added the tracking Tracking issue for some TODOs label Aug 22, 2024
@radical radical changed the title Create integration tests for additional components Create functional tests for additional integrations Aug 23, 2024
@eerhardt
Copy link
Member

qdrant is done:

[Fact]
[RequiresDocker]
public async Task VerifyQdrantResource()
{
var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
var pipeline = new ResiliencePipelineBuilder()
.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<RpcException>() })
.Build();
using var builder = TestDistributedApplicationBuilder.CreateWithTestContainerRegistry(testOutputHelper);
var qdrant = builder.AddQdrant("qdrant");
using var app = builder.Build();
await app.StartAsync();
var hb = Host.CreateApplicationBuilder();
hb.Configuration.AddInMemoryCollection(new Dictionary<string, string?>
{
[$"ConnectionStrings:{qdrant.Resource.Name}"] = await qdrant.Resource.ConnectionStringExpression.GetValueAsync(default)
});
hb.AddQdrantClient(qdrant.Resource.Name);
using var host = hb.Build();
await host.StartAsync();
await pipeline.ExecuteAsync(async token =>
{
var qdrantClient = host.Services.GetRequiredService<QdrantClient>();
await CreateTestDataAsync(qdrantClient, token);
var results = await qdrantClient.SearchAsync(CollectionName, s_testVector, limit: 1, cancellationToken: token);
Assert.Collection(results,
r => Assert.Equal("Test", r.Payload["title"].StringValue));
}, cts.Token);
}

@davidfowl davidfowl added area-integrations Issues pertaining to Aspire Integrations packages and removed area-service-discovery labels Sep 7, 2024
@radical
Copy link
Member Author

radical commented Sep 11, 2024

cc @sebastienros

@Alirexaa Alirexaa mentioned this issue Sep 30, 2024
16 tasks
@Alirexaa
Copy link
Contributor

nats is done too:

[Fact]
[RequiresDocker]
public async Task VerifyNatsResource()
{
var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
var pipeline = new ResiliencePipelineBuilder()
.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<NatsException>() })
.Build();
using var builder = TestDistributedApplicationBuilder.CreateWithTestContainerRegistry(testOutputHelper);
var nats = builder.AddNats("nats")
.WithJetStream();
using var app = builder.Build();
await app.StartAsync();
var hb = Host.CreateApplicationBuilder();
hb.Configuration[$"ConnectionStrings:{nats.Resource.Name}"] = await nats.Resource.ConnectionStringExpression.GetValueAsync(default);
hb.AddNatsClient("nats", configureOptions: opts =>
{
var jsonRegistry = new NatsJsonContextSerializerRegistry(AppJsonContext.Default);
return opts with { SerializerRegistry = jsonRegistry };
});
hb.AddNatsJetStream();
using var host = hb.Build();
await host.StartAsync();
await pipeline.ExecuteAsync(async token =>
{
var jetStream = host.Services.GetRequiredService<INatsJSContext>();
await CreateTestData(jetStream, token);
await ConsumeTestData(jetStream, token);
}, cts.Token);

@joperezr joperezr added the untriaged New issue has not been triaged label Oct 15, 2024
@eerhardt
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-integrations Issues pertaining to Aspire Integrations packages testing ☑️ tracking Tracking issue for some TODOs untriaged New issue has not been triaged
Projects
None yet
Development

No branches or pull requests

5 participants