Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Changing test projects to default to netcoreapp1.1 instead of netcoreapp1.0#12241

Merged
joperezr merged 1 commit intodotnet:masterfrom
joperezr:DefaultToNetcoreapp11
Oct 1, 2016
Merged

Changing test projects to default to netcoreapp1.1 instead of netcoreapp1.0#12241
joperezr merged 1 commit intodotnet:masterfrom
joperezr:DefaultToNetcoreapp11

Conversation

@joperezr
Copy link
Copy Markdown
Member

Fixes #12129

This change will make it such that netcoreapp1.1 will be the new default TestTFM for all projects, and it will also now only run the netcoreapp1.1 tests as part of the regular CI. One more thing I did with this change, is to make all of the test .csprojs to also default their nuget target moniker to netstandard1.7 if they were testing API that is specific to that framework, and I did this so that now all three (tests, refs, and impls) will have the same behavior and default to netstandard1.7 and x-compile only to older frameworks.

cc: @weshaggard @ericstj @danmosemsft @stephentoub @karajas

@ericstj
Copy link
Copy Markdown
Member

ericstj commented Sep 30, 2016

<RootNamespace>System.Collections.Concurrent.Tests</RootNamespace>
<DefineConstants Condition="'$(TargetGroup)'=='netstandard1.7'">$(DefineConstants);netstandard17</DefineConstants>
<NugetTargetMoniker Condition="'$(NugetTargetMoniker)'==''">.NETStandard,Version=v1.3</NugetTargetMoniker>
<DefineConstants Condition="'$(TargetGroup)'==''">$(DefineConstants);netstandard17</DefineConstants>
Copy link
Copy Markdown
Member

@ericstj ericstj Sep 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should make netstandard13 be the ifdef. Maybe separate issue.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I guess that would be better but it is not super straight forward to make this with a script so it would have to be done manually. I can do that as a separate cleanup PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree we should make the non-default configuration the one that should be #ifdef'ed, and I also agree we can do that as a follow-up item.

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
Copy link
Copy Markdown
Member

@ericstj ericstj Sep 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undo this file, and others. Normally I wouldn't care about these changes but since nothing else changed in the file should be easy to delete it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

@joperezr
Copy link
Copy Markdown
Member Author

Comment thread dir.traversal.targets Outdated
@@ -152,7 +151,7 @@
<ItemGroup>
<Project>
<!-- default to netcoreapp1.0.0 if TestTFMs aren't set on the project -->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably also change the comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, will do.

@joperezr joperezr force-pushed the DefaultToNetcoreapp11 branch from 0c68ed5 to f4b9864 Compare September 30, 2016 20:58
@joperezr
Copy link
Copy Markdown
Member Author

@weshaggard I've removed the TestTFMSupportSet with my latest commit. PTAL to dir.traversal.targets change in f4b9864

@joperezr joperezr force-pushed the DefaultToNetcoreapp11 branch from 4542e8e to 7fe9193 Compare September 30, 2016 22:24
Comment thread dir.props Outdated
<TestTFM Condition="'$(TestTFM)'==''">netcoreapp1.0</TestTFM>
<TestTFM Condition="'$(TestTFM)'==''">netcoreapp1.1</TestTFM>
<!-- we default FilterToTestTFM to netcoreapp1.1 if it is not explicity defined -->
<FilterToTestTFM Condition="'$(FilterToTestTFM)'==''">netcoreapp1.1</FilterToTestTFM>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to connect the dots can you set FiltertoTestTFM to TestTFM.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do this

Comment thread dir.traversal.targets Outdated
<!-- default to netcoreapp1.0.0 if TestTFMs aren't set on the project -->
<TestTFMs Condition="'%(Project.TestTFMs)'==''">netcoreapp1.0</TestTFMs>
<!-- default to netcoreapp1.1 if TestTFMs aren't set on the project -->
<TestTFMs Condition="'%(Project.TestTFMs)'==''">netcoreapp1.1</TestTFMs>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly to connect the dots can you use TestTFM here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually we might want to think about this one a little more (especially in cases where people actually set it at the commandline and it isn't the default) but I do still think it might make since to share a common property for the default. Perhaps we should create an independent "DefaultTestTFM" property and use that as the default in all these places.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mm I don't think that we should set it to TestTFM. I think it is good to keep TestTFM property only related when building a single project or an individual .csproj, and TestTFMs for the traversal world and .builds files. Your DefaultTestTFM idea I think is better, but it might need a bit more logic to it. Do you want me to do this now or should we design it and do it in a follow up PR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked offline, I'll do this as well

Comment thread src/System.CodeDom/tests/project.json Outdated
"opensuse.42.1-x64"
]
}
"coreFx.Test.netcoreapp1.1": {}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please also include "coreFx.Test.net463" as it is needed for the other test configuration.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephentoub in order to run these on desktop you will need this support clause. After you do that you have too possible ways to run:

msbuild System.CodeDom.Tests.csproj /p:OSGroup=Windows_NT /p:TestTFM=net463
or
msbuild System.CodeDom.Tests.builds /p:FilterToTestTFM=net463

For better or worse when building the builds file we build all combinations but only test the what is set in FilterToTestTFM which you can pass directory or it defaults to https://github.com/dotnet/corefx/pull/12241/files#diff-0b192804a6349e8c26d2b027afbd89a2R504.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought net463 was not being tested yet, I'll add this in here.

<TargetGroup>netstandard1.3</TargetGroup>
<TestTFMs>netcoreapp1.0</TestTFMs>
</Project>
<Project Include="System.Collections.Concurrent.Tests.csproj" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets please try to keep the default configuration at the top of the files.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment applies to all the .builds files.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't be super straight forward to do, the reason why they got out of order like this is because I used a tool to parse and edit all of these files, but it edits them in place, so this one for example use to be the netstandard1.7 and netcoreapp1.1 build, but it is now the default since those are the defaults now. Since it doesn't really add any value I believe if we watne dto clean this up we could do it later, but I can totally do it now if you feel strongly about it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nvm, I found a way to automate this easily so I'll do it also

<DefineConstants Condition="'$(TargetGroup)'=='netstandard1.7'">$(DefineConstants);netstandard17</DefineConstants>
<NugetTargetMoniker Condition="'$(NugetTargetMoniker)'==''">.NETStandard,Version=v1.3</NugetTargetMoniker>
<DefineConstants Condition="'$(TargetGroup)'==''">$(DefineConstants);netstandard17</DefineConstants>
<NugetTargetMoniker Condition="'$(NugetTargetMoniker)'==''">.NETStandard,Version=v1.7</NugetTargetMoniker>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: As part of your clean-up can you change these conditions to make them consistent and use '$(TargetGroup)==''`? I want to try and keep the conditions in the projects limited to OSGroup/Targets and TargetGroup to try and cut down on the different things folks need to know about in these conditions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I'll change this.

<Compile Include="ArrayListTests.cs" />
<Compile Include="ArrayList\ArrayList.IList.Tests.cs" />
<Compile Include="CaseInsensitiveHashCodeProviderTests.cs" Condition="'$(TargetGroup)'=='netstandard1.7'" />
<Compile Include="CaseInsensitiveHashCodeProviderTests.cs" Condition="'$(TargetGroup)'==''" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to the item group with the same condition below?

<RootNamespace>System.Drawing.Primitives.Tests</RootNamespace>
<AssemblyName>System.Drawing.Primitives.Tests</AssemblyName>
<ProjectGuid>{297A9116-1005-499D-A895-2063D03E4C94}</ProjectGuid>
<NugetTargetMoniker>.NETStandard,Version=v1.7</NugetTargetMoniker>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need a condition?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if it isn't necessary today I would suggest adding the condition to help prevent issues tomorrow when we add another configuration.

<TestTFMs>netcoreapp1.0</TestTFMs>
</Project>
<Project Include="System.Globalization.Extensions.Tests.csproj">
<TestTFMs>net463</TestTFMs>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should still be OSGroup=Windows_NT and it looks like we also need to include a Unix default build.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually looks like we might not even need the Unix build for netstandard1.3 as it doesn't look like it is being used in the test project. We at least need to add the net463 configuration with Windows_NT as they will not work or run on Unix.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the .csproj inside is setting Windows_NT by default as the OSGroup, which is why it is not needed here. If I keep it as it was it would cause a binclash betweein this build and the default one for netcoreapp1.1, where one has OSGroup set as a global property and the other one is set in the .csproj. That is why I merged them into only one build, that has two testTFMs

@weshaggard weshaggard mentioned this pull request Oct 1, 2016
@joperezr joperezr force-pushed the DefaultToNetcoreapp11 branch from 7fe9193 to d56046b Compare October 1, 2016 18:43
@joperezr joperezr merged commit 76b46ea into dotnet:master Oct 1, 2016
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<Project Include="Performance\System.IO.FileSystem.Performance.Tests.csproj" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This .builds file has interesting ordering because it contains multiple build projects. If I were to sort this one I would still group the individual test projects. I realize you generated this so I know how it turned out like this I just wanted to point it out to you.

<TargetGroup>netstandard1.3</TargetGroup>
<TestTFMs>netcoreapp1.0</TestTFMs>
</Project>
<Project Include="System.Globalization.Tests.csproj" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the configuration I would expect to be the first in the list.

<TargetGroup>netstandard1.3</TargetGroup>
</Project>
<Project Include="System.IO.FileSystem.Watcher.Tests.csproj">
<TargetGroup>netstandard1.7</TargetGroup>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like it would have been better to just swap ns17 with the older builds so the diff would be logically ordered with the default builds at the top.

@weshaggard
Copy link
Copy Markdown
Member

LGTM thanks for doing this @joperezr I added a few comments where the order is a little funky but I think they are technically correct. Perhaps we should just write a simple program to order all the .builds files to make them consistent.

@joperezr
Copy link
Copy Markdown
Member Author

joperezr commented Oct 2, 2016

Sounds good, I'll write up a quick program and run it through the repo soon

@karelz karelz modified the milestone: 1.2.0 Dec 3, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…app11

Changing test projects to default to netcoreapp1.1 instead of netcoreapp1.0

Commit migrated from dotnet/corefx@76b46ea
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants