-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Created New ManagedBatchParser project in .NetStandard #762
Conversation
-- Solution Restructured -- Project referred as Nuget Package
ManagedBatchParser project in .NetStandard
@NiranjanVirtuosity: is there a way to see the whole new solution? Could you just share it out so I can take a look? Or share your fork/branch perhaps? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at my comments. Particularly it looks like the resource strings haven't been split up properly.
<PreserveCompilationContext>true</PreserveCompilationContext> | ||
<DebugType>portable</DebugType> | ||
<PackageOutputPath>../../bin/nuget</PackageOutputPath> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are these changes regarding packaging for? I assume creating a Nuget package. Are we publishing that now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is the plan.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to do this?
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why the SQL Agent resource are in this file? The resource file should only contain the strings used by this project. Please update the resource files so (1) this project only contains it's resources and (2) the project this code was copied from no longer contains unused resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have optimized the String resource files by removing unused keys in Localization\SR.Strings. Now the Sr.cs files contain only needed strings used by the project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NiranjanVirtuosity I can't see where you're removing the batch parser string resources from the ServiceLayer project. Should we do that as well if they are no longer needed there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kburtram I have removed the unused strings from both ServiceLayer and ManagedBatchParser projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NiranjanVirtuosity hmm, I still see BatchParser_CommentNotTerminated
in the ServiceLayer project in your PR. I'd expect this and other BatchParser string to be removed since they are now duplicated in the new project. Do you know why these strings need to be duplicated in both projects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I removed those in serviceLayer now.
@NiranjanVirtuosity I see the code coverage number is dropped significantly by this PR. Please resolve this prior to merging. Likely you'll need to add the new assembly to the list of DLLs instrumented for the code coverage runs. |
… Microsoft.SqlTools.ManagedBatchParser.LocalizationTests
…ManagedBatchParser.LocalizationTests.csproj
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the CI builds are broken and the code coverage number is still way down. Also, please rename the new test project to have a more generic name so it could logically contain all batch parser tests.
using Xunit; | ||
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode; | ||
using ManagedBatchParserSr = Microsoft.SqlTools.ManagedBatchParser.SR; | ||
namespace Microsoft.SqlTools.ManagedBatchParser.LocalizationTests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please rename this project Microsoft.SqlTools.ManagedBatchParser.UnitTests
or something like that so it is a bit more generic? I think having an entire project for a singles localization test is a bit overkill, so if you do need a new test project it should be able to contain all batch parser tests.
As a side note, this test doesn't look particularly useful, and I think it's just for code coverage purposes. If it doesn't impact the code coverage numbers, you might consider removing this test.
@@ -4,6 +4,6 @@ | |||
<clear /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks there are binary .nupkg files in this PR. These should be the build output from the projects, so I don't think they should be checked into the Git repository, unless I'm missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nuget packages which were added in bin folder is a temporary solution to fix CI build issue. Once the Package get published it will be referred from Nuget.org
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NiranjanVirtuosity why are the projects using a binary PackageReference instead of a source ProjectReference? Typically code in the same solution would use a direct source reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a version conflict between the newly added ManagedBatchParser and these projects when we used project reference, So we decided to refer from NuGet.
<ItemGroup> | ||
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="150.18040.0-preview" /> | ||
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" /> | ||
<PackageReference Include="Microsoft.SqlTools.Hosting" Version="1.0.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this a package reference instead of a project reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a version conflict between the newly added ManagedBatchParser and these projects when we used project reference, So we decided to refer from NuGet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, explain what the conflict is about...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is error we get, if we use project reference.
Error: CS0433: The type [''] exists in both 'Microsoft.SqlServer.Smo, Version=15.1.18040.0, Culture=neutral, PublishKeyToken=89845dcd8080cc91' and 'Microsoft.SqlServer.Smo, Version=15.1.16168.50, Culture=neutral, PublishKeyToken=89845dcd8080cc91' [*.csproj]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a binary reference isn't the way to go here. it will need to be constantly updated for one. I'm not sure the error, but it appears there is some type of inconsistent SMO references. Please refer to the other projects that are successfully referencing these projects using ProjectReference in this solution for examples.
@NiranjanVirtuosity based on the "improved" code coverage metric it appears the new project isn't being included in the code coverage runs (i.e., since there aren't any new tests the likely explanation for improved code coverage is less code being instrumented). It would be a good idea to add the new project into the code coverage test runs so that the metric is accurately captured. |
…rser.UnitTests Include ManagedBatchParser into Code Coverage calculation Fix the CI issue in .csproj file
@NiranjanVirtuosity please remove the binary Nuget packages from the PR prior to merging to master. They should no longer be needed. Also, do we still need to generate the nupkg files during the build for the hosting project? If so, why? |
@@ -34,6 +33,7 @@ | |||
<ItemGroup> | |||
<ProjectReference Include="../Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" /> | |||
<ProjectReference Include="../Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" /> | |||
<ProjectReference Include="..\Microsoft.SqlTools.ManagedBatchParser\Microsoft.SqlTools.ManagedBatchParser.csproj" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would appear that the convention is to use forward slashes. Pick one and sick with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant both \ should become /
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced those.
…viceLayer.csproj -- <PackageOutputPath> ,<GeneratePackageOnBuild> removed from Hosting and ManagedBatchParser
test/CodeCoverage/codecoverage.bat
Outdated
@@ -67,6 +71,8 @@ SET SERVICECODECOVERAGE=FALSE | |||
|
|||
%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*]* [Microsoft.SqlTools.*]* -[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\netcoreapp2.2 | |||
|
|||
%CODECOVERAGETOOL% -mergeoutput -register:user -target:dotnet.exe -targetargs:"test %REPOROOT%\test\Microsoft.SqlTools.ManagedBatchParser.UnitTests\Microsoft.SqlTools.ManagedBatchParser.UnitTests.csproj %DOTNETCONFIG%" -oldstyle -filter:"+[Microsoft.SqlTools.*]* +[MicrosoftSqlToolsServiceLayer*]* +[MicrosoftSqlToolsCredentials*]* [Microsoft.SqlTools.*]* -[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\netcoreapp2.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
searchdirs
path should refer to Microsoft.SqlTools.ManagedBatchParser.UnitTests
bin directory rather than IntegrationTests directory.
test/DummyProject_13/UnitTest1.cs
Outdated
using System; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace DummyProject_13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this DummyProject
included in the PR?
-- BatchParser folder moved from ServiceLayer.Integration.Test to ManagedBatchParser.Unit.Tests
test/CodeCoverage/coverage_test.xml
Outdated
@@ -0,0 +1,5 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<CoverageSession xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="4.6.684.0"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this file being added? i.e., why do we need it checked in?
*.Designer.cs | ||
/test/CodeCoverage/codecoverage - Copy.bat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this line in the .gitignore? It doesn't seem like a general file name that will be in most peoples' workspaces.
@@ -12,7 +12,7 @@ | |||
<DefineConstants>$(DefineConstants);NETCOREAPP1_0;TRACE</DefineConstants> | |||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |||
<PreserveCompilationContext>true</PreserveCompilationContext> | |||
<DebugType>portable</DebugType> | |||
<DebugType>full</DebugType> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we checking in the .BAK files that get generated during code coverage runs. Please remove all extraneous content from the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NiranjanVirtuosity: can you address these really old comments? Please, try to be diligent in what you submit. There seems to be quite a bit of junk in your commits...
@NiranjanVirtuosity it looks like the AppVeyor build failed on the latest iteration. I also left some new comments related to various extraneous content in current PR iteration that should be removed prior to merging. |
-- testCases included for CodeCoverage in BatchParserTests.cs
-- gitignore igored in check-in -- Microsoft.SqlTools.ServiceLayer.csproj.BAK removed --
1. Microsoft.SqlTools.Hosting 2. Microsoft.SqlTools.ManagedBatchParser
We took this change in #774. |
-- Solution Restructured.
-- Created ManagedBatchParser as a independent one.
-- Project referred as Nuget Package.