-
Notifications
You must be signed in to change notification settings - Fork 59
Convert Test projects to SDK style projects. #517
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
Conversation
c000573
to
79e391c
Compare
--> | ||
<configuration> | ||
<config> | ||
<add key="globalPackagesFolder" value="$\..\packages" /> |
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 is $
in $\..\packages
? I can't easily find any mention of this behavior. (Environment variables are supported.)
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.
Apparently it is "local to this NuGet.Config", since you could have several configs getting inherited.
For the repositoryPath setting, you can specify an absolute path or relative path (recommended) using the $ token. The $ token is based on where the NuGet.Config is located (The $ token is actually relative to one level below the location of the NuGet.Config). So, if I have \Solutions\NuGet.Config and I want \Solutions\Packages I would need to specify $\..\Packages as the value.
@@ -5,7 +5,7 @@ | |||
<_TopDir>$(MSBuildThisFileDirectory)..\..</_TopDir> | |||
<_Runtime Condition=" '$(RUNTIME)' != '' ">$(RUNTIME)</_Runtime> | |||
<_Runtime Condition=" '$(RUNTIME)' == '' And '$(OS)' != 'Windows_NT' ">mono --debug</_Runtime> | |||
<_NUnit>$(_Runtime) packages\NUnit.ConsoleRunner.3.9.0\tools\nunit3-console.exe</_NUnit> | |||
<_NUnit>$(_Runtime) packages\nunit.consolerunner\3.9.0\tools\nunit3-console.exe</_NUnit> |
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.
@(PackageReference)
lowercases all the things? Interesting...
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.
And adds the slash...
@@ -33,7 +33,7 @@ | |||
<SetEnvironmentVariable Name="JAVA_INTEROP_LREF_LOG" Value="bin\Test$(Configuration)\l-%(_TestAssembly.Filename).txt" /> | |||
<SetEnvironmentVariable Name="JI_JVM_PATH" Value="$(JdkJvmPath)" /> | |||
<Exec | |||
Command="$(_NUnit) $(NUNIT_EXTRA) %(_TestAssembly.Identity) $(_Run) --result="TestResult-%(Filename).xml;format=nunit2" --output="bin\Test$(Configuration)\TestOutput-%(Filename).txt"" | |||
Command="$(_NUnit) $(NUNIT_EXTRA) %(_TestAssembly.Identity) $(_Run) --result="TestResult-%(Filename).xml" --output="bin\Test$(Configuration)\TestOutput-%(Filename).txt"" |
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 format=nunit2
not needed? Does AzDO recognize the default format? Did the default change?
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'm not sure why, but when I left it in there, the CI NUnit choked on it and said it wasn't a valid format. Removing it seems to work, the tests are still picked up for the test tab:
I think now it defaults to nunit3
. Given that NUnit 3.0 shipped in 2015, I'm more surprised that AzDO supported nunit2
. ;)
@@ -0,0 +1,31 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> |
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.
Should we rename this file to logcat-parse-Tests.csproj
so it matches the directory name?
(How is the output assembly determined, anyway? From enclosing directory name? .csproj
base name?)
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 can rename it. I'm pretty sure it's from the .csproj
name.
|
||
// One would expect this to be "Object" but it doesn't seem to be | ||
Assert.AreEqual (KotlinClassType.Class, klass_meta.ObjectType); | ||
Assert.AreEqual (KotlinClassType.Object, klass_meta.ObjectType); |
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 change seems weird; how'd it carries from the .csproj
migration?
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.
Apparently I had committed a bad .class
file previously. It got regenerated from the Kotlin as part of testing this, which now gave me the results I was previously expecting.
This PR converts all test projects in Java.Interop to "sdk-style" projects.
Some call-outs:
/tests
. Previously test projects were spread across/tests
,/src
, and/tools
.<Compile Include="**\*" />
, meaning you have to addExclude
s for all the test files.Dynamic-Tests.shproj
. We no longer use PCL's so the tests are now added directly to the single test project.NuGet.Config
specifying packages should get restored to/packages
. This is the way things have always worked, but switching to<PackageReference>
now restores them to the machine global package cache. Our testing infrastructure expectsnunit-console
andcsc
to be downloaded from NuGet and placed in a known location. The global package cache causes problems because it is in different places on different OS's and there's no easy way for MSBuild to know where it is.<PackageReference>
instead ofpackages.config
are stored differently so scripts and code were updated to find the packages. ie:packages.config
:packages/NUnit.ConsoleRunner.3.9.0
<PackageReference>
:packages/nunit.consolerunner/3.9.0
Test builds from before and after to ensure no tests were lost:
Before: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3228777&view=ms.vss-test-web.build-test-results-tab
After: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3233260&view=ms.vss-test-web.build-test-results-tab