-
Notifications
You must be signed in to change notification settings - Fork 256
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
Console.WriteLine for NetCore Projects #145
Console.WriteLine for NetCore Projects #145
Conversation
@jayaranigarg, |
scripts/Build.ps1
Outdated
$projectPath = Locate-Item -relativePath $project | ||
|
||
Write-Verbose "$msbuild /t:restore -verbosity:quiet $projectPath" | ||
& $msbuild /t:restore -verbosity:quiet $projectPath |
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.
quiet [](start = 34, length = 5)
can we make this minimal so we know whats going on instead of it looking like its stuck. Might want to change it on top(nuget restore) too.
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.
Done
@@ -3,6 +3,7 @@ | |||
<PropertyGroup> | |||
<TestFxRoot Condition="$(TestFxRoot) == ''">..\..\</TestFxRoot> | |||
<RepoRoot>..\..\</RepoRoot> | |||
<CommonRoot>$(TestFxRoot)src\Adapter\Common\</CommonRoot> |
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.
CommonRoot [](start = 2, length = 10)
Do we need 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.
No..removing
@@ -3,10 +3,15 @@ | |||
|
|||
namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices | |||
{ | |||
#pragma warning disable SA1649 // SA1649FileNameMustMatchTypeName | |||
|
|||
internal class Constants |
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.
Constants [](start = 19, length = 9)
why not just call this file constants.
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.
Changed name to Constants.cs
@@ -3,6 +3,7 @@ | |||
|
|||
namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices | |||
{ | |||
using System; |
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.
using System; [](start = 4, length = 13)
is this needed?
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.
No..removing
@@ -45,7 +51,7 @@ public void LoadAssemblyShouldThrowExceptionIfFileIsNotFound() | |||
[TestMethod] | |||
public void LoadAssemblyShouldLoadAssemblyInCurrentContext() | |||
{ | |||
var filePath = Assembly.GetExecutingAssembly().Location; | |||
var filePath = typeof(FileOperationsTests).GetTypeInfo().Assembly.Location; // Assembly.GetExecutingAssembly().Location; |
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.
// Assembly.GetExecutingAssembly().Location; [](start = 88, length = 44)
nit: remove.
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.
Done.
@@ -99,7 +105,7 @@ public void CreateNavigationSessionShouldReturnDiaSession() | |||
typeof(MockDiaSession).AssemblyQualifiedName, | |||
typeof(MockDiaNavigationData).AssemblyQualifiedName); | |||
|
|||
var diaSession = this.fileOperations.CreateNavigationSession(Assembly.GetExecutingAssembly().Location); | |||
var diaSession = this.fileOperations.CreateNavigationSession(typeof(FileOperationsTests).GetTypeInfo().Assembly.Location); // Assembly.GetExecutingAssembly().Location); |
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.
// Assembly.GetExecutingAssembly().Location); [](start = 139, length = 45)
nit:remove. Here and everywhere else.
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.
Done.
@@ -35,20 +35,47 @@ | |||
<WarningLevel>4</WarningLevel> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> | |||
<HintPath>..\..\..\packages\Castle.Core.4.0.0\lib\net45\Castle.Core.dll</HintPath> | |||
<Private>True</Private> |
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 remove.
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<Aliases>FrameworkV1</Aliases> | ||
</Reference> | ||
<Reference Include="Moq, Version=4.7.8.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Moq.4.7.8\lib\net45\Moq.dll</HintPath> | ||
<Private>True</Private> |
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 remove.
/// The universal test source host tests. | ||
/// </summary> | ||
[TestClass] | ||
public class UniversalTestSourceHostTests |
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.
UniversalTestSourceHostTests [](start = 17, length = 28)
why was this removed?
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 moved to shared code.
Do check if we need changes in test.cmd as well and check E2E. This is a great value add!! :) |
What's the rationale for naming all files |
@mayankbansal018 can you take a look please. These changes are similar to the PlatformAbstractions layer in TP. |
@codito : It would be way easier to identify which file we are editing in VS or any other editor. |
@jayaranigarg : Do update the nuspec files as well - removing dotnet folder, adding this new platform service and adding the new Tracer library as a dependency. |
scripts/test.ps1
Outdated
@@ -49,6 +49,8 @@ $TFT_Configuration = $Configuration | |||
$TFT_Pattern = $Pattern | |||
$TFT_Parallel = $Parallel | |||
$TFT_All = $All | |||
$TFB_NetCoreContainers =@("MSTestAdapter.PlatformServices.NetCore.UnitTests.dll") |
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.
nit: would fit better into the env variables on top where all the other patterns are.
scripts/test.ps1
Outdated
{ | ||
Write-Error "Unable to find vstest.console.exe at $vstestPath. Test aborted." | ||
} | ||
$TPV2VSTestPath = Get-TPv2VSTestPath |
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.
nit: local variables start with non-caps.
scripts/test.ps1
Outdated
function Get-TPv2VSTestPath | ||
{ | ||
$packagesPath = Locate-PackagesPath | ||
$vstestConsolePath = Join-Path -path $packagesPath "Microsoft.TestPlatform.15.0.1\tools\net46\vstest.console.exe" |
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.
variable on top please.
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 would not work in CDP scenarios where packages do not get copied over.
@@ -60,4 +58,9 @@ | |||
<ResolvedCompileFileDefinitions Remove="@(ResolvedCompileFileDefinitions)" Condition="'%(ResolvedCompileFileDefinitions.Filename)' == 'Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions' or '%(ResolvedCompileFileDefinitions.Filename)' == 'Microsoft.VisualStudio.TestPlatform.TestFramework'" /> | |||
</ItemGroup> | |||
</Target> | |||
<Target Name="PostBuild" AfterTargets="PostBuildEvent"> | |||
<Exec Command="xcopy /Y /I $(TargetDir)..\..\MSTest.CoreAdapter\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll $(TargetDir)" /> |
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.
$(OutDir)?
Write-Error "Unable to find vstest.console.exe at $vstestPath. Test aborted." | ||
} | ||
|
||
Write-Verbose "$vstestPath $testContainers $additionalArguments /logger:trx" |
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.
TPV2 vstest.console does not work? We might just want to use that everywhere for consistency. You can take this in the next PR.
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net45+win8+wpa81+wp8</PackageTargetFallback> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="..\MSTest.CoreAdapter.TestUtilities\ActionUtility.cs" Link="ActionUtility.cs" /> |
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.
No need to add cs files in new cs projects.
Test MetaPackage for .NET core
No description provided.