Skip to content

Commit

Permalink
Fix LibraryVersions
Browse files Browse the repository at this point in the history
  • Loading branch information
RassK committed Oct 31, 2023
1 parent c125f3b commit fdcd1a9
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 11 deletions.
9 changes: 8 additions & 1 deletion build/LibraryVersions.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static class LibraryVersion
}
},
{
"TestApplication.SqlClient",
"TestApplication.SqlClient.Microsoft",
new List<PackageBuildInfo>
{
new("1.1.4"),
Expand All @@ -82,6 +82,13 @@ public static class LibraryVersion
new("5.1.2"),
}
},
{
"TestApplication.SqlClient.System",
new List<PackageBuildInfo>
{
new("4.8.5"),
}
},
{
"TestApplication.MongoDB",
new List<PackageBuildInfo>
Expand Down
10 changes: 9 additions & 1 deletion test/IntegrationTests/LibraryVersions.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static class LibraryVersion
new object[] { "8.1.1" },
#endif
};
public static readonly IReadOnlyCollection<object[]> SqlClient = new List<object[]>
public static readonly IReadOnlyCollection<object[]> SqlClientMicrosoft = new List<object[]>
{
#if DEFAULT_TEST_PACKAGE_VERSIONS
new object[] { string.Empty }
Expand All @@ -86,6 +86,14 @@ public static class LibraryVersion
new object[] { "3.1.2" },
new object[] { "4.1.1" },
new object[] { "5.1.2" },
#endif
};
public static readonly IReadOnlyCollection<object[]> SqlClientSystem = new List<object[]>
{
#if DEFAULT_TEST_PACKAGE_VERSIONS
new object[] { string.Empty }
#else
new object[] { "4.8.5" },
#endif
};
public static readonly IReadOnlyCollection<object[]> MongoDB = new List<object[]>
Expand Down
7 changes: 6 additions & 1 deletion test/IntegrationTests/SqlClientMicrosoftTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ public SqlClientMicrosoftTests(ITestOutputHelper output, SqlServerFixture sqlSer

public static IEnumerable<object[]> GetData()
{
return LibraryVersion.SqlClient;
#if NETFRAMEWORK
// 3.1.2 is not supported on .NET Framework. For details check: https://github.com/open-telemetry/opentelemetry-dotnet/issues/4243
return LibraryVersion.SqlClientMicrosoft.Where(x => x.First().ToString() != "3.1.2");
#else
return LibraryVersion.SqlClientMicrosoft;
#endif
}

[Theory]
Expand Down
7 changes: 1 addition & 6 deletions test/IntegrationTests/SqlClientSystemTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ public SqlClientSystemTests(ITestOutputHelper output, SqlServerFixture sqlServer

public static IEnumerable<object[]> GetData()
{
#if NETFRAMEWORK
// 3.1.2 is not supported on .NET Framework. For details check: https://github.com/open-telemetry/opentelemetry-dotnet/issues/4243
return LibraryVersion.SqlClient.Where(x => x.First().ToString() != "3.1.2");
#else
return LibraryVersion.SqlClient;
#endif
return LibraryVersion.SqlClientSystem;
}

[Theory]
Expand Down
14 changes: 12 additions & 2 deletions tools/LibraryVersionsGenerator/PackageVersionDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ internal static class PackageVersionDefinitions
},
new()
{
IntegrationName = "SqlClient",
IntegrationName = "SqlClientMicrosoft",
NugetPackageName = "Microsoft.Data.SqlClient",
TestApplicationName = "TestApplication.SqlClient",
TestApplicationName = "TestApplication.SqlClient.Microsoft",
Versions = new List<PackageVersion>
{
new("1.1.4"),
Expand All @@ -115,6 +115,16 @@ internal static class PackageVersionDefinitions
}
},
new()
{
IntegrationName = "SqlClientSystem",
NugetPackageName = "System.Data.SqlClient",
TestApplicationName = "TestApplication.SqlClient.System",
Versions = new List<PackageVersion>
{
new("*")
}
},
new()
{
IntegrationName = "MongoDB",
NugetPackageName = "MongoDB.Driver",
Expand Down

0 comments on commit fdcd1a9

Please sign in to comment.