mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
Remove code coverage from STS (#1537)
* WIP removal of code coverage * more coverage removed * more fixes * fix tests
This commit is contained in:
8
.gitignore
vendored
8
.gitignore
vendored
@@ -37,14 +37,6 @@ msbuild.log
|
||||
msbuild.err
|
||||
msbuild.wrn
|
||||
|
||||
# code coverage artifacts
|
||||
coverage.xml
|
||||
node_modules
|
||||
reports
|
||||
opencovertests.xml
|
||||
outputCobertura.xml
|
||||
sqltools.xml
|
||||
|
||||
# Cross building rootfs
|
||||
cross/rootfs/
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<Project>
|
||||
<Sdk Name="Microsoft.Build.CentralPackageVersions" Version="2.0.52" />
|
||||
<!-- Need full debugtype for code coverage -->
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Debug' and ('$(BuildingInsideVisualStudio)' != '' or '$(CodeCoverageBuild)' == 'true')">
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Debug' and ('$(BuildingInsideVisualStudio)' != '')">
|
||||
<DebugType>full</DebugType>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
[](https://travis-ci.org/Microsoft/sqltoolsservice)
|
||||
[](https://ci.appveyor.com/project/kburtram/sqltoolsservice)
|
||||
[](https://coveralls.io/github/Microsoft/sqltoolsservice?branch=main)
|
||||
|
||||
# Microsoft SQL Tools Service
|
||||
The SQL Tools Service is an application that provides core functionality for various SQL Server tools. These features include the following:
|
||||
@@ -32,7 +30,6 @@ so that we can ensure we are solving the right problems in the right way.
|
||||
- File a bug or feature request as an [issue](https://github.com/Microsoft/sqltoolsservice/issues)
|
||||
- Comment on existing issues to give your feedback on how they should be fixed/implemented
|
||||
- Contribute a bug fix or feature implementation by submitting a pull request
|
||||
- Contribute more unit tests for feature areas that lack good coverage
|
||||
- Review the pull requests that others submit to ensure they follow [established guidelines]
|
||||
(#pull-request-guidelines)
|
||||
|
||||
@@ -44,7 +41,7 @@ Here's a high level list of guidelines to follow to ensure your code contributio
|
||||
- Follow established guidelines for commit hygiene
|
||||
- Write unit tests to validate new features and bug fixes
|
||||
- Ensure that the 'Release' build and unit tests pass locally
|
||||
- Ensure that the AppVeyor build passes for your change
|
||||
|
||||
- Respond to all review feedback and final commit cleanup
|
||||
|
||||
### Practice Good Commit Hygiene
|
||||
@@ -147,8 +144,7 @@ on this check so that our project will always have good generated documentation.
|
||||
|
||||
- **The build and unit tests must run green**
|
||||
|
||||
Run all unit tests and code coverage tests to ensure all tests are passing and code coverage numbers
|
||||
and not negatively impacted by your change.
|
||||
Run all unit tests to ensure all tests are passing and are not negatively impacted by your change.
|
||||
|
||||
- **Respond to code review feedback**
|
||||
|
||||
|
||||
35
appveyor.yml
35
appveyor.yml
@@ -1,35 +0,0 @@
|
||||
# Note: This file isn't used in current setup. Instead its parts have been
|
||||
# set directly in the AppVeyor project settings - Environment, General, Build, Test sections.
|
||||
# This allows us to get Coveralls to run on PRs, but is more work than just using this file.
|
||||
# Preserving this here so that it's easy to replicate for others
|
||||
environment:
|
||||
COVERALLS_REPO_TOKEN:
|
||||
secure: KjiClJjgj/eB1zo52GBz/CHCmdxj6ut+q6+LD5G3sYhy9Hi4kEF6CWi8vOQPH1oy
|
||||
|
||||
# safelist
|
||||
branches:
|
||||
only:
|
||||
- main
|
||||
- dev
|
||||
|
||||
before_build:
|
||||
- appveyor-retry dotnet restore -v Minimal
|
||||
|
||||
build_script:
|
||||
- dotnet build src/Microsoft.SqlTools.ServiceLayer
|
||||
- dotnet build src/Microsoft.Kusto.ServiceLayer
|
||||
- dotnet build src/Microsoft.SqlTools.CoreServices
|
||||
|
||||
test_script:
|
||||
- dotnet test test/Microsoft.SqlTools.ServiceLayer.UnitTests
|
||||
- dotnet test test/Microsoft.Kusto.ServiceLayer.UnitTests
|
||||
- dotnet test test/Microsoft.SqlTools.Hosting.UnitTests
|
||||
|
||||
after_test:
|
||||
- cd test/CodeCoverage
|
||||
- npm install -g gulp-cli
|
||||
- runintegration.bat
|
||||
- cmd: packages\coveralls.io.1.3.4\tools\coveralls.net.exe --opencover coverage.xml
|
||||
|
||||
cache:
|
||||
- '%USERPROFILE%\.nuget\packages'
|
||||
@@ -33,7 +33,7 @@ steps:
|
||||
command: test
|
||||
projects: test/Microsoft.SqlTools.ServiceLayer.UnitTests
|
||||
testRunTitle: SqlTools.ServiceLayer.UnitTests
|
||||
arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'
|
||||
arguments: '--configuration $(buildConfiguration)'
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: 'dotnet test test/Microsoft.Kusto.ServiceLayer.UnitTests'
|
||||
@@ -41,7 +41,7 @@ steps:
|
||||
command: test
|
||||
projects: test/Microsoft.Kusto.ServiceLayer.UnitTests
|
||||
testRunTitle: Kusto.ServiceLayer.UnitTests
|
||||
arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'
|
||||
arguments: '--configuration $(buildConfiguration)'
|
||||
|
||||
- task: Npm@1
|
||||
displayName: 'npm install -g gulp-cli'
|
||||
@@ -50,13 +50,6 @@ steps:
|
||||
verbose: false
|
||||
customCommand: 'install -g gulp-cli'
|
||||
|
||||
- task: BatchScript@1
|
||||
displayName: 'Run script test/CodeCoverage/runintegration.bat'
|
||||
inputs:
|
||||
filename: test/CodeCoverage/runintegration.bat
|
||||
workingFolder: test/CodeCoverage
|
||||
enabled: false
|
||||
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||
displayName: 'ESRP CodeSigning - sha256 only'
|
||||
inputs:
|
||||
|
||||
@@ -64,7 +64,6 @@ steps:
|
||||
displayName: Building Integration Tests
|
||||
inputs:
|
||||
projects: '**/Microsoft.SqlTools.ServiceLayer.IntegrationTests.csproj'
|
||||
arguments: '/p:CodeCoverageBuild=true'
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: Running Integration Tests
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<RunSettings>
|
||||
<DataCollectionRunSettings>
|
||||
<DataCollectors>
|
||||
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<Configuration>
|
||||
<CodeCoverage>
|
||||
<ModulePaths>
|
||||
<Include>
|
||||
<ModulePath>.*SqlTools.*</ModulePath>
|
||||
</Include>
|
||||
<Exclude>
|
||||
<ModulePath>.*Microsoft\.SqlTools\.ServiceLayer\.IntegrationTests\.dll</ModulePath>
|
||||
<ModulePath>.*Microsoft\.SqlTools\.ServiceLayer\.UnitTests\.dll</ModulePath>
|
||||
<ModulePath>.*Nunit.*</ModulePath>
|
||||
<ModulePath>.*Moq.*</ModulePath>
|
||||
<ModulePath>.*Microsoft\.SqlTools\.Hosting\.UnitTests\.dll</ModulePath>
|
||||
<ModulePath>.*Microsoft\.SqlTools\.ManagedBatchParser\.IntegrationTests\.dll</ModulePath>
|
||||
<ModulePath>.*Microsoft\.SqlTools\.ServiceLayer\.PerfTests\.dll</ModulePath>
|
||||
<ModulePath>.*Microsoft\.SqlTools\.ServiceLayer\.Test.Common\.dll</ModulePath>
|
||||
<ModulePath>.*Microsoft\.SqlTools\.ServiceLayer\.TestDriver.*</ModulePath>
|
||||
<ModulePath>.*Microsoft\.SqlTools\.ServiceLayer\.TestDriver.Tests\.dll</ModulePath>
|
||||
</Exclude>
|
||||
</ModulePaths>
|
||||
<UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>
|
||||
<AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>
|
||||
<CollectFromChildProcesses>True</CollectFromChildProcesses>
|
||||
<CollectAspDotNet>False</CollectAspDotNet>
|
||||
</CodeCoverage>
|
||||
</Configuration>
|
||||
</DataCollector>
|
||||
</DataCollectors>
|
||||
</DataCollectionRunSettings>
|
||||
</RunSettings>
|
||||
@@ -22,8 +22,7 @@
|
||||
## Run Tests
|
||||
|
||||
The SQL Tools Service has several different types of tests such as unit tests, "connected" tests,
|
||||
integration tests, perf tests and stress tests. Additionally, there is also test configuration
|
||||
scripts to collect code coverage results.
|
||||
integration tests, perf tests and stress tests.
|
||||
|
||||
### Running Unit Tests
|
||||
|
||||
@@ -41,15 +40,4 @@ xUnit.net .NET CLI test runner (64-bit win10-x64)
|
||||
=== TEST EXECUTION SUMMARY ===
|
||||
Microsoft.SqlTools.ServiceLayer.Test Total: 434, Errors: 0, Failed: 0, Skipped: 0, Time: 21.139s
|
||||
SUMMARY: Total: 1 targets, Passed: 1, Failed: 0.
|
||||
```
|
||||
|
||||
### Collecting Code Coverage
|
||||
|
||||
> Code coverage requires a SQL Server instance installed on the localhost with Integrated Authentication
|
||||
> configured for the current user executing the test suite.
|
||||
|
||||
> Code coverage can only be collected from Windows at this time.
|
||||
|
||||
1. Run `npm install` from test/CodeCoverage directory.
|
||||
2. Run `runintegration.cmd` from test/CodeCoverage directory.
|
||||
3. Code coverage results will be available in the test/CodeCoverage/reports/index.html report.
|
||||
```
|
||||
@@ -17,7 +17,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||
.gitignore = .gitignore
|
||||
.mention-bot = .mention-bot
|
||||
.travis.yml = .travis.yml
|
||||
appveyor.yml = appveyor.yml
|
||||
BUILD.md = BUILD.md
|
||||
Directory.Build.props = Directory.Build.props
|
||||
global.json = global.json
|
||||
@@ -46,16 +45,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{F9978D78
|
||||
build.sh = build.sh
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeCoverage", "CodeCoverage", "{87D9C7D9-18F4-4AB9-B20D-66C02B6075E2}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
test\CodeCoverage\codecoverage.bat = test\CodeCoverage\codecoverage.bat
|
||||
test\CodeCoverage\gulpfile.js = test\CodeCoverage\gulpfile.js
|
||||
test\CodeCoverage\package.json = test\CodeCoverage\package.json
|
||||
test\CodeCoverage\packages.config = test\CodeCoverage\packages.config
|
||||
test\CodeCoverage\ReplaceText.vbs = test\CodeCoverage\ReplaceText.vbs
|
||||
test\CodeCoverage\runintegration.bat = test\CodeCoverage\runintegration.bat
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.SqlTools.Credentials", "src\Microsoft.SqlTools.Credentials\Microsoft.SqlTools.Credentials.csproj", "{0F761F76-E0F3-472E-B539-1815CE2BC696}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.SqlTools.Hosting", "src\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj", "{AAE1F8D1-F7AB-4ABE-A55B-D423393AB352}"
|
||||
@@ -246,7 +235,6 @@ Global
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{B7D21727-2926-452B-9610-3ADB0BB6D789} = {F9978D78-78FE-4E92-A7D6-D436B7683EF6}
|
||||
{87D9C7D9-18F4-4AB9-B20D-66C02B6075E2} = {AB9CA2B8-6F70-431C-8A1D-67479D8A7BE4}
|
||||
{0F761F76-E0F3-472E-B539-1815CE2BC696} = {2BBD7364-054F-4693-97CD-1C395E3E84A9}
|
||||
{AAE1F8D1-F7AB-4ABE-A55B-D423393AB352} = {2BBD7364-054F-4693-97CD-1C395E3E84A9}
|
||||
{835EDEB4-289B-4D6D-A9A0-609E43A87D6E} = {2BBD7364-054F-4693-97CD-1C395E3E84A9}
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
' ReplaceText.vbs
|
||||
' Copied from answer at http://stackoverflow.com/questions/1115508/batch-find-and-edit-lines-in-txt-file
|
||||
|
||||
Option Explicit
|
||||
|
||||
Const ForAppending = 8
|
||||
Const TristateFalse = 0 ' the value for ASCII
|
||||
Const Overwrite = True
|
||||
|
||||
Const WindowsFolder = 0
|
||||
Const SystemFolder = 1
|
||||
Const TemporaryFolder = 2
|
||||
|
||||
Dim FileSystem
|
||||
Dim Filename, OldText, NewText
|
||||
Dim OriginalFile, TempFile, Line
|
||||
Dim TempFilename
|
||||
|
||||
If WScript.Arguments.Count = 3 Then
|
||||
Filename = WScript.Arguments.Item(0)
|
||||
OldText = WScript.Arguments.Item(1)
|
||||
NewText = WScript.Arguments.Item(2)
|
||||
Else
|
||||
Wscript.Echo "Usage: ReplaceText.vbs <Filename> <OldText> <NewText>"
|
||||
Wscript.Quit
|
||||
End If
|
||||
|
||||
Set FileSystem = CreateObject("Scripting.FileSystemObject")
|
||||
Dim tempFolder: tempFolder = FileSystem.GetSpecialFolder(TemporaryFolder)
|
||||
TempFilename = FileSystem.GetTempName
|
||||
|
||||
If FileSystem.FileExists(TempFilename) Then
|
||||
FileSystem.DeleteFile TempFilename
|
||||
End If
|
||||
|
||||
Set TempFile = FileSystem.CreateTextFile(TempFilename, Overwrite, TristateFalse)
|
||||
Set OriginalFile = FileSystem.OpenTextFile(Filename)
|
||||
|
||||
Do Until OriginalFile.AtEndOfStream
|
||||
Line = OriginalFile.ReadLine
|
||||
|
||||
If InStr(Line, OldText) > 0 Then
|
||||
Line = Replace(Line, OldText, NewText)
|
||||
End If
|
||||
|
||||
TempFile.WriteLine(Line)
|
||||
Loop
|
||||
|
||||
OriginalFile.Close
|
||||
TempFile.Close
|
||||
|
||||
FileSystem.DeleteFile Filename
|
||||
FileSystem.MoveFile TempFilename, Filename
|
||||
|
||||
Wscript.Quit
|
||||
@@ -1,2 +0,0 @@
|
||||
print 'hi'
|
||||
:r cycle2.txt
|
||||
@@ -1,100 +0,0 @@
|
||||
SET WORKINGDIR=%~dp0
|
||||
SET REPOROOT=%WORKINGDIR%..\..
|
||||
SET NET5DIR=net6.0
|
||||
SET SQLTOOLSSERVICE_EXE=%REPOROOT%\src\Microsoft.SqlTools.ServiceLayer\bin\Integration\%NET5DIR%\win-x64\MicrosoftSqlToolsServiceLayer.exe
|
||||
|
||||
|
||||
REM clean-up results from previous run
|
||||
RMDIR %WORKINGDIR%reports\ /S /Q
|
||||
DEL %WORKINGDIR%coverage.xml
|
||||
MKDIR reports
|
||||
|
||||
REM Setup repo base path
|
||||
|
||||
REM backup current CSPROJ files
|
||||
COPY /Y %REPOROOT%\src\Microsoft.SqlTools.Credentials\Microsoft.SqlTools.Credentials.csproj %REPOROOT%\src\Microsoft.SqlTools.Credentials\Microsoft.SqlTools.Credentials.csproj.BAK
|
||||
COPY /Y %REPOROOT%\src\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj %REPOROOT%\src\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj.BAK
|
||||
COPY /Y %REPOROOT%\src\Microsoft.SqlTools.ManagedBatchParser\Microsoft.SqlTools.ManagedBatchParser.csproj %REPOROOT%\src\Microsoft.SqlTools.ManagedBatchParser\Microsoft.SqlTools.ManagedBatchParser.csproj.BAK
|
||||
COPY /Y %REPOROOT%\src\Microsoft.SqlTools.ServiceLayer\Microsoft.SqlTools.ServiceLayer.csproj %REPOROOT%\src\Microsoft.SqlTools.ServiceLayer\Microsoft.SqlTools.ServiceLayer.csproj.BAK
|
||||
COPY /Y %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider\Microsoft.SqlTools.ResourceProvider.csproj %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider\Microsoft.SqlTools.ResourceProvider.csproj.BAK
|
||||
COPY /Y %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.Core\Microsoft.SqlTools.ResourceProvider.Core.csproj %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.Core\Microsoft.SqlTools.ResourceProvider.Core.csproj.BAK
|
||||
COPY /Y %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.DefaultImpl\Microsoft.SqlTools.ResourceProvider.DefaultImpl.csproj %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.DefaultImpl\Microsoft.SqlTools.ResourceProvider.DefaultImpl.csproj.BAK
|
||||
|
||||
REM switch PDB type to Full since that is required by OpenCover for now
|
||||
REM we should remove this step on OpenCover supports portable PDB
|
||||
cscript /nologo ReplaceText.vbs %REPOROOT%\src\Microsoft.SqlTools.Credentials\Microsoft.SqlTools.Credentials.csproj portable full
|
||||
cscript /nologo ReplaceText.vbs %REPOROOT%\src\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj portable full
|
||||
cscript /nologo ReplaceText.vbs %REPOROOT%\src\Microsoft.SqlTools.ManagedBatchParser\Microsoft.SqlTools.ManagedBatchParser.csproj portable full
|
||||
cscript /nologo ReplaceText.vbs %REPOROOT%\src\Microsoft.SqlTools.ServiceLayer\Microsoft.SqlTools.ServiceLayer.csproj portable full
|
||||
cscript /nologo ReplaceText.vbs %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider\Microsoft.SqlTools.ResourceProvider.csproj portable full
|
||||
cscript /nologo ReplaceText.vbs %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.Core\Microsoft.SqlTools.ResourceProvider.Core.csproj portable full
|
||||
cscript /nologo ReplaceText.vbs %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.DefaultImpl\Microsoft.SqlTools.ResourceProvider.DefaultImpl.csproj portable full
|
||||
|
||||
REM rebuild the SqlToolsService project
|
||||
dotnet restore %REPOROOT%\src\Microsoft.SqlTools.Credentials\Microsoft.SqlTools.Credentials.csproj
|
||||
dotnet build %REPOROOT%\src\Microsoft.SqlTools.Credentials\Microsoft.SqlTools.Credentials.csproj %DOTNETCONFIG%
|
||||
dotnet restore %REPOROOT%\src\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj
|
||||
dotnet build %REPOROOT%\src\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj %DOTNETCONFIG%
|
||||
dotnet restore %REPOROOT%\src\Microsoft.SqlTools.ManagedBatchParser\Microsoft.SqlTools.ManagedBatchParser.csproj
|
||||
dotnet build %REPOROOT%\src\Microsoft.SqlTools.ManagedBatchParser\Microsoft.SqlTools.ManagedBatchParser.csproj %DOTNETCONFIG% -r win-x64
|
||||
dotnet restore %REPOROOT%\src\Microsoft.SqlTools.ServiceLayer\Microsoft.SqlTools.ServiceLayer.csproj
|
||||
dotnet build %REPOROOT%\src\Microsoft.SqlTools.ServiceLayer\Microsoft.SqlTools.ServiceLayer.csproj %DOTNETCONFIG% -r win-x64
|
||||
dotnet restore %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider\Microsoft.SqlTools.ResourceProvider.csproj
|
||||
dotnet build %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider\Microsoft.SqlTools.ResourceProvider.csproj %DOTNETCONFIG% -r win-x64
|
||||
dotnet restore %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.Core\Microsoft.SqlTools.ResourceProvider.Core.csproj
|
||||
dotnet build %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.Core\Microsoft.SqlTools.ResourceProvider.Core.csproj %DOTNETCONFIG% -r win-x64
|
||||
dotnet restore %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.DefaultImpl\Microsoft.SqlTools.ResourceProvider.DefaultImpl.csproj
|
||||
dotnet build %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.DefaultImpl\Microsoft.SqlTools.ResourceProvider.DefaultImpl.csproj %DOTNETCONFIG% -r win-x64
|
||||
|
||||
REM run the tests through OpenCover and generate a report
|
||||
dotnet restore %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.TestDriver\Microsoft.SqlTools.ServiceLayer.TestDriver.csproj
|
||||
dotnet build %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.TestDriver\Microsoft.SqlTools.ServiceLayer.TestDriver.csproj %DOTNETCONFIG% -r win7-x64
|
||||
dotnet restore %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.Test.Common\Microsoft.SqlTools.ServiceLayer.Test.Common.csproj
|
||||
dotnet build %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.Test.Common\Microsoft.SqlTools.ServiceLayer.Test.Common.csproj %DOTNETCONFIG%
|
||||
dotnet restore %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.UnitTests\Microsoft.SqlTools.ServiceLayer.UnitTests.csproj
|
||||
dotnet build %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.UnitTests\Microsoft.SqlTools.ServiceLayer.UnitTests.csproj %DOTNETCONFIG%
|
||||
dotnet restore %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.IntegrationTests\Microsoft.SqlTools.ServiceLayer.IntegrationTests.csproj
|
||||
dotnet build %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.IntegrationTests\Microsoft.SqlTools.ServiceLayer.IntegrationTests.csproj %DOTNETCONFIG%
|
||||
dotnet restore %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.TestDriver.Tests\Microsoft.SqlTools.ServiceLayer.TestDriver.Tests.csproj
|
||||
dotnet build %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.TestDriver.Tests\Microsoft.SqlTools.ServiceLayer.TestDriver.Tests.csproj %DOTNETCONFIG%
|
||||
dotnet restore %REPOROOT%\test\Microsoft.SqlTools.ManagedBatchParser.IntegrationTests\Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.csproj
|
||||
dotnet build %REPOROOT%\test\Microsoft.SqlTools.ManagedBatchParser.IntegrationTests\Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.csproj %DOTNETCONFIG%
|
||||
|
||||
SET TEST_SERVER=localhost
|
||||
SET SERVICECODECOVERAGE=True
|
||||
SET CODECOVERAGETOOL="%WORKINGDIR%packages\OpenCover.4.6.684\tools\OpenCover.Console.exe"
|
||||
SET CODECOVERAGEOUTPUT=coverage.xml
|
||||
|
||||
REM dotnet.exe test %REPOROOT%\test\Microsoft.SqlTools.ServiceLayer.TestDriver.Tests\Microsoft.SqlTools.ServiceLayer.TestDriver.Tests.csproj %DOTNETCONFIG%"
|
||||
|
||||
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\%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\%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\%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\%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
|
||||
"%WORKINGDIR%packages\ReportGenerator.2.4.5.0\tools\ReportGenerator.exe" "-reports:coverage.xml" "-targetdir:%WORKINGDIR%\reports"
|
||||
|
||||
REM restore original project.json
|
||||
COPY /Y %REPOROOT%\src\Microsoft.SqlTools.Credentials\Microsoft.SqlTools.Credentials.csproj.BAK %REPOROOT%\src\Microsoft.SqlTools.Credentials\Microsoft.SqlTools.Credentials.csproj
|
||||
DEL %REPOROOT%\src\Microsoft.SqlTools.Credentials\Microsoft.SqlTools.Credentials.csproj.BAK
|
||||
COPY /Y %REPOROOT%\src\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj.BAK %REPOROOT%\src\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj
|
||||
DEL %REPOROOT%\src\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj.BAK
|
||||
COPY /Y %REPOROOT%\src\Microsoft.SqlTools.ManagedBatchParser\Microsoft.SqlTools.ManagedBatchParser.csproj.BAK %REPOROOT%\src\Microsoft.SqlTools.ManagedBatchParser\Microsoft.SqlTools.ManagedBatchParser.csproj
|
||||
DEL %REPOROOT%\src\Microsoft.SqlTools.ManagedBatchParser\Microsoft.SqlTools.ManagedBatchParser.csproj.BAK
|
||||
COPY /Y %REPOROOT%\src\Microsoft.SqlTools.ServiceLayer\Microsoft.SqlTools.ServiceLayer.csproj.BAK %REPOROOT%\src\Microsoft.SqlTools.ServiceLayer\Microsoft.SqlTools.ServiceLayer.csproj
|
||||
DEL %REPOROOT%\src\Microsoft.SqlTools.ServiceLayer\Microsoft.SqlTools.ServiceLayer.csproj.BAK
|
||||
COPY /Y %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider\Microsoft.SqlTools.ResourceProvider.csproj.BAK %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider\Microsoft.SqlTools.ResourceProvider.csproj
|
||||
DEL %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider\Microsoft.SqlTools.ResourceProvider.csproj.BAK
|
||||
COPY /Y %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.Core\Microsoft.SqlTools.ResourceProvider.Core.csproj.BAK %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.Core\Microsoft.SqlTools.ResourceProvider.Core.csproj
|
||||
DEL %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.Core\Microsoft.SqlTools.ResourceProvider.Core.csproj.BAK
|
||||
COPY /Y %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.DefaultImpl\Microsoft.SqlTools.ResourceProvider.DefaultImpl.csproj.BAK %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.DefaultImpl\Microsoft.SqlTools.ResourceProvider.DefaultImpl.csproj
|
||||
DEL %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.DefaultImpl\Microsoft.SqlTools.ResourceProvider.DefaultImpl.csproj.BAK
|
||||
|
||||
EXIT
|
||||
@@ -1,2 +0,0 @@
|
||||
print '2'
|
||||
:r TS-err-cycle1.txt
|
||||
@@ -1,107 +0,0 @@
|
||||
var gulp = require('gulp');
|
||||
var del = require('del');
|
||||
var request = require('request');
|
||||
var fs = require('fs');
|
||||
var gutil = require('gulp-util');
|
||||
var through = require('through2');
|
||||
var cproc = require('child_process');
|
||||
var os = require('os');
|
||||
|
||||
function nugetRestoreArgs(nupkg, options) {
|
||||
var args = new Array();
|
||||
if (os.platform() != 'win32') {
|
||||
args.push('./nuget.exe');
|
||||
}
|
||||
args.push('restore');
|
||||
args.push(nupkg);
|
||||
|
||||
var withValues = [
|
||||
'source',
|
||||
'configFile',
|
||||
'packagesDirectory',
|
||||
'solutionDirectory',
|
||||
'msBuildVersion'
|
||||
];
|
||||
|
||||
var withoutValues = [
|
||||
'noCache',
|
||||
'requireConsent',
|
||||
'disableParallelProcessing'
|
||||
];
|
||||
|
||||
withValues.forEach(function(prop) {
|
||||
var value = options[prop];
|
||||
if(value) {
|
||||
args.push('-' + prop);
|
||||
args.push(value);
|
||||
}
|
||||
});
|
||||
|
||||
withoutValues.forEach(function(prop) {
|
||||
var value = options[prop];
|
||||
if(value) {
|
||||
args.push('-' + prop);
|
||||
}
|
||||
});
|
||||
|
||||
args.push('-noninteractive');
|
||||
|
||||
return args;
|
||||
};
|
||||
|
||||
function nugetRestore(options) {
|
||||
options = options || {};
|
||||
options.nuget = options.nuget || './nuget.exe';
|
||||
if (os.platform() != 'win32') {
|
||||
options.nuget = 'mono';
|
||||
}
|
||||
|
||||
return through.obj(function(file, encoding, done) {
|
||||
var args = nugetRestoreArgs(file.path, options);
|
||||
cproc.execFile(options.nuget, args, function(err, stdout) {
|
||||
if (err) {
|
||||
throw new gutil.PluginError('gulp-nuget', err);
|
||||
}
|
||||
|
||||
gutil.log(stdout.trim());
|
||||
done(null, file);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
gulp.task('ext:nuget-download', function(done) {
|
||||
if(fs.existsSync('nuget.exe')) {
|
||||
return done();
|
||||
}
|
||||
|
||||
request.get('http://nuget.org/nuget.exe')
|
||||
.pipe(fs.createWriteStream('nuget.exe'))
|
||||
.on('close', done);
|
||||
});
|
||||
|
||||
gulp.task('ext:nuget-restore', function() {
|
||||
|
||||
var options = {
|
||||
configFile: './nuget.config',
|
||||
packagesDirectory: './packages'
|
||||
};
|
||||
|
||||
return gulp.src('./packages.config')
|
||||
.pipe(nugetRestore(options));
|
||||
});
|
||||
|
||||
|
||||
gulp.task('ext:code-coverage', function(done) {
|
||||
cproc.execFile('cmd.exe', [ '/c', 'codecoverage.bat' ], {maxBuffer: 1024 * 1000}, function(err, stdout) {
|
||||
if (err) {
|
||||
throw new gutil.PluginError('ext:code-coverage', err);
|
||||
}
|
||||
|
||||
gutil.log(stdout.trim());
|
||||
});
|
||||
return done();
|
||||
});
|
||||
|
||||
gulp.task('test', gulp.series('ext:nuget-download', 'ext:nuget-restore', 'ext:code-coverage'));
|
||||
|
||||
gulp.task('default', gulp.series('test'));
|
||||
3880
test/CodeCoverage/package-lock.json
generated
3880
test/CodeCoverage/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"name": "sqltoolsservice",
|
||||
"version": "0.1.0",
|
||||
"description": "SQL Tools Service Layer",
|
||||
"main": "gulpfile.js",
|
||||
"devDependencies": {
|
||||
"del": "^2.2.1",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-cli": "^2.3.0",
|
||||
"gulp-install": "^1.1.0",
|
||||
"request": "^2.73.0",
|
||||
"through2": "^2.0.3"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Microsoft/sqltoolsservice.git"
|
||||
},
|
||||
"author": "Microsoft",
|
||||
"license": "MIT"
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="OpenCover" version="4.6.684" /> <!-- TEST VERSION, MOVE TO RELEASED OFFICAL VERSION WHEN RELEASED TO NUGET -->
|
||||
<package id="OpenCoverToCoberturaConverter " version="0.2.4" />
|
||||
<package id="ReportGenerator" version="2.4.5" />
|
||||
<package id="coveralls.io" version="1.3.4" />
|
||||
</packages>
|
||||
@@ -1,4 +0,0 @@
|
||||
set DOTNETCONFIG=-c Integration
|
||||
|
||||
cmd /c npm install
|
||||
node ./node_modules/gulp/bin/gulp.js
|
||||
@@ -11,6 +11,7 @@ using Microsoft.SqlTools.Hosting.Protocol;
|
||||
using Microsoft.SqlTools.ServiceLayer.Admin.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.Admin;
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.AdminServices
|
||||
{
|
||||
@@ -39,7 +40,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.AdminServices
|
||||
/// <summary>
|
||||
/// Validate creating a database with valid input
|
||||
/// </summary>
|
||||
// [Test]
|
||||
[Test]
|
||||
public async Task CreateDatabaseWithValidInputTest()
|
||||
{
|
||||
var result = GetLiveAutoCompleteTestObjects();
|
||||
@@ -63,7 +64,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.AdminServices
|
||||
/// <summary>
|
||||
/// Get a default database info object
|
||||
/// </summary>
|
||||
// [Test]
|
||||
[Test]
|
||||
public async Task GetDefaultDatebaseInfoTest()
|
||||
{
|
||||
var result = GetLiveAutoCompleteTestObjects();
|
||||
@@ -83,8 +84,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.AdminServices
|
||||
/// <summmary>
|
||||
/// Get database info test
|
||||
/// </summary>
|
||||
/// Test is failing in code coverage runs. Reenable when stable.
|
||||
/// [Test]
|
||||
[Test]
|
||||
public async Task GetDatabaseInfoTest()
|
||||
{
|
||||
var results = GetLiveAutoCompleteTestObjects();
|
||||
|
||||
@@ -41,8 +41,7 @@ CREATE CERTIFICATE {1} WITH SUBJECT = 'Backup Encryption Certificate'; ";
|
||||
/// <summary>
|
||||
/// Get backup configuration info
|
||||
/// </summary>
|
||||
/// Test is failing in code coverage runs. Reenable when stable.
|
||||
///[Test]
|
||||
[Test]
|
||||
public async Task GetBackupConfigInfoTest()
|
||||
{
|
||||
string databaseName = "testbackup_" + new Random().Next(10000000, 99999999);
|
||||
|
||||
@@ -28,17 +28,8 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Driver
|
||||
/// </summary>
|
||||
public class ServiceTestDriver : TestDriverBase
|
||||
{
|
||||
|
||||
public const string ServiceCodeCoverageEnvironmentVariable = "SERVICECODECOVERAGE";
|
||||
|
||||
public const string CodeCoverageToolEnvironmentVariable = "CODECOVERAGETOOL";
|
||||
|
||||
public const string CodeCoverageOutputEnvironmentVariable = "CODECOVERAGEOUTPUT";
|
||||
|
||||
public const string ServiceHostEnvironmentVariable = "SQLTOOLSSERVICE_EXE";
|
||||
|
||||
public bool IsCoverageRun { get; set; }
|
||||
|
||||
private Process[] serviceProcesses;
|
||||
|
||||
private DateTime startTime;
|
||||
@@ -67,33 +58,6 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Driver
|
||||
"Please set SQLTOOLSSERVICE_EXE environment variable to location of exe");
|
||||
}
|
||||
|
||||
//setup the service host for code coverage if the envvar is enabled
|
||||
if (Environment.GetEnvironmentVariable(ServiceCodeCoverageEnvironmentVariable) == "True")
|
||||
{
|
||||
string coverageToolPath = Environment.GetEnvironmentVariable(CodeCoverageToolEnvironmentVariable);
|
||||
if (!string.IsNullOrWhiteSpace(coverageToolPath))
|
||||
{
|
||||
string serviceHostDirectory = Path.GetDirectoryName(serviceHostExecutable);
|
||||
if (string.IsNullOrWhiteSpace(serviceHostDirectory))
|
||||
{
|
||||
serviceHostDirectory = ".";
|
||||
}
|
||||
|
||||
string coverageOutput = Environment.GetEnvironmentVariable(CodeCoverageOutputEnvironmentVariable);
|
||||
if (string.IsNullOrWhiteSpace(coverageOutput))
|
||||
{
|
||||
coverageOutput = "coverage.xml";
|
||||
}
|
||||
|
||||
serviceHostArguments = $"-mergeoutput -target:{serviceHostExecutable} -targetargs:{serviceHostArguments} " +
|
||||
$"-register:user -oldstyle -filter:\"+[Microsoft.SqlTools.*]* -[xunit*]*\" -output:{coverageOutput} " +
|
||||
$"-searchdirs:{serviceHostDirectory};";
|
||||
serviceHostExecutable = coverageToolPath;
|
||||
|
||||
this.IsCoverageRun = true;
|
||||
}
|
||||
}
|
||||
|
||||
this.clientChannel = new StdioClientChannel(serviceHostExecutable, serviceHostArguments);
|
||||
this.protocolClient = new ProtocolEndpoint(clientChannel, MessageProtocolType.LanguageServer);
|
||||
}
|
||||
@@ -111,19 +75,6 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Driver
|
||||
await this.protocolClient.Start();
|
||||
await Task.Delay(1000); // Wait for the service host to start
|
||||
|
||||
// If this is a code coverage run, we need access to the service layer separate from open cover
|
||||
if (IsCoverageRun)
|
||||
{
|
||||
CancellationTokenSource cancelSource = new CancellationTokenSource();
|
||||
Task getServiceProcess = GetServiceProcess(cancelSource.Token);
|
||||
Task timeoutTask = Task.Delay(TimeSpan.FromSeconds(15), cancelSource.Token);
|
||||
if (await Task.WhenAny(getServiceProcess, timeoutTask) == timeoutTask)
|
||||
{
|
||||
cancelSource.Cancel();
|
||||
throw new Exception("Failed to capture service process");
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Successfully launched service");
|
||||
|
||||
// Setup events to queue for testing
|
||||
@@ -141,19 +92,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Driver
|
||||
/// </summary>
|
||||
public async Task Stop()
|
||||
{
|
||||
if (IsCoverageRun)
|
||||
{
|
||||
// Kill all the processes in the list
|
||||
foreach (Process p in serviceProcesses.Where(p => !p.HasExited))
|
||||
{
|
||||
p.Kill();
|
||||
}
|
||||
ServiceProcess?.WaitForExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
await this.protocolClient.Stop();
|
||||
}
|
||||
await this.protocolClient.Stop();
|
||||
}
|
||||
|
||||
private async Task GetServiceProcess(CancellationToken token)
|
||||
|
||||
@@ -16,24 +16,6 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Credentials
|
||||
public class SrTests
|
||||
{
|
||||
const string CredentialsServiceName = "MicrosoftSqlToolsCredentials.exe";
|
||||
/// <summary>
|
||||
/// Simple "test" to access string resources
|
||||
/// The purpose of this test is for code coverage. It's probably better to just
|
||||
/// exclude string resources in the code coverage report than maintain this test.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void SrStringsTest()
|
||||
{
|
||||
var culture = CredSR.Culture;
|
||||
CredSR.Culture = culture;
|
||||
Assert.True(CredSR.Culture == culture);
|
||||
|
||||
var CredentialsServiceInvalidCriticalHandle = CredSR.CredentialsServiceInvalidCriticalHandle;
|
||||
var CredentialsServicePasswordLengthExceeded = CredSR.CredentialsServicePasswordLengthExceeded;
|
||||
var CredentialsServiceTargetForDelete = CredSR.CredentialsServiceTargetForDelete;
|
||||
var CredentialsServiceTargetForLookup = CredSR.CredentialsServiceTargetForLookup;
|
||||
var CredentialServiceWin32CredentialDisposed = CredSR.CredentialServiceWin32CredentialDisposed;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SrStringsTestWithEnLocalization()
|
||||
|
||||
@@ -13,202 +13,6 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ServiceHost
|
||||
/// </summary>
|
||||
public class SrTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Simple "test" to access string resources
|
||||
/// The purpose of this test is for code coverage. It's probably better to just
|
||||
/// exclude string resources in the code coverage report than maintain this test.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void SrStringsTest()
|
||||
{
|
||||
var culture = SR.Culture;
|
||||
SR.Culture = culture;
|
||||
Assert.True(SR.Culture == culture);
|
||||
|
||||
var connectionServiceListDbErrorNullOwnerUri = SR.ConnectionServiceListDbErrorNullOwnerUri;
|
||||
var connectionParamsValidateNullConnection = SR.ConnectionParamsValidateNullConnection;
|
||||
var queryServiceCancelDisposeFailed = SR.QueryServiceCancelDisposeFailed;
|
||||
var queryServiceQueryCancelled = SR.QueryServiceQueryCancelled;
|
||||
var queryServiceDataReaderByteCountInvalid = SR.QueryServiceDataReaderByteCountInvalid;
|
||||
var queryServiceDataReaderCharCountInvalid = SR.QueryServiceDataReaderCharCountInvalid;
|
||||
var queryServiceDataReaderXmlCountInvalid = SR.QueryServiceDataReaderXmlCountInvalid;
|
||||
var queryServiceFileWrapperReadOnly = SR.QueryServiceFileWrapperReadOnly;
|
||||
var queryServiceAffectedOneRow = SR.QueryServiceAffectedOneRow;
|
||||
var queryServiceMessageSenderNotSql = SR.QueryServiceMessageSenderNotSql;
|
||||
var queryServiceResultSetNotRead = SR.QueryServiceResultSetNotRead;
|
||||
var queryServiceResultSetNoColumnSchema = SR.QueryServiceResultSetNoColumnSchema;
|
||||
var connectionServiceListDbErrorNotConnected = SR.ConnectionServiceListDbErrorNotConnected("..");
|
||||
var connectionServiceConnStringInvalidAuthType = SR.ConnectionServiceConnStringInvalidAuthType("..");
|
||||
var connectionServiceConnStringInvalidIntent = SR.ConnectionServiceConnStringInvalidIntent("..");
|
||||
var queryServiceAffectedRows = SR.QueryServiceAffectedRows(10);
|
||||
var queryServiceErrorFormat = SR.QueryServiceErrorFormat(1, 1, 1, 1, "\n", "..");
|
||||
var queryServiceQueryFailed = SR.QueryServiceQueryFailed("..");
|
||||
var workspaceServiceBufferPositionOutOfOrder = SR.WorkspaceServiceBufferPositionOutOfOrder(1, 2, 3, 4);
|
||||
var treeNodeError = SR.TreeNodeError;
|
||||
var serverNodeConnectionError = SR.ServerNodeConnectionError;
|
||||
var schemaHierarchyAggregates = SR.SchemaHierarchy_Aggregates;
|
||||
var SchemaHierarchy_ServerRoles = SR.SchemaHierarchy_ServerRoles;
|
||||
var SchemaHierarchy_ApplicationRoles = SR.SchemaHierarchy_ApplicationRoles;
|
||||
var SchemaHierarchy_Assemblies = SR.SchemaHierarchy_Assemblies;
|
||||
var SchemaHierarchy_AssemblyFiles = SR.SchemaHierarchy_AssemblyFiles;
|
||||
var SchemaHierarchy_AsymmetricKeys = SR.SchemaHierarchy_AsymmetricKeys;
|
||||
var SchemaHierarchy_DatabaseAsymmetricKeys = SR.SchemaHierarchy_DatabaseAsymmetricKeys;
|
||||
var SchemaHierarchy_DataCompressionOptions = SR.SchemaHierarchy_DataCompressionOptions;
|
||||
var SchemaHierarchy_Certificates = SR.SchemaHierarchy_Certificates;
|
||||
var SchemaHierarchy_FileTables = SR.SchemaHierarchy_FileTables;
|
||||
var SchemaHierarchy_DatabaseCertificates = SR.SchemaHierarchy_DatabaseCertificates;
|
||||
var SchemaHierarchy_CheckConstraints = SR.SchemaHierarchy_CheckConstraints;
|
||||
var SchemaHierarchy_Columns = SR.SchemaHierarchy_Columns;
|
||||
var SchemaHierarchy_Constraints = SR.SchemaHierarchy_Constraints;
|
||||
var SchemaHierarchy_Contracts = SR.SchemaHierarchy_Contracts;
|
||||
var SchemaHierarchy_Credentials = SR.SchemaHierarchy_Credentials;
|
||||
var SchemaHierarchy_ErrorMessages = SR.SchemaHierarchy_ErrorMessages;
|
||||
var SchemaHierarchy_ServerRoleMembership = SR.SchemaHierarchy_ServerRoleMembership;
|
||||
var SchemaHierarchy_DatabaseOptions = SR.SchemaHierarchy_DatabaseOptions;
|
||||
var SchemaHierarchy_DatabaseRoles = SR.SchemaHierarchy_DatabaseRoles;
|
||||
var SchemaHierarchy_RoleMemberships = SR.SchemaHierarchy_RoleMemberships;
|
||||
var SchemaHierarchy_DatabaseTriggers = SR.SchemaHierarchy_DatabaseTriggers;
|
||||
var SchemaHierarchy_DefaultConstraints = SR.SchemaHierarchy_DefaultConstraints;
|
||||
var SchemaHierarchy_Defaults = SR.SchemaHierarchy_Defaults;
|
||||
var SchemaHierarchy_Sequences = SR.SchemaHierarchy_Sequences;
|
||||
var SchemaHierarchy_Endpoints = SR.SchemaHierarchy_Endpoints;
|
||||
var SchemaHierarchy_EventNotifications = SR.SchemaHierarchy_EventNotifications;
|
||||
var SchemaHierarchy_ServerEventNotifications = SR.SchemaHierarchy_ServerEventNotifications;
|
||||
var SchemaHierarchy_ExtendedProperties = SR.SchemaHierarchy_ExtendedProperties;
|
||||
var SchemaHierarchy_FileGroups = SR.SchemaHierarchy_FileGroups;
|
||||
var SchemaHierarchy_ForeignKeys = SR.SchemaHierarchy_ForeignKeys;
|
||||
var SchemaHierarchy_FullTextCatalogs = SR.SchemaHierarchy_FullTextCatalogs;
|
||||
var SchemaHierarchy_FullTextIndexes = SR.SchemaHierarchy_FullTextIndexes;
|
||||
var SchemaHierarchy_Functions = SR.SchemaHierarchy_Functions;
|
||||
var SchemaHierarchy_Indexes = SR.SchemaHierarchy_Indexes;
|
||||
var SchemaHierarchy_InlineFunctions = SR.SchemaHierarchy_InlineFunctions;
|
||||
var SchemaHierarchy_Keys = SR.SchemaHierarchy_Keys;
|
||||
var SchemaHierarchy_LinkedServers = SR.SchemaHierarchy_LinkedServers;
|
||||
var SchemaHierarchy_LinkedServerLogins = SR.SchemaHierarchy_LinkedServerLogins;
|
||||
var SchemaHierarchy_Logins = SR.SchemaHierarchy_Logins;
|
||||
var SchemaHierarchy_MasterKey = SR.SchemaHierarchy_MasterKey;
|
||||
var SchemaHierarchy_MasterKeys = SR.SchemaHierarchy_MasterKeys;
|
||||
var SchemaHierarchy_MessageTypes = SR.SchemaHierarchy_MessageTypes;
|
||||
var SchemaHierarchy_MultiSelectFunctions = SR.SchemaHierarchy_MultiSelectFunctions;
|
||||
var SchemaHierarchy_Parameters = SR.SchemaHierarchy_Parameters;
|
||||
var SchemaHierarchy_PartitionFunctions = SR.SchemaHierarchy_PartitionFunctions;
|
||||
var SchemaHierarchy_PartitionSchemes = SR.SchemaHierarchy_PartitionSchemes;
|
||||
var SchemaHierarchy_Permissions = SR.SchemaHierarchy_Permissions;
|
||||
var SchemaHierarchy_PrimaryKeys = SR.SchemaHierarchy_PrimaryKeys;
|
||||
var schemaHierarchyPrimaryKeys = SR.SchemaHierarchy_PrimaryKeys;
|
||||
var schemaHierarchyProgrammability = SR.SchemaHierarchy_Programmability;
|
||||
var schemaHierarchyQueues = SR.SchemaHierarchy_Queues;
|
||||
var schemaHierarchyRemoteServiceBindings = SR.SchemaHierarchy_RemoteServiceBindings;
|
||||
var schemaHierarchyReturnedColumns = SR.SchemaHierarchy_ReturnedColumns;
|
||||
var schemaHierarchyRoles = SR.SchemaHierarchy_Roles;
|
||||
var schemaHierarchyRoutes = SR.SchemaHierarchy_Routes;
|
||||
var schemaHierarchyRules = SR.SchemaHierarchy_Rules;
|
||||
var schemaHierarchySchemas = SR.SchemaHierarchy_Schemas;
|
||||
var schemaHierarchySecurity = SR.SchemaHierarchy_Security;
|
||||
var schemaHierarchyServerObjects = SR.SchemaHierarchy_ServerObjects;
|
||||
var schemaHierarchyManagement = SR.SchemaHierarchy_Management;
|
||||
var schemaHierarchyServerTriggers = SR.SchemaHierarchy_ServerTriggers;
|
||||
var schemaHierarchyServiceBroker = SR.SchemaHierarchy_ServiceBroker;
|
||||
var schemaHierarchyServices = SR.SchemaHierarchy_Services;
|
||||
var schemaHierarchySignatures = SR.SchemaHierarchy_LogFiles;
|
||||
var schemaHierarchyStatistics = SR.SchemaHierarchy_Statistics;
|
||||
var schemaHierarchyStorage = SR.SchemaHierarchy_Storage;
|
||||
var schemaHierarchyStoredProcedures = SR.SchemaHierarchy_StoredProcedures;
|
||||
var schemaHierarchySymmetricKeys = SR.SchemaHierarchy_SymmetricKeys;
|
||||
var schemaHierarchySynonyms = SR.SchemaHierarchy_Synonyms;
|
||||
var schemaHierarchyTables = SR.SchemaHierarchy_Tables;
|
||||
var schemaHierarchyTriggers = SR.SchemaHierarchy_Triggers;
|
||||
var schemaHierarchyTypes = SR.SchemaHierarchy_Types;
|
||||
var schemaHierarchyUniqueKeys = SR.SchemaHierarchy_UniqueKeys;
|
||||
var schemaHierarchyUserDefinedDataTypes = SR.SchemaHierarchy_UserDefinedDataTypes;
|
||||
var schemaHierarchyUserDefinedTypes = SR.SchemaHierarchy_UserDefinedTypes;
|
||||
var schemaHierarchyUsers = SR.SchemaHierarchy_Users;
|
||||
var schemaHierarchyViews = SR.SchemaHierarchy_Views;
|
||||
var schemaHierarchyXmlIndexes = SR.SchemaHierarchy_XmlIndexes;
|
||||
var schemaHierarchyXMLSchemaCollections = SR.SchemaHierarchy_XMLSchemaCollections;
|
||||
var schemaHierarchyUserDefinedTableTypes = SR.SchemaHierarchy_UserDefinedTableTypes;
|
||||
var schemaHierarchyFilegroupFiles = SR.SchemaHierarchy_FilegroupFiles;
|
||||
var missingCaption = SR.MissingCaption;
|
||||
var schemaHierarchyBrokerPriorities = SR.SchemaHierarchy_BrokerPriorities;
|
||||
var schemaHierarchyCryptographicProviders = SR.SchemaHierarchy_CryptographicProviders;
|
||||
var schemaHierarchyDatabaseAuditSpecifications = SR.SchemaHierarchy_DatabaseAuditSpecifications;
|
||||
var schemaHierarchyDatabaseEncryptionKeys = SR.SchemaHierarchy_DatabaseEncryptionKeys;
|
||||
var schemaHierarchyEventSessions = SR.SchemaHierarchy_EventSessions;
|
||||
var schemaHierarchyFullTextStopLists = SR.SchemaHierarchy_FullTextStopLists;
|
||||
var schemaHierarchyResourcePools = SR.SchemaHierarchy_ResourcePools;
|
||||
var schemaHierarchyServerAudits = SR.SchemaHierarchy_ServerAudits;
|
||||
var schemaHierarchyServerAuditSpecifications = SR.SchemaHierarchy_ServerAuditSpecifications;
|
||||
var schemaHierarchySpatialIndexes = SR.SchemaHierarchy_SpatialIndexes;
|
||||
var schemaHierarchyWorkloadGroups = SR.SchemaHierarchy_WorkloadGroups;
|
||||
var schemaHierarchySqlFiles = SR.SchemaHierarchy_SqlFiles;
|
||||
var schemaHierarchyServerFunctions = SR.SchemaHierarchy_ServerFunctions;
|
||||
var schemaHierarchySqlType = SR.SchemaHierarchy_SqlType;
|
||||
var schemaHierarchyServerOptions = SR.SchemaHierarchy_ServerOptions;
|
||||
var schemaHierarchyDatabaseDiagrams = SR.SchemaHierarchy_DatabaseDiagrams;
|
||||
var schemaHierarchySystemTables = SR.SchemaHierarchy_SystemTables;
|
||||
var schemaHierarchyDatabases = SR.SchemaHierarchy_Databases;
|
||||
var schemaHierarchySystemContracts = SR.SchemaHierarchy_SystemContracts;
|
||||
var schemaHierarchySystemDatabases = SR.SchemaHierarchy_SystemDatabases;
|
||||
var schemaHierarchySystemMessageTypes = SR.SchemaHierarchy_SystemMessageTypes;
|
||||
var schemaHierarchySystemQueues = SR.SchemaHierarchy_SystemQueues;
|
||||
var schemaHierarchySystemServices = SR.SchemaHierarchy_SystemServices;
|
||||
var schemaHierarchySystemStoredProcedures = SR.SchemaHierarchy_SystemStoredProcedures;
|
||||
var schemaHierarchySystemViews = SR.SchemaHierarchy_SystemViews;
|
||||
var schemaHierarchyDataTierApplications = SR.SchemaHierarchy_DataTierApplications;
|
||||
var schemaHierarchyExtendedStoredProcedures = SR.SchemaHierarchy_ExtendedStoredProcedures;
|
||||
var schemaHierarchySystemAggregateFunctions = SR.SchemaHierarchy_SystemAggregateFunctions;
|
||||
var schemaHierarchySystemApproximateNumerics = SR.SchemaHierarchy_SystemApproximateNumerics;
|
||||
var schemaHierarchySystemBinaryStrings = SR.SchemaHierarchy_SystemBinaryStrings;
|
||||
var schemaHierarchySystemCharacterStrings = SR.SchemaHierarchy_SystemCharacterStrings;
|
||||
var schemaHierarchySystemCLRDataTypes = SR.SchemaHierarchy_SystemCLRDataTypes;
|
||||
var schemaHierarchySystemConfigurationFunctions = SR.SchemaHierarchy_SystemConfigurationFunctions;
|
||||
var schemaHierarchySystemCursorFunctions = SR.SchemaHierarchy_SystemCursorFunctions;
|
||||
var schemaHierarchySystemDataTypes = SR.SchemaHierarchy_SystemDataTypes;
|
||||
var schemaHierarchySystemDateAndTime = SR.SchemaHierarchy_SystemDateAndTime;
|
||||
var schemaHierarchySystemDateAndTimeFunctions = SR.SchemaHierarchy_SystemDateAndTimeFunctions;
|
||||
var schemaHierarchySystemExactNumerics = SR.SchemaHierarchy_SystemExactNumerics;
|
||||
var schemaHierarchySystemFunctions = SR.SchemaHierarchy_SystemFunctions;
|
||||
var schemaHierarchySystemHierarchyIdFunctions = SR.SchemaHierarchy_SystemHierarchyIdFunctions;
|
||||
var schemaHierarchySystemMathematicalFunctions = SR.SchemaHierarchy_SystemMathematicalFunctions;
|
||||
var schemaHierarchySystemMetadataFunctionions = SR.SchemaHierarchy_SystemMetadataFunctions;
|
||||
var schemaHierarchySystemOtherDataTypes = SR.SchemaHierarchy_SystemOtherDataTypes;
|
||||
var schemaHierarchySystemOtherFunctions = SR.SchemaHierarchy_SystemOtherFunctions;
|
||||
var schemaHierarchySystemRowsetFunctions = SR.SchemaHierarchy_SystemRowsetFunctions;
|
||||
var schemaHierarchySystemSecurityFunctions = SR.SchemaHierarchy_SystemSecurityFunctions;
|
||||
var schemaHierarchySystemSpatialDataTypes = SR.SchemaHierarchy_SystemSpatialDataTypes;
|
||||
var schemaHierarchySystemStringFunctions = SR.SchemaHierarchy_SystemStringFunctions;
|
||||
var schemaHierarchySystemSystemStatisticalFunctions = SR.SchemaHierarchy_SystemSystemStatisticalFunctions;
|
||||
var schemaHierarchySystemTextAndImageFunctions = SR.SchemaHierarchy_SystemTextAndImageFunctions;
|
||||
var schemaHierarchySystemUnicodeCharacterStrings = SR.SchemaHierarchy_SystemUnicodeCharacterStrings;
|
||||
var schemaHierarchyAggregateFunctions = SR.SchemaHierarchy_AggregateFunctions;
|
||||
var schemaHierarchyScalarValuedFunctions = SR.SchemaHierarchy_ScalarValuedFunctions;
|
||||
var schemaHierarchyTableValuedFunctions = SR.SchemaHierarchy_TableValuedFunctions;
|
||||
var schemaHierarchySystemExtendedStoredProcedures = SR.SchemaHierarchy_SystemExtendedStoredProcedures;
|
||||
var schemaHierarchyBuiltInType = SR.SchemaHierarchy_BuiltInType;
|
||||
var schemaHierarchyBuiltInServerRole = SR.SchemaHierarchy_BuiltInServerRole;
|
||||
var schemaHierarchyUserWithPassword = SR.SchemaHierarchy_UserWithPassword;
|
||||
var schemaHierarchySearchPropertyList = SR.SchemaHierarchy_SearchPropertyList;
|
||||
var schemaHierarchySecurityPolicies = SR.SchemaHierarchy_SecurityPolicies;
|
||||
var schemaHierarchySecurityPredicates = SR.SchemaHierarchy_SecurityPredicates;
|
||||
var schemaHierarchyServerRole = SR.SchemaHierarchy_ServerRole;
|
||||
var schemaHierarchySearchPropertyLists = SR.SchemaHierarchy_SearchPropertyLists;
|
||||
var schemaHierarchyColumnStoreIndexes = SR.SchemaHierarchy_ColumnStoreIndexes;
|
||||
var schemaHierarchyTableTypeIndexes = SR.SchemaHierarchy_TableTypeIndexes;
|
||||
var schemaHierarchyServerInstance = SR.SchemaHierarchy_Server;
|
||||
var schemaHierarchySelectiveXmlIndexes = SR.SchemaHierarchy_SelectiveXmlIndexes;
|
||||
var schemaHierarchyXmlNamespaces = SR.SchemaHierarchy_XmlNamespaces;
|
||||
var schemaHierarchyXmlTypedPromotedPaths = SR.SchemaHierarchy_XmlTypedPromotedPaths;
|
||||
var schemaHierarchySqlTypedPromotedPaths = SR.SchemaHierarchy_SqlTypedPromotedPaths;
|
||||
var schemaHierarchyDatabaseScopedCredentials = SR.SchemaHierarchy_DatabaseScopedCredentials;
|
||||
var schemaHierarchyExternalDataSources = SR.SchemaHierarchy_ExternalDataSources;
|
||||
var schemaHierarchyExternalFileFormats = SR.SchemaHierarchy_ExternalFileFormats;
|
||||
var schemaHierarchyExternalResources = SR.SchemaHierarchy_ExternalResources;
|
||||
var schemaHierarchyExternalTables = SR.SchemaHierarchy_ExternalTables;
|
||||
var schemaHierarchyAlwaysEncryptedKeys = SR.SchemaHierarchy_AlwaysEncryptedKeys;
|
||||
var schemaHierarchyColumnMasterKeys = SR.SchemaHierarchy_ColumnMasterKeys;
|
||||
var schemaHierarchyColumnEncryptionKeys = SR.SchemaHierarchy_ColumnEncryptionKeys;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SrStringsTestWithEnLocalization()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user