Skip to content
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
11 changes: 9 additions & 2 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,14 @@
<NetStandardDriver Include="**/netcore/ref/Microsoft.Data.SqlClient*.csproj" />
<AKVProvider Include="**/add-ons/**/AzureKeyVaultProvider/*.csproj" />

<UnitTests Include="**/Common/Common.csproj" />
<UnitTests Include="**/tools/TDS/TDS/TDS.csproj" />
<UnitTests Include="**/tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj" />
<UnitTests Include="**/tools/TDS/TDS.Servers/TDS.Servers.csproj" />
<UnitTests Include="**/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" />
<UnitTestsProj Include="**/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj" />



<FunctionalTests Include="**/Common/Common.csproj" />
<FunctionalTests Include="**/tools/TDS/TDS/TDS.csproj" />
<FunctionalTests Include="**/tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj" />
Expand Down Expand Up @@ -221,6 +226,7 @@
-p:TestTargetOS=Windows$(TargetGroup)
--collect "Code coverage"
--results-directory $(ResultsDirectory)
--filter "category!=failing%26category!=flaky"
--logger:"trx;LogFilePrefix=Unit-Windows$(TargetGroup)-$(TestSet)"
</TestCommand>
<TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand>
Expand All @@ -241,8 +247,9 @@
-p:TestTargetOS=Unixnetcoreapp
--collect "Code coverage"
--results-directory $(ResultsDirectory)
--filter "category!=failing%26category!=flaky"
--logger:"trx;LogFilePrefix=Unit-Unixnetcoreapp-$(TestSet)"
</TestCommand>
</TestCommand>
<TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand>
</PropertyGroup>
<Message Text=">>> Running unit tests for Unix via command: $(TestCommand)"/>
Expand Down Expand Up @@ -321,7 +328,7 @@
<TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand>
</PropertyGroup>
<Message Text=">>> Running Manual test for Windows via command: $(TestCommand)" />
<Exec ConsoleToMsBuild="true" Command="$(TestCommand)" />

Check failure on line 331 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient (Win22_Azure_Sql net9_0_AnyCPU_ManagedSNI_2)

build.proj#L331

build.proj(331,5): Error MSB3073: The command " dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" --no-build -v n -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Project -p:TestSet=2 -p:TestTargetOS=Windowsnetcoreapp --collect "Code coverage" --results-directory TestResults --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" --logger:"trx;LogFilePrefix=Manual-Windowsnetcoreapp-2" " exited with code 1.

Check failure on line 331 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient (Win22_Azure_Sql net8_0_AnyCPU_ManagedSNI_3)

build.proj#L331

build.proj(331,5): Error MSB3073: The command " dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" --no-build -v n -p:Configuration=Release -p:TargetnetcoreVersion=net8.0 -p:ReferenceType=Project -p:TestSet=3 -p:TestTargetOS=Windowsnetcoreapp --collect "Code coverage" --results-directory TestResults --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" --logger:"trx;LogFilePrefix=Manual-Windowsnetcoreapp-3" " exited with code 1.

Check failure on line 331 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient (Win22_Azure_Sql net8_0_AnyCPU_ManagedSNI_3)

build.proj#L331

build.proj(331,5): Error MSB3073: The command " dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" --no-build -v n -p:Configuration=Release -p:TargetnetcoreVersion=net8.0 -p:ReferenceType=Project -p:TestSet=3 -p:TestTargetOS=Windowsnetcoreapp --collect "Code coverage" --results-directory TestResults --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" --logger:"trx;LogFilePrefix=Manual-Windowsnetcoreapp-3" " exited with code 1.

Check failure on line 331 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient (Win22_Azure_Sql net9_0_AnyCPU_ManagedSNI_3)

build.proj#L331

build.proj(331,5): Error MSB3073: The command " dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" --no-build -v n -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Project -p:TestSet=3 -p:TestTargetOS=Windowsnetcoreapp --collect "Code coverage" --results-directory TestResults --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" --logger:"trx;LogFilePrefix=Manual-Windowsnetcoreapp-3" " exited with code 1.

Check failure on line 331 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient (Win22_Azure_Sql net9_0_AnyCPU_ManagedSNI_3)

build.proj#L331

build.proj(331,5): Error MSB3073: The command " dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" --no-build -v n -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Project -p:TestSet=3 -p:TestTargetOS=Windowsnetcoreapp --collect "Code coverage" --results-directory TestResults --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" --logger:"trx;LogFilePrefix=Manual-Windowsnetcoreapp-3" " exited with code 1.

Check failure on line 331 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient (win11_Azure_Sql net9_0_AnyCPU_ManagedSNI_3)

build.proj#L331

build.proj(331,5): Error MSB3073: The command " dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" --no-build -v n -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Project -p:TestSet=3 -p:TestTargetOS=Windowsnetcoreapp --collect "Code coverage" --results-directory TestResults --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" --logger:"trx;LogFilePrefix=Manual-Windowsnetcoreapp-3" " exited with code 1.

Check failure on line 331 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient-Package (win11_Azure_Sql net9_0_AnyCPU_NativeSNI_3)

build.proj#L331

build.proj(331,5): Error MSB3073: The command " dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" --no-build -v n -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Package -p:TestSet=3 -p:TestTargetOS=Windowsnetcoreapp --collect "Code coverage" --results-directory TestResults --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" --logger:"trx;LogFilePrefix=Manual-Windowsnetcoreapp-3" " exited with code 1.

Check failure on line 331 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient

build.proj#L331

build.proj(331,5): Error MSB3073: The command " dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" --no-build -v n -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Project -p:TestSet=3 -p:TestTargetOS=Windowsnetcoreapp --collect "Code coverage" --results-directory TestResults --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" --logger:"trx;LogFilePrefix=Manual-Windowsnetcoreapp-3" " exited with code 1.
</Target>

<!-- Run all Manual tests applicable to Unix. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1718,8 +1718,11 @@ private void LoginNoFailover(ServerInfo serverInfo,
continue;
}

// If state != closed, indicates that the parser encountered an error while processing the
// login response (e.g. an explicit error token). Transient network errors that impact
// connectivity will result in parser state being closed.
if (_parser == null
|| TdsParserState.Closed != _parser.State
|| _parser.State != TdsParserState.Closed
|| IsDoNotRetryConnectError(sqlex)
|| timeout.IsExpired)
{
Expand Down Expand Up @@ -1999,6 +2002,9 @@ TimeoutTimer timeout
throw; // Caller will call LoginFailure()
}

// TODO: It doesn't make sense to connect to an azure sql server instance with a failover partner
// specified. Azure SQL Server does not support failover partners. Other availability technologies
// like Failover Groups should be used instead.
if (!ADP.IsAzureSqlServerEndpoint(connectionOptions.DataSource) && IsConnectionDoomed)
{
throw;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using Microsoft.Identity.Client;
using Microsoft.SqlServer.Server;
using System.Security.Authentication;
using System.Collections.Generic;

#if NETFRAMEWORK
using System.Reflection;
Expand Down Expand Up @@ -768,7 +769,7 @@ internal static Version GetAssemblyVersion()
/// <remarks>This array includes endpoint URLs for Azure SQL in global, Germany, US Government,
/// China, and Fabric environments. These endpoints are used to identify and interact with Azure SQL services
/// in their respective regions or environments.</remarks>
internal static readonly string[] s_azureSqlServerEndpoints = { AZURE_SQL,
internal static readonly List<string> s_azureSqlServerEndpoints = new() { AZURE_SQL,
AZURE_SQL_GERMANY,
AZURE_SQL_USGOV,
AZURE_SQL_CHINA,
Expand Down Expand Up @@ -808,7 +809,7 @@ internal static bool IsAzureSqlServerEndpoint(string dataSource)
}

// This method assumes dataSource parameter is in TCP connection string format.
private static bool IsEndpoint(string dataSource, string[] endpoints)
private static bool IsEndpoint(string dataSource, ICollection<string> endpoints)
{
int length = dataSource.Length;
// remove server port
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ internal static class DbConnectionStringDefaults

#if NETFRAMEWORK
internal const bool ConnectionReset = true;
internal static readonly bool TransparentNetworkIPResolution = !LocalAppContextSwitches.DisableTnirByDefault;
internal static bool TransparentNetworkIpResolution => !LocalAppContextSwitches.DisableTnirByDefault;
internal const string NetworkLibrary = "";
#endif
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ internal static class DEFAULT
internal const string FailoverPartnerSPN = DbConnectionStringDefaults.FailoverPartnerSPN;
internal const bool Context_Connection = DbConnectionStringDefaults.ContextConnection;
#if NETFRAMEWORK
internal static readonly bool TransparentNetworkIPResolution = DbConnectionStringDefaults.TransparentNetworkIPResolution;
internal static bool TransparentNetworkIPResolution => DbConnectionStringDefaults.TransparentNetworkIpResolution;
internal const bool Connection_Reset = DbConnectionStringDefaults.ConnectionReset;
internal const string Network_Library = DbConnectionStringDefaults.NetworkLibrary;
#endif // NETFRAMEWORK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private enum Keywords

#if NETFRAMEWORK
private bool _connectionReset = DbConnectionStringDefaults.ConnectionReset;
private bool _transparentNetworkIPResolution = DbConnectionStringDefaults.TransparentNetworkIPResolution;
private bool _transparentNetworkIPResolution = DbConnectionStringDefaults.TransparentNetworkIpResolution;
private string _networkLibrary = DbConnectionStringDefaults.NetworkLibrary;
#endif
#endregion //Fields
Expand Down Expand Up @@ -549,7 +549,7 @@ private void Reset(Keywords index)
_connectionReset = DbConnectionStringDefaults.ConnectionReset;
break;
case Keywords.TransparentNetworkIPResolution:
_transparentNetworkIPResolution = DbConnectionStringDefaults.TransparentNetworkIPResolution;
_transparentNetworkIPResolution = DbConnectionStringDefaults.TransparentNetworkIpResolution;
break;
case Keywords.NetworkLibrary:
_networkLibrary = DbConnectionStringDefaults.NetworkLibrary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using Microsoft.SqlServer.TDS.Servers;
using Xunit;

namespace Microsoft.Data.SqlClient.Tests
Expand Down Expand Up @@ -55,9 +56,11 @@ private string GetLocalizedErrorMessage(string culture)
Thread.CurrentThread.CurrentCulture = new CultureInfo(culture);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);

using TestTdsServer server = TestTdsServer.StartTestServer();
var connStr = server.ConnectionString;
connStr = connStr.Replace("localhost", "dummy");
using TdsServer server = new TdsServer(new TdsServerArguments());
server.Start();
var connStr = new SqlConnectionStringBuilder() {
DataSource = $"dummy,{server.EndPoint.Port}"
}.ConnectionString;
using SqlConnection connection = new SqlConnection(connStr);

try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
<Compile Include="SqlBulkCopyTest.cs" />
<Compile Include="SqlClientMetaDataCollectionNamesTest.cs" />
<Compile Include="SqlDataAdapterTest.cs" />
<Compile Include="SqlConnectionBasicTests.cs" />
<Compile Include="SqlConnectionReadOnlyRoutingTests.cs" />
<Compile Include="SqlCommandTest.cs" />
<Compile Include="SqlConnectionTest.cs" />
<Compile Include="AADAuthenticationTests.cs" />
Expand All @@ -66,8 +64,6 @@
<Compile Include="SqlMetaDataTest.cs" />
<Compile Include="SqlConnectionStringBuilderTest.cs" />
<Compile Include="SerializeSqlTypesTest.cs" />
<Compile Include="TestTdsServer.cs" />
<Compile Include="TestRoutingTdsServer.cs" />
<Compile Include="SqlHelperTest.cs" />
<Compile Include="..\..\src\Microsoft\Data\Common\MultipartIdentifier.cs" />
</ItemGroup>
Expand Down Expand Up @@ -96,6 +92,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Microsoft.SqlServer.Types" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="System.Configuration.ConfigurationManager" />
<PackageReference Include="System.Security.Cryptography.Pkcs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp'">
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading