Closed cheenamalhotra closed 4 weeks ago
Running the tests on Windows with dotnet test Functional/System.Data.SqlClient.Tests.csproj
is showing me that both the -windows
and the -unix
tests are getting executed.
There was one failure in the -windows
execution on Windows, it's a Uap tests that maybe we can just delete:
[xUnit.net 00:00:13.09] System.Data.SqlClient.Tests.ExceptionTest.LocalDBNotSupportedOnUapTest [FAIL]
[xUnit.net 00:00:13.09] Assert.Throws() Failure
[xUnit.net 00:00:13.09] Expected: typeof(System.PlatformNotSupportedException)
[xUnit.net 00:00:13.09] Actual: (No exception was thrown)
[xUnit.net 00:00:13.09] Stack Trace:
[xUnit.net 00:00:13.09] C:\Users\calope\source\repos\maintenance-packages\src\System.Data.SqlClient\tests\FunctionalTests\ExceptionTest.cs(151,0): at System.Data.SqlClient.Tests.ExceptionTest.LocalDBNotSupportedOnUapTest()
Failed System.Data.SqlClient.Tests.ExceptionTest.LocalDBNotSupportedOnUapTest [1 s]
Error Message:
Assert.Throws() Failure
Expected: typeof(System.PlatformNotSupportedException)
Actual: (No exception was thrown)
Stack Trace:
at System.Data.SqlClient.Tests.ExceptionTest.LocalDBNotSupportedOnUapTest() in C:\Users\calope\source\repos\maintenance-packages\src\System.Data.SqlClient\tests\FunctionalTests\ExceptionTest.cs:line 151
There are some API compat failures that got uncovered:
/__w/1/s/.packages/microsoft.dotnet.apicompat.task/9.0.100-preview.2.24102.10/build/Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error : API compatibility errors between 'lib/net6.0/System.Data.SqlClient.dll' (left) and 'runtimes/unix/lib/net6.0/System.Data.SqlClient.dll' (right): [/__w/1/s/src/System.Data.SqlClient/src/System.Data.SqlClient.csproj]
##[error].packages/microsoft.dotnet.apicompat.task/9.0.100-preview.2.24102.10/build/Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) API compatibility errors between 'lib/net6.0/System.Data.SqlClient.dll' (left) and 'runtimes/unix/lib/net6.0/System.Data.SqlClient.dll' (right):
/__w/1/s/.packages/microsoft.dotnet.apicompat.task/9.0.100-preview.2.24102.10/build/Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error CP0001: Type 'System.Data.SqlTypes.SqlFileStream' exists on runtimes/unix/lib/net6.0/System.Data.SqlClient.dll but not on lib/net6.0/System.Data.SqlClient.dll [/__w/1/s/src/System.Data.SqlClient/src/System.Data.SqlClient.csproj]
##[error].packages/microsoft.dotnet.apicompat.task/9.0.100-preview.2.24102.10/build/Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error CP0001: (NETCORE_ENGINEERING_TELEMETRY=Build) Type 'System.Data.SqlTypes.SqlFileStream' exists on runtimes/unix/lib/net6.0/System.Data.SqlClient.dll but not on lib/net6.0/System.Data.SqlClient.dll
/__w/1/s/.packages/microsoft.dotnet.apicompat.task/9.0.100-preview.2.24102.10/build/Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error : API compatibility errors between 'lib/net6.0/System.Data.SqlClient.dll' (left) and 'runtimes/win/lib/net6.0/System.Data.SqlClient.dll' (right): [/__w/1/s/src/System.Data.SqlClient/src/System.Data.SqlClient.csproj]
##[error].packages/microsoft.dotnet.apicompat.task/9.0.100-preview.2.24102.10/build/Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) API compatibility errors between 'lib/net6.0/System.Data.SqlClient.dll' (left) and 'runtimes/win/lib/net6.0/System.Data.SqlClient.dll' (right):
/__w/1/s/.packages/microsoft.dotnet.apicompat.task/9.0.100-preview.2.24102.10/build/Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error CP0001: Type 'System.Data.SqlTypes.SqlFileStream' exists on runtimes/win/lib/net6.0/System.Data.SqlClient.dll but not on lib/net6.0/System.Data.SqlClient.dll [/__w/1/s/src/System.Data.SqlClient/src/System.Data.SqlClient.csproj]
##[error].packages/microsoft.dotnet.apicompat.task/9.0.100-preview.2.24102.10/build/Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error CP0001: (NETCORE_ENGINEERING_TELEMETRY=Build) Type 'System.Data.SqlTypes.SqlFileStream' exists on runtimes/win/lib/net6.0/System.Data.SqlClient.dll but not on lib/net6.0/System.Data.SqlClient.dll
/__w/1/s/.packages/microsoft.dotnet.apicompat.task/9.0.100-preview.2.24102.10/build/Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error : API breaking changes found. If those are intentional, the APICompat suppression file can be updated by rebuilding with '/p:ApiCompatGenerateSuppressionFile=true' [/__w/1/s/src/System.Data.SqlClient/src/System.Data.SqlClient.csproj]
##[error].packages/microsoft.dotnet.apicompat.task/9.0.100-preview.2.24102.10/build/Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) API breaking changes found. If those are intentional, the APICompat suppression file can be updated by rebuilding with '/p:ApiCompatGenerateSuppressionFile=true'
Edit: These are still showing up even after fixing the target platform vs OS discrepancy.
There are some API compat failures that got uncovered:
@cheenamalhotra I fixed the ApiCompat failures. When packing, we were generating the SqlFileStream type in the runtimes/win
and runtimes/unix
folders of the nupkg, but we were not generating the platform-agnostic one in the lib/
folder. So I changed the build condition for the Unsupported file to instead of building for unix only, to build for everything except windows.
The build passed locally, regular and with packing. Hopefully it passes in the CI too.
It worked! Now all that's left is fixing the test failures.
@cheenamalhotra I pushed a few commits to clean things up that would have been hard to discuss in PR reviews. Hope that works for you.
@cheenamalhotra please merge when this is ready from your side
Yay! 🎉
Reworking #84 over current 'main' after #111 was merged. Fixes https://github.com/dotnet/maintenance-packages/issues/83
Todo:
Address failures
Build driver project for all supported frameworks
Validate NuGet Package and binaries
Run and validate tests
When targeting
net462
, running the codetypeof(System.Data.SqlClient.SqlError).Assembly.CodeBase
returnsfile:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
, meaning we type forward to the shared framework, so we don't need to include that tfm in this new package version.When targeting
net6.0-windows
, the codetypeof(System.Data.SqlClient.SqlError).Assembly.CodeBase
returnsfile:///C:/Users/calope/source/repos/tools/AssemblyChecker/Downloader/bin/Debug/net6.0-windows/runtimes/win/lib/netstandard1.3/System.Data.SqlClient.dll
, the package DLL, so we need to include these suffixed tfms.