Enable tests to compile with netstandard #15956
Conversation
Most of the tests have netstandard configurations and it doesn't compile. the changes here is to fix the configurations and the tests to compile. This is important step to get netfx tests compile too as we are in most of the time netfx fallback to netstandard configuration The changes include some fixes to compile teh sources too.
@weshaggard could you please have a look? Note this step to get the tests compile fine with netstandard but I believe we need to have a look later to the projects which not having netstandard configurations and decide if we need to enable it to other configurations (e.g netfx). FYI to @danmosemsft |
@@ -2,7 +2,6 @@ | |||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
<PropertyGroup> | |||
<BuildConfigurations> | |||
netstandard; |
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.
@weshaggard ignore removing this one. I'll try to get this back as I am ifdef the code specific to netcoreapp
@JeremyKuhne it looks the System.IO.Prots tests not stable. https://ci.dot.net/job/dotnet_corefx/job/master/job/windows_nt_debug_prtest/3121/ |
test Innerloop Windows_NT Debug Build and Test please |
Thanks for the heads up. @willdean We should open specific issues for the tests and work through them. I'll disable this particular one.
|
@JeremyKuhne the failed are 3 tests.
|
I'm going to put all of the ReadTimeout tests in an issue. I assume we need to have very generous thresholds and as such they'll need to move (at least in part) to outer loop. |
@@ -18,7 +18,7 @@ | |||
--> | |||
<Target Name="ConstructTestingHost" | |||
BeforeTargets="Build;BuildAllProjects" | |||
Condition="!Exists('$(ConstructSharedFxSem)') OR '$(ReconstructSharedFx)' == 'true'" > | |||
Condition="(!Exists('$(ConstructSharedFxSem)') OR '$(ReconstructSharedFx)' == 'true') And '$(TargetGroup)' != 'netfx'" > |
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 recently deleted this file so you can undo this 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 am seeing the conflict :-)
netstandard; | ||
netstandard1.1; |
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.
Did you figure out why the netstandard1.1 configuration was picked? I'm mainly interested because we might need to add it back at some point.
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 didn't look at this yet but I'll try later as I am curious too.
@@ -2,7 +2,6 @@ | |||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
<PropertyGroup> | |||
<BuildConfigurations> | |||
net45-Windows_NT; | |||
netstandard1.1; |
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.
If you are removing the netstandard1.1 ref you should probably do the same for the src.
@JeremyKuhne There are loads of tests playing games with In reality we could relax the max time limits in these test without necessarily making the tests run any slower on average, they would just have more room if the VM did go slow. |
@@ -62,6 +62,7 @@ public static IEnumerable<object[]> Parse_TestData() | |||
yield return new object[] { "1", false, UInt64Enum.One }; | |||
yield return new object[] { "5", false, (UInt64Enum)5 }; | |||
|
|||
#if netcoreapp |
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.
Are these #ifdef'ed because of missing APIs or because of differences in behavior? If it is API this is fine but we should consider splitting them into another file instead of a ton of #ifdef's. If it is behavior differences then we need to file bugs and get them investigated further as we shouldn't blindly disable large sets of tests for that.
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 is because missing APIs. do you want me split the test in this PR or we can do it later?
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 split the code to its own files
@@ -6,15 +6,17 @@ | |||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |||
<NoWarn>1718</NoWarn> | |||
<DefineConstants Condition="'$(TargetGroup)'=='netstandard'">$(DefineConstants);netstandard17</DefineConstants> |
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 netstandard17 in this project?
@weshaggard I am merging this one. if you have any more comments I can address it in another PR. thanks for reviewing it. |
* Enable tests to compile with netstandard Most of the tests have netstandard configurations and it doesn't compile. the changes here is to fix the configurations and the tests to compile. This is important step to get netfx tests compile too as we are in most of the time netfx fallback to netstandard configuration The changes include some fixes to compile teh sources too. * Fix System.Collections.Immutable * update src configuration * remove netstandard17 defines * Split netcoreapp code to its own files * Remove 17 from the test class name Commit migrated from dotnet/corefx@15b4f51
* Enable tests to compile with netstandard Most of the tests have netstandard configurations and it doesn't compile. the changes here is to fix the configurations and the tests to compile. This is important step to get netfx tests compile too as we are in most of the time netfx fallback to netstandard configuration The changes include some fixes to compile teh sources too. * Fix System.Collections.Immutable * update src configuration * remove netstandard17 defines * Split netcoreapp code to its own files * Remove 17 from the test class name Commit migrated from dotnet/corefx@15b4f51
Most of the tests have netstandard configurations and it doesn't compile. the changes here is to fix the configurations and the tests to compile.
This is important step to get netfx tests compile too as we are in most of the time netfx fallback to netstandard configuration
The changes include some fixes to compile teh sources too.