Skip to content

Commit dff1467

Browse files
authored
[tests] Allow ConfigurationSchema.json tests to run out of repo (#1790)
* [tests] ConformanceTests: Remove dependency on GetRepoRoot .. by changing the tests to expect `ConfigurationSchema.json` to be available next to the test assembly. * [tests] Deploy ConfigurationSchema.json to the test output dir * [tests] Avoid redundant tests in Redis Caching tests Both `Aspire.StackExchange.Redis.DistributedCaching`, and `Aspire.StackExchange.Redis.OutputCaching` have `ConfigurationSchema.json` which reference `Aspire.StackExchange.Redis` without adding anything more. But the tests for those two run validation for the `Aspire.StackExchange.Redis` schema, which is already done by the main tests. Instead of that: - `Aspire.StackExchange.Redis` - continue doing the validation tests - `Aspire.StackExchange.Redis.{Output,Distributed}Caching` - Run the validation test for the schema against the the project's own schema - And don't check for any invalid cases since there is nothing being added in the schema * Address review feedback from @ eerhardt to make path separators consistent in csproj
1 parent 6ad259d commit dff1467

File tree

42 files changed

+54
-70
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+54
-70
lines changed

tests/Aspire.Azure.AI.OpenAI.Tests/Aspire.Azure.AI.OpenAI.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8+
<None Include="$(RepoRoot)src\Components\Aspire.Azure.AI.OpenAI\ConfigurationSchema.json" CopyToOutputDirectory="PreserveNewest" />
9+
810
<ProjectReference Include="..\..\src\Components\Aspire.Azure.AI.OpenAI\Aspire.Azure.AI.OpenAI.csproj" />
911
<ProjectReference Include="..\Aspire.Components.Common.Tests\Aspire.Components.Common.Tests.csproj" />
1012
</ItemGroup>

tests/Aspire.Azure.AI.OpenAI.Tests/ConformanceTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ public class ConformanceTests : ConformanceTests<OpenAIClient, AzureOpenAISettin
2424

2525
protected override bool SupportsKeyedRegistrations => true;
2626

27-
protected override string JsonSchemaPath => "src/Components/Aspire.Azure.AI.OpenAI/ConfigurationSchema.json";
28-
2927
protected override string ValidJsonConfig => """
3028
{
3129
"Aspire": {

tests/Aspire.Azure.Data.Tables.Tests/Aspire.Azure.Data.Tables.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8+
<None Include="$(RepoRoot)src\Components\Aspire.Azure.Data.Tables\ConfigurationSchema.json" CopyToOutputDirectory="PreserveNewest" />
9+
810
<ProjectReference Include="..\..\src\Components\Aspire.Azure.Data.Tables\Aspire.Azure.Data.Tables.csproj" />
911
<ProjectReference Include="..\Aspire.Components.Common.Tests\Aspire.Components.Common.Tests.csproj" />
1012
</ItemGroup>

tests/Aspire.Azure.Data.Tables.Tests/ConformanceTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ public class ConformanceTests : ConformanceTests<TableServiceClient, AzureDataTa
2424

2525
protected override string ActivitySourceName => "Azure.Data.Tables.TableServiceClient";
2626

27-
protected override string JsonSchemaPath => "src/Components/Aspire.Azure.Data.Tables/ConfigurationSchema.json";
28-
2927
protected override string ValidJsonConfig => """
3028
{
3129
"Aspire": {

tests/Aspire.Azure.Messaging.ServiceBus.Tests/Aspire.Azure.Messaging.ServiceBus.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8+
<None Include="$(RepoRoot)src\Components\Aspire.Azure.Messaging.ServiceBus\ConfigurationSchema.json" CopyToOutputDirectory="PreserveNewest" />
9+
810
<ProjectReference Include="..\..\src\Components\Aspire.Azure.Messaging.ServiceBus\Aspire.Azure.Messaging.ServiceBus.csproj" />
911
<ProjectReference Include="..\Aspire.Components.Common.Tests\Aspire.Components.Common.Tests.csproj" />
1012
</ItemGroup>

tests/Aspire.Azure.Messaging.ServiceBus.Tests/ConformanceTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ public abstract class ConformanceTests : ConformanceTests<ServiceBusClient, Azur
2525

2626
protected override bool SupportsKeyedRegistrations => true;
2727

28-
protected override string JsonSchemaPath => "src/Components/Aspire.Azure.Messaging.ServiceBus/ConfigurationSchema.json";
29-
3028
protected override string ValidJsonConfig => """
3129
{
3230
"Aspire": {

tests/Aspire.Azure.Security.KeyVault.Tests/Aspire.Azure.Security.KeyVault.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8+
<None Include="$(RepoRoot)src\Components\Aspire.Azure.Security.KeyVault\ConfigurationSchema.json" CopyToOutputDirectory="PreserveNewest" />
9+
810
<ProjectReference Include="..\..\src\Components\Aspire.Azure.Security.KeyVault\Aspire.Azure.Security.KeyVault.csproj" />
911
<ProjectReference Include="..\Aspire.Components.Common.Tests\Aspire.Components.Common.Tests.csproj" />
1012
</ItemGroup>

tests/Aspire.Azure.Security.KeyVault.Tests/ConformanceTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ public class ConformanceTests : ConformanceTests<SecretClient, AzureSecurityKeyV
2929

3030
protected override bool CanConnectToServer => s_canConnectToServer.Value;
3131

32-
protected override string JsonSchemaPath => "src/Components/Aspire.Azure.Security.KeyVault/ConfigurationSchema.json";
33-
3432
protected override string ValidJsonConfig => """
3533
{
3634
"Aspire": {

tests/Aspire.Azure.Storage.Blobs.Tests/Aspire.Azure.Storage.Blobs.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8+
<None Include="$(RepoRoot)src\Components\Aspire.Azure.Storage.Blobs\ConfigurationSchema.json" CopyToOutputDirectory="PreserveNewest" />
9+
810
<ProjectReference Include="..\..\src\Components\Aspire.Azure.Storage.Blobs\Aspire.Azure.Storage.Blobs.csproj" />
911
<ProjectReference Include="..\Aspire.Components.Common.Tests\Aspire.Components.Common.Tests.csproj" />
1012
</ItemGroup>

tests/Aspire.Azure.Storage.Blobs.Tests/ConformanceTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ public class ConformanceTests : ConformanceTests<BlobServiceClient, AzureStorage
3434

3535
protected override bool CanConnectToServer => s_canConnectToServer.Value;
3636

37-
protected override string JsonSchemaPath => "src/Components/Aspire.Azure.Storage.Blobs/ConfigurationSchema.json";
38-
3937
protected override string ValidJsonConfig => """
4038
{
4139
"Aspire": {

0 commit comments

Comments
 (0)