Skip to content

Commit

Permalink
Make EndToEnd tests local-only
Browse files Browse the repository at this point in the history
Until they can be run in Helix
  • Loading branch information
eerhardt committed Feb 3, 2024
1 parent 20c3091 commit e4bf95c
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions tests/Aspire.EndToEnd.Tests/IntegrationServicesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public IntegrationServicesTests(IntegrationServicesFixture integrationServicesFi
_integrationServicesFixture = integrationServicesFixture;
}

[Theory]
[LocalOnlyTheory]
[InlineData("cosmos")]
[InlineData("mongodb")]
[InlineData("mysql")]
Expand All @@ -32,7 +32,7 @@ public async Task VerifyComponentWorks(string component)
Assert.True(response.IsSuccessStatusCode, responseContent);
}

[Fact]
[LocalOnlyFact]
public async Task KafkaComponentCanProduceAndConsume()
{
string topic = $"topic-{Guid.NewGuid()}";
Expand All @@ -46,11 +46,49 @@ public async Task KafkaComponentCanProduceAndConsume()
Assert.True(response.IsSuccessStatusCode, responseContent);
}

[Fact]
[LocalOnlyFact]
public async Task VerifyHealthyOnIntegrationServiceA()
{
// We wait until timeout for the /health endpoint to return successfully. We assume
// that components wired up into this project have health checks enabled.
await _integrationServicesFixture.IntegrationServiceA.WaitForHealthyStatusAsync("http");
}
}

// TODO: remove these attributes when the above tests are running in CI

public class LocalOnlyFactAttribute : FactAttribute
{
public override string Skip
{
get
{
// BUILD_BUILDID is defined by Azure Dev Ops

if (Environment.GetEnvironmentVariable("BUILD_BUILDID") != null)
{
return "LocalOnlyFactAttribute tests are not run as part of CI.";
}

return null!;
}
}
}

public class LocalOnlyTheoryAttribute : TheoryAttribute
{
public override string Skip
{
get
{
// BUILD_BUILDID is defined by Azure Dev Ops

if (Environment.GetEnvironmentVariable("BUILD_BUILDID") != null)
{
return "LocalOnlyTheoryAttribute tests are not run as part of CI.";
}

return null!;
}
}
}

0 comments on commit e4bf95c

Please sign in to comment.