From 9877af54b9bdb2c59b58e15aad2cd72b44875a6c Mon Sep 17 00:00:00 2001 From: Aasim Khan Date: Fri, 25 Jun 2021 13:53:01 -0700 Subject: [PATCH] Updating to dotnet 5.0 (#1218) * adding network file validator contract * updating to dotnet 5 * reverting change in pipeline * updating target framework to 5.0 * updating srgen and using target framework var * reverting srgen back to 3.1 * Adding dotnet 3.1 to build * Fixing task def * removing global json * updating other 3.1 refs to 5.0 * removing netcore folder from build.cake * Moving and renaming dotnet 3.1 task --- .travis.yml | 4 +-- .vscode/launch.json | 4 +-- RefreshDllsForTestRun.cmd | 4 +-- azure-pipelines/build.yml | 29 +++++++++++-------- azure-pipelines/integrationtests.yml | 2 +- build.cake | 4 +-- build.json | 8 ++--- .../netcore/executequery/jsonrpc.csproj | 2 +- global.json | 2 +- scripts/packages.config | 2 +- src/Directory.Build.props | 6 ++-- .../Microsoft.Kusto.ServiceLayer.csproj | 1 + .../Microsoft.SqlTools.Credentials.csproj | 1 + .../Microsoft.SqlTools.ServiceLayer.csproj | 1 + test/CodeCoverage/codecoverage.bat | 12 ++++---- test/Directory.Build.props | 2 +- ...rosoft.Kusto.ServiceLayer.UnitTests.csproj | 3 +- .../Driver/ServiceTestDriver.cs | 2 +- ...ft.SqlTools.ServiceLayer.TestDriver.csproj | 1 + ...SqlTools.ServiceLayer.TestEnvConfig.csproj | 1 + .../Connection/ConnectionServiceTests.cs | 6 ++-- 21 files changed, 53 insertions(+), 44 deletions(-) diff --git a/.travis.yml b/.travis.yml index fba7ebd4..05b3aa21 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ os: # - osx mono: none -dotnet: 3.1 +dotnet: 5.0 # safelist branches: @@ -25,7 +25,7 @@ env: before_install: - if [ $TRAVIS_OS_NAME == "linux" ]; then sudo apt-get update; - sudo apt-get install dotnet-sdk-3.1; + sudo apt-get install dotnet-sdk-5.0; else brew update; fi diff --git a/.vscode/launch.json b/.vscode/launch.json index 208aac21..6cf16192 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,7 @@ "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/src/Microsoft.SqlTools.ServiceLayer/bin/Debug/netcoreapp3.1/MicrosoftSqlToolsServiceLayer.dll", + "program": "${workspaceFolder}/src/Microsoft.SqlTools.ServiceLayer/bin/Debug/net5.0/MicrosoftSqlToolsServiceLayer.dll", "args": [], "cwd": "${workspaceFolder}/src/Microsoft.SqlTools.ServiceLayer", // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window @@ -24,7 +24,7 @@ "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/src/Microsoft.Kusto.ServiceLayer/bin/Debug/netcoreapp3.1/MicrosoftKustoServiceLayer.dll", + "program": "${workspaceFolder}/src/Microsoft.Kusto.ServiceLayer/bin/Debug/net5.0/MicrosoftKustoServiceLayer.dll", "args": [], "cwd": "${workspaceFolder}/src/Microsoft.Kusto.ServiceLayer", // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window diff --git a/RefreshDllsForTestRun.cmd b/RefreshDllsForTestRun.cmd index 486df580..b2e2be18 100644 --- a/RefreshDllsForTestRun.cmd +++ b/RefreshDllsForTestRun.cmd @@ -5,8 +5,8 @@ IF [%_BuildConfiguration%] NEQ [] GOTO Start SET _BuildConfiguration=Debug :Start -SET _PerfTestSourceLocation="%WORKINGDIR%\test\Microsoft.SqlTools.ServiceLayer.PerfTests\bin\%_BuildConfiguration%\netcoreapp3.1\win7-x64\publish" -SET _ServiceSourceLocation="%WORKINGDIR%\src\Microsoft.SqlTools.ServiceLayer\bin\%_BuildConfiguration%\netcoreapp3.1\win7-x64\publish" +SET _PerfTestSourceLocation="%WORKINGDIR%\test\Microsoft.SqlTools.ServiceLayer.PerfTests\bin\%_BuildConfiguration%\net5.0\win7-x64\publish" +SET _ServiceSourceLocation="%WORKINGDIR%\src\Microsoft.SqlTools.ServiceLayer\bin\%_BuildConfiguration%\net5.0\win7-x64\publish" diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index 35a82e2c..312ac50d 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -43,6 +43,11 @@ steps: projects: '$(Build.SourcesDirectory)/src/Microsoft.Kusto.ServiceLayer' arguments: '--configuration Release' +- task: UseDotNet@2 + displayName: 'Installing dotnet 3.1 to run srgen (To be removed after srgen is updated)' + inputs: + version: 3.1.406 + - task: BatchScript@1 displayName: 'Run script build.cmd' inputs: @@ -152,46 +157,46 @@ steps: - task: ArchiveFiles@1 displayName: 'Archive osx build' inputs: - rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/osx.10.11-x64/netcoreapp3.1' + rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/osx.10.11-x64/net5.0' includeRootFolder: false archiveType: tar - archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-osx-x64-netcoreapp3.1.tar.gz' + archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-osx-x64-net5.0.tar.gz' - task: ArchiveFiles@1 displayName: 'Archive rhel build' inputs: - rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/rhel.7.2-x64/netcoreapp3.1' + rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/rhel.7.2-x64/net5.0' includeRootFolder: false archiveType: tar - archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-rhel-x64-netcoreapp3.1.tar.gz' + archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-rhel-x64-net5.0.tar.gz' - task: ArchiveFiles@1 displayName: 'Archive windows 64 bit build' inputs: - rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win7-x64/netcoreapp3.1' + rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win7-x64/net5.0' includeRootFolder: false - archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp3.1.zip' + archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win-x64-net5.0.zip' - task: ArchiveFiles@1 displayName: 'Archive windows 32 bit build' inputs: - rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win7-x86/netcoreapp3.1' + rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win7-x86/net5.0' includeRootFolder: false - archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win-x86-netcoreapp3.1.zip' + archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win-x86-net5.0.zip' - task: ArchiveFiles@1 displayName: 'Archive windows10 arm 32 bit build' inputs: - rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win10-arm/netcoreapp3.1' + rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win10-arm/net5.0' includeRootFolder: false - archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win10-arm-netcoreapp3.1.zip' + archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win10-arm-net5.0.zip' - task: ArchiveFiles@1 displayName: 'Archive windows10 arm 64 bit build' inputs: - rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win10-arm64/netcoreapp3.1' + rootFolder: '$(Build.SourcesDirectory)/artifacts/publish/Microsoft.SqlTools.ServiceLayer/win10-arm64/net5.0' includeRootFolder: false - archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win10-arm64-netcoreapp3.1.zip' + archiveFile: '$(Build.SourcesDirectory)/artifacts/package/Microsoft.SqlTools.ServiceLayer-win10-arm64-net5.0.zip' - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: drop' diff --git a/azure-pipelines/integrationtests.yml b/azure-pipelines/integrationtests.yml index 888a6875..c41dc468 100644 --- a/azure-pipelines/integrationtests.yml +++ b/azure-pipelines/integrationtests.yml @@ -31,7 +31,7 @@ steps: inputs: SourceFolder: '$(Agent.TempDirectory)' Contents: '**\testsettings.json' - TargetFolder: '$(Build.SourcesDirectory)\test\Microsoft.SqlTools.ServiceLayer.IntegrationTests\bin\Debug\netcoreapp3.1' + TargetFolder: '$(Build.SourcesDirectory)\test\Microsoft.SqlTools.ServiceLayer.IntegrationTests\bin\Debug\net5.0' - task: DotNetCoreCLI@2 displayName: 'Run integration tests' diff --git a/build.cake b/build.cake index e03c5e3f..a6f60d1d 100644 --- a/build.cake +++ b/build.cake @@ -271,7 +271,7 @@ Task("TestCore") .Does(() => { var testProjects = buildPlan.TestProjects - .Where(pair => pair.Value.Any(framework => framework.Contains("netcoreapp"))) + .Where(pair => pair.Value.Any(framework => framework.Contains("net"))) .Select(pair => pair.Key) .ToList(); @@ -299,7 +299,7 @@ Task("Test") foreach (var framework in pair.Value) { // Testing against core happens in TestCore - if (framework.Contains("netcoreapp")) + if (framework.Contains("net")) { continue; } diff --git a/build.json b/build.json index 7d537d80..9a1826ef 100644 --- a/build.json +++ b/build.json @@ -3,20 +3,20 @@ "DotNetFolder": ".dotnet", "DotNetInstallScriptURL": "https://dotnet.microsoft.com/download/dotnet-core/scripts/v1/", "DotNetChannel": "preview", - "DotNetVersion": "3.1.202", + "DotNetVersion": "5.0.301", "BuildToolsFolder": ".tools", "ArtifactsFolder": "artifacts", "PackageName": "Microsoft.SqlTools.ServiceLayer", "TestProjects": { "Microsoft.SqlTools.ServiceLayer.UnitTests": [ - "netcoreapp3.1" + "net5.0" ], "Microsoft.Kusto.ServiceLayer.UnitTests": [ - "netcoreapp3.1" + "net5.0" ] }, "Frameworks": [ - "netcoreapp3.1" + "net5.0" ], "MainProjects": [ "Microsoft.SqlTools.Credentials", diff --git a/docs/samples/jsonrpc/netcore/executequery/jsonrpc.csproj b/docs/samples/jsonrpc/netcore/executequery/jsonrpc.csproj index f732588a..410b6ab7 100644 --- a/docs/samples/jsonrpc/netcore/executequery/jsonrpc.csproj +++ b/docs/samples/jsonrpc/netcore/executequery/jsonrpc.csproj @@ -1,6 +1,6 @@ - netcoreapp3.1 + net5.0 Exe diff --git a/global.json b/global.json index 3677c878..8d3e516a 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "3.1.406" + "version": "5.0.301" } } \ No newline at end of file diff --git a/scripts/packages.config b/scripts/packages.config index 3f2dadef..c36fb3fb 100644 --- a/scripts/packages.config +++ b/scripts/packages.config @@ -2,7 +2,7 @@ - + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 244e8bb6..ca59a05a 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -19,9 +19,9 @@ - netcoreapp3.1 - netcoreapp3.1 - netcoreapp3.1 + net5.0 + net5.0 + net5.0 portable diff --git a/src/Microsoft.Kusto.ServiceLayer/Microsoft.Kusto.ServiceLayer.csproj b/src/Microsoft.Kusto.ServiceLayer/Microsoft.Kusto.ServiceLayer.csproj index bd24d380..b5564549 100644 --- a/src/Microsoft.Kusto.ServiceLayer/Microsoft.Kusto.ServiceLayer.csproj +++ b/src/Microsoft.Kusto.ServiceLayer/Microsoft.Kusto.ServiceLayer.csproj @@ -4,6 +4,7 @@ MicrosoftKustoServiceLayer Exe false + false false false false diff --git a/src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj b/src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj index 20e70bf0..1d2a34ef 100644 --- a/src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj +++ b/src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj @@ -4,6 +4,7 @@ MicrosoftSqlToolsCredentials Exe false + false false false false diff --git a/src/Microsoft.SqlTools.ServiceLayer/Microsoft.SqlTools.ServiceLayer.csproj b/src/Microsoft.SqlTools.ServiceLayer/Microsoft.SqlTools.ServiceLayer.csproj index accc76cc..f905ac94 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Microsoft.SqlTools.ServiceLayer.csproj +++ b/src/Microsoft.SqlTools.ServiceLayer/Microsoft.SqlTools.ServiceLayer.csproj @@ -3,6 +3,7 @@ $(ServiceLayerTargetFramework) MicrosoftSqlToolsServiceLayer Exe + false false false false diff --git a/test/CodeCoverage/codecoverage.bat b/test/CodeCoverage/codecoverage.bat index f54dee7e..6aed5066 100644 --- a/test/CodeCoverage/codecoverage.bat +++ b/test/CodeCoverage/codecoverage.bat @@ -1,7 +1,7 @@ SET WORKINGDIR=%~dp0 SET REPOROOT=%WORKINGDIR%..\.. -SET NETCOREAPP3DIR=netcoreapp3.1 -SET SQLTOOLSSERVICE_EXE=%REPOROOT%\src\Microsoft.SqlTools.ServiceLayer\bin\Integration\%NETCOREAPP3DIR%\win7-x64\MicrosoftSqlToolsServiceLayer.exe +SET NET5DIR=net5.0 +SET SQLTOOLSSERVICE_EXE=%REPOROOT%\src\Microsoft.SqlTools.ServiceLayer\bin\Integration\%NET5DIR%\win7-x64\MicrosoftSqlToolsServiceLayer.exe REM clean-up results from previous run @@ -69,13 +69,13 @@ REM dotnet.exe test %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.TestDriver.T SET SERVICECODECOVERAGE=FALSE -%CODECOVERAGETOOL% -mergeoutput -register:user -target:dotnet.exe -targetargs:"test %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.TestDriver.Tests\Microsoft.SqlTools.ServiceLayer.TestDriver.Tests.csproj %DOTNETCONFIG%" -oldstyle -filter:"+[Microsoft.SqlTools.*]* +[MicrosoftSqlToolsServiceLayer*]* +[MicrosoftSqlToolsCredentials*]* -[xunit*]* -[Microsoft.SqlTools.ServiceLayer.Test*]* -[Microsoft.SqlTools.ServiceLayer.*Test*]* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Agent.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.DisasterRecovery.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Profiler.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Admin.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Management.*" -output:coverage.xml -hideskipped:All -searchdirs:%REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.TestDriver.Tests\bin\Debug\%NETCOREAPP3DIR% +%CODECOVERAGETOOL% -mergeoutput -register:user -target:dotnet.exe -targetargs:"test %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.TestDriver.Tests\Microsoft.SqlTools.ServiceLayer.TestDriver.Tests.csproj %DOTNETCONFIG%" -oldstyle -filter:"+[Microsoft.SqlTools.*]* +[MicrosoftSqlToolsServiceLayer*]* +[MicrosoftSqlToolsCredentials*]* -[xunit*]* -[Microsoft.SqlTools.ServiceLayer.Test*]* -[Microsoft.SqlTools.ServiceLayer.*Test*]* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Agent.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.DisasterRecovery.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Profiler.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Admin.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Management.*" -output:coverage.xml -hideskipped:All -searchdirs:%REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.TestDriver.Tests\bin\Debug\%NET5DIR% -%CODECOVERAGETOOL% -mergeoutput -register:user -target:dotnet.exe -targetargs:"test %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.UnitTests\Microsoft.SqlTools.ServiceLayer.UnitTests.csproj %DOTNETCONFIG%" -oldstyle -filter:"+[Microsoft.SqlTools.*]* +[MicrosoftSqlToolsServiceLayer*]* +[MicrosoftSqlToolsCredentials*]* -[xunit*]* -[Microsoft.SqlTools.ServiceLayer.Test*]* -[Microsoft.SqlTools.ServiceLayer.*Test*]* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Agent.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.DisasterRecovery.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Profiler.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Admin.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Management.*" -output:coverage.xml -hideskipped:All -searchdirs:%REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.UnitTests\bin\Debug\%NETCOREAPP3DIR% +%CODECOVERAGETOOL% -mergeoutput -register:user -target:dotnet.exe -targetargs:"test %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.UnitTests\Microsoft.SqlTools.ServiceLayer.UnitTests.csproj %DOTNETCONFIG%" -oldstyle -filter:"+[Microsoft.SqlTools.*]* +[MicrosoftSqlToolsServiceLayer*]* +[MicrosoftSqlToolsCredentials*]* -[xunit*]* -[Microsoft.SqlTools.ServiceLayer.Test*]* -[Microsoft.SqlTools.ServiceLayer.*Test*]* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Agent.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.DisasterRecovery.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Profiler.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Admin.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Management.*" -output:coverage.xml -hideskipped:All -searchdirs:%REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.UnitTests\bin\Debug\%NET5DIR% -%CODECOVERAGETOOL% -mergeoutput -register:user -target:dotnet.exe -targetargs:"test %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.IntegrationTests\Microsoft.SqlTools.ServiceLayer.IntegrationTests.csproj %DOTNETCONFIG%" -oldstyle -filter:"+[Microsoft.SqlTools.*]* +[MicrosoftSqlToolsServiceLayer*]* +[MicrosoftSqlToolsCredentials*]* -[xunit*]* -[Microsoft.SqlTools.ServiceLayer.Test*]* -[Microsoft.SqlTools.ServiceLayer.*Test*]* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Agent.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.DisasterRecovery.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Profiler.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Admin.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Management.*" -output:coverage.xml -hideskipped:All -searchdirs:%REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.IntegrationTests\bin\Debug\%NETCOREAPP3DIR% +%CODECOVERAGETOOL% -mergeoutput -register:user -target:dotnet.exe -targetargs:"test %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.IntegrationTests\Microsoft.SqlTools.ServiceLayer.IntegrationTests.csproj %DOTNETCONFIG%" -oldstyle -filter:"+[Microsoft.SqlTools.*]* +[MicrosoftSqlToolsServiceLayer*]* +[MicrosoftSqlToolsCredentials*]* -[xunit*]* -[Microsoft.SqlTools.ServiceLayer.Test*]* -[Microsoft.SqlTools.ServiceLayer.*Test*]* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Agent.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.DisasterRecovery.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Profiler.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Admin.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Management.*" -output:coverage.xml -hideskipped:All -searchdirs:%REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.IntegrationTests\bin\Debug\%NET5DIR% -%CODECOVERAGETOOL% -mergeoutput -register:user -target:dotnet.exe -targetargs:"test %REPOROOT%\test\Microsoft.SqlTools.ManagedBatchParser.IntegrationTests\Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.csproj %DOTNETCONFIG%" -oldstyle -filter:"+[Microsoft.SqlTools.*]* +[MicrosoftSqlToolsServiceLayer*]* +[MicrosoftSqlToolsCredentials*]* -[xunit*]* -[Microsoft.SqlTools.ServiceLayer.Test*]* -[Microsoft.SqlTools.ServiceLayer.*Test*]* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Agent.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.DisasterRecovery.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Profiler.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Admin.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Management.*" -output:coverage.xml -hideskipped:All -searchdirs:%REPOROOT%\test\Microsoft.SqlTools.ManagedBatchParser.IntegrationTests\bin\Debug\%NETCOREAPP3DIR% +%CODECOVERAGETOOL% -mergeoutput -register:user -target:dotnet.exe -targetargs:"test %REPOROOT%\test\Microsoft.SqlTools.ManagedBatchParser.IntegrationTests\Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.csproj %DOTNETCONFIG%" -oldstyle -filter:"+[Microsoft.SqlTools.*]* +[MicrosoftSqlToolsServiceLayer*]* +[MicrosoftSqlToolsCredentials*]* -[xunit*]* -[Microsoft.SqlTools.ServiceLayer.Test*]* -[Microsoft.SqlTools.ServiceLayer.*Test*]* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Agent.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.DisasterRecovery.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Profiler.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Admin.* -[MicrosoftSqlToolsServiceLayer]Microsoft.SqlTools.ServiceLayer.Management.*" -output:coverage.xml -hideskipped:All -searchdirs:%REPOROOT%\test\Microsoft.SqlTools.ManagedBatchParser.IntegrationTests\bin\Debug\%NET5DIR% REM Generate the report "%WORKINGDIR%packages\OpenCoverToCoberturaConverter.0.2.4.0\tools\OpenCoverToCoberturaConverter.exe" -input:coverage.xml -output:outputCobertura.xml -sources:%REPOROOT%\src\Microsoft.SqlTools.ServiceLayer diff --git a/test/Directory.Build.props b/test/Directory.Build.props index f4716f9e..f4fa7dd8 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -2,6 +2,6 @@ - netcoreapp3.1 + net5.0 \ No newline at end of file diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Microsoft.Kusto.ServiceLayer.UnitTests.csproj b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Microsoft.Kusto.ServiceLayer.UnitTests.csproj index 7c4b06ff..f8ab5198 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Microsoft.Kusto.ServiceLayer.UnitTests.csproj +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Microsoft.Kusto.ServiceLayer.UnitTests.csproj @@ -1,8 +1,7 @@ - netcoreapp3.1 - + $(TestProjectsTargetFramework) false diff --git a/test/Microsoft.SqlTools.ServiceLayer.TestDriver/Driver/ServiceTestDriver.cs b/test/Microsoft.SqlTools.ServiceLayer.TestDriver/Driver/ServiceTestDriver.cs index 8d6eea4f..4c56165f 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.TestDriver/Driver/ServiceTestDriver.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.TestDriver/Driver/ServiceTestDriver.cs @@ -52,7 +52,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Driver // Include a fallback value to for running tests within visual studio serviceHostExecutable = - @"..\..\..\..\..\src\Microsoft.SqlTools.ServiceLayer\bin\Debug\netcoreapp3.1\win7-x64\MicrosoftSqlToolsServiceLayer.exe"; + @"..\..\..\..\..\src\Microsoft.SqlTools.ServiceLayer\bin\Debug\net5.0\win7-x64\MicrosoftSqlToolsServiceLayer.exe"; if (!File.Exists(serviceHostExecutable)) { serviceHostExecutable = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "MicrosoftSqlToolsServiceLayer.exe"); diff --git a/test/Microsoft.SqlTools.ServiceLayer.TestDriver/Microsoft.SqlTools.ServiceLayer.TestDriver.csproj b/test/Microsoft.SqlTools.ServiceLayer.TestDriver/Microsoft.SqlTools.ServiceLayer.TestDriver.csproj index aa1df865..6b850573 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.TestDriver/Microsoft.SqlTools.ServiceLayer.TestDriver.csproj +++ b/test/Microsoft.SqlTools.ServiceLayer.TestDriver/Microsoft.SqlTools.ServiceLayer.TestDriver.csproj @@ -2,6 +2,7 @@ $(TestProjectsTargetFramework) false + false false false $(DefineConstants);NETCOREAPP1_0 diff --git a/test/Microsoft.SqlTools.ServiceLayer.TestEnvConfig/Microsoft.SqlTools.ServiceLayer.TestEnvConfig.csproj b/test/Microsoft.SqlTools.ServiceLayer.TestEnvConfig/Microsoft.SqlTools.ServiceLayer.TestEnvConfig.csproj index 4b197306..d450ed42 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.TestEnvConfig/Microsoft.SqlTools.ServiceLayer.TestEnvConfig.csproj +++ b/test/Microsoft.SqlTools.ServiceLayer.TestEnvConfig/Microsoft.SqlTools.ServiceLayer.TestEnvConfig.csproj @@ -3,6 +3,7 @@ $(TestProjectsTargetFramework) Microsoft.SqlTools.ServiceLayer.TestEnvConfig Exe + false true false false diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Connection/ConnectionServiceTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Connection/ConnectionServiceTests.cs index 0570a1c6..6a31bf2f 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Connection/ConnectionServiceTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Connection/ConnectionServiceTests.cs @@ -64,7 +64,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Connection // Given a connection that times out and responds to cancellation var mockConnection = new Mock { CallBase = true }; - CancellationToken token; + CancellationToken token = new CancellationToken(); bool ready = false; mockConnection.Setup(x => x.OpenAsync(It.IsAny())) .Callback(t => @@ -125,7 +125,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Connection // Given a connection that times out and responds to cancellation var mockConnection = new Mock { CallBase = true }; - CancellationToken token; + CancellationToken token = new CancellationToken(); bool ready = false; mockConnection.Setup(x => x.OpenAsync(It.IsAny())) .Callback(t => @@ -193,7 +193,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Connection // Given a connection that times out and responds to cancellation var mockConnection = new Mock { CallBase = true }; - CancellationToken token; + CancellationToken token = new CancellationToken(); bool ready = false; mockConnection.Setup(x => x.OpenAsync(It.IsAny())) .Callback(t =>