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

Make TestingSiloHost obsolete #2919

Merged
merged 1 commit into from
Apr 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/OrleansTestingHost/TestingSiloHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace Orleans.TestingHost
/// Also make sure that your test project references your test grains and test grain interfaces
/// projects, and has CopyLocal=True set on those references [which should be the default].
/// </remarks>
[Obsolete("Use TestCluster", false)]
public class TestingSiloHost
{
/// <summary> Single instance of TestingSiloHost </summary>
Expand Down
9 changes: 9 additions & 0 deletions test/Tester/CollectionFixtures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,13 @@ public class DefaultClusterTestCollection : ICollectionFixture<DefaultClusterFix

[CollectionDefinition(TestEnvironmentFixture.DefaultCollection)]
public class TestEnvironmentFixtureCollection : ICollectionFixture<TestEnvironmentFixture> { }

public abstract class BaseAzureTestClusterFixture : BaseTestClusterFixture
{
protected override void CheckPreconditionsOrThrow()
{
base.CheckPreconditionsOrThrow();
TestUtils.CheckForAzureStorage();
}
}
}
9 changes: 0 additions & 9 deletions test/TesterAzureUtils/CollectionFixtures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,4 @@ public class DefaultClusterTestCollection : ICollectionFixture<DefaultClusterFix

[CollectionDefinition(TestEnvironmentFixture.DefaultCollection)]
public class TestEnvironmentFixtureCollection : ICollectionFixture<TestEnvironmentFixture> { }

public abstract class BaseAzureTestClusterFixture : BaseTestClusterFixture
{
protected override void CheckPreconditionsOrThrow()
{
base.CheckPreconditionsOrThrow();
TestUtils.CheckForAzureStorage();
}
}
}
18 changes: 10 additions & 8 deletions test/TesterInternal/GeoClusterTests/BasicLogTestGrainTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@
using UnitTests.GrainInterfaces;
using Orleans.TestingHost;
using Xunit;
using Assert = Xunit.Assert;
using TestExtensions;
using Tester;

namespace Tests.GeoClusterTests
{
[TestCategory("GeoCluster")]
public class BasicLogTestGrainTests : IClassFixture<BasicLogTestGrainTests.Fixture>
{
private readonly Fixture fixture;
private Random random;

public class Fixture : BaseTestClusterFixture
public class Fixture : BaseAzureTestClusterFixture
{
protected override TestCluster CreateTestCluster()
{
Expand All @@ -43,35 +44,36 @@ protected override TestCluster CreateTestCluster()
public BasicLogTestGrainTests(Fixture fixture)
{
this.fixture = fixture;
fixture.EnsurePreconditionsMet();
this.random = new Random();
}

[Fact, TestCategory("GeoCluster")]
[SkippableFact]
public async Task DefaultStorage()
{
await DoBasicLogTestGrainTest("TestGrains.LogTestGrainDefaultStorage");
}
[Fact, TestCategory("GeoCluster")]
[SkippableFact]
public async Task MemoryStorage()
{
await DoBasicLogTestGrainTest("TestGrains.LogTestGrainMemoryStorage");
}
[Fact, TestCategory("GeoCluster")]
[SkippableFact]
public async Task SharedStorage()
{
await DoBasicLogTestGrainTest("TestGrains.LogTestGrainSharedStateStorage");
}
[Fact, TestCategory("GeoCluster")]
[SkippableFact]
public async Task SharedLogStorage()
{
await DoBasicLogTestGrainTest("TestGrains.LogTestGrainSharedLogStorage");
}
[Fact, TestCategory("GeoCluster")]
[SkippableFact]
public async Task CustomStorage()
{
await DoBasicLogTestGrainTest("TestGrains.LogTestGrainCustomStorage");
}
[Fact, TestCategory("GeoCluster")]
[SkippableFact]
public async Task GsiStorage()
{
await DoBasicLogTestGrainTest("TestGrains.GsiLogTestGrain");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ await RunWithTimeout("Setup_Clusters", largesetup ? 120000 : 60000, async () =>
// Create two clusters, each with a single silo.
cluster0 = "cluster0";
cluster1 = "cluster1";
NewGeoCluster(globalserviceid, cluster0, largesetup ? 3 : 1, configurationcustomizer);
NewGeoCluster(globalserviceid, cluster1, largesetup ? 4 : 1, configurationcustomizer);
NewGeoCluster(globalserviceid, cluster0, (short)(largesetup ? 3 : 1), configurationcustomizer);
NewGeoCluster(globalserviceid, cluster1, (short)(largesetup ? 4 : 1), configurationcustomizer);

if (!largesetup)
{
Expand Down Expand Up @@ -508,7 +508,7 @@ public async Task ConflictResolution()
private List<GrainId> GetGrainsInClusterWithStatus(string clusterId, GrainDirectoryEntryStatus? status = null)
{
List<GrainId> grains = new List<GrainId>();
var silos = Clusters[clusterId].Silos;
var silos = Clusters[clusterId].Cluster.GetActiveSilos();
int totalSoFar = 0;
foreach (var silo in silos)
{
Expand Down
Loading