How to configure TestClusterBuilder such that the test cluster has access to SMSProvider?

Solution 1:

The setup needs to be improved. You can check this sample from the official Orleans GitHub page: https://github.com/dotnet/orleans/blob/main/test/TesterInternal/StreamingTests/SMSStreamingTests.cs

So, in your ClusterFixture class you should add the SiloConfigurator:

private class SiloConfigurator : ISiloConfigurator
{
  public void Configure(ISiloBuilder hostBuilder) =>
     hostBuilder.AddSimpleMessageStreamProvider("SMSProvider")
                .AddMemoryGrainStorage("PubSubStore");
}

and the ClientConfiguretor:

private class ClientConfiguretor : IClientBuilderConfigurator
{
  public void Configure(IConfiguration configuration, IClientBuilder clientBuilder) => 
    clientBuilder.AddSimpleMessageStreamProvider("SMSProvider");
}

And then in your ClusterFixture constructor:

public ClusterFixture()
{
    var builder = new TestClusterBuilder();
    builder.AddSiloBuilderConfigurator<SiloConfigurator>();
    builder.AddClientBuilderConfigurator<ClientConfiguretor>();
    this.Cluster = builder.Build();
    this.Cluster.Deploy();
}