Skip to content

Commit

Permalink
Make TestingSiloHost obsolete (#2919)
Browse files Browse the repository at this point in the history
Migrate TestingClusterHost to use TestCluster.
Mark some tests as skippable.
  • Loading branch information
jdom authored and sergeybykov committed Apr 6, 2017
1 parent 4dbb6e6 commit 57e0cd8
Show file tree
Hide file tree
Showing 12 changed files with 174 additions and 224 deletions.
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

0 comments on commit 57e0cd8

Please sign in to comment.