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

Adding builds files to the test projects#6572

Merged
jonmill merged 1 commit intodotnet:masterfrom
jonmill:builds
Mar 31, 2016
Merged

Adding builds files to the test projects#6572
jonmill merged 1 commit intodotnet:masterfrom
jonmill:builds

Conversation

@jonmill
Copy link

@jonmill jonmill commented Mar 1, 2016

Adding builds files to the test projects so we will only build a test project on the platform (and only with the configuration) that it should build for.

cc @weshaggard

@weshaggard
Copy link
Member

@sokket As we talked about last time you shouldn't include TargetGroup configurations in the builds file right now as the tests currently don't support anything beyond the default empty TargetGroup. So please exclude any configurations that define a TargetGroup from the builds files.

@jonmill
Copy link
Author

jonmill commented Mar 2, 2016

Sorry about that, I changed my script and it included the TargetGroup nodes...I'll fix it now

@ellismg
Copy link
Contributor

ellismg commented Mar 3, 2016

Something goofy is going on. The Winodws_NT legs failed because they were running at least some tests that were marked as AnyUnix.

@jonmill
Copy link
Author

jonmill commented Mar 4, 2016

@ellismg it looks like there isn't any xunit filtering done per-OS...the ZipFile tests had the same problem:

CoreRun.exe xunit.console.netcore.exe System.IO.Compression.ZipFile.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=OuterLoop -notrait category=failing

@weshaggard what generates the xunit command to run? It looks like we need to add the -notrait category=<os> trait

@ellismg
Copy link
Contributor

ellismg commented Mar 4, 2016

@weshaggard what generates the xunit command to run? It looks like we need to add the -notrait category= trait

It's handled by tests.targets in build tools.

@ellismg
Copy link
Contributor

ellismg commented Mar 4, 2016

run-test.sh will also need to be updated since it looks like the paths of stuff in the output folder are changing, and previously it assumed that there would be just one OS folder that all tests went into.

@jonmill
Copy link
Author

jonmill commented Mar 4, 2016

@ellismg Thanks for pointing me to that. Maybe that file should be changed to filter based on the OS that it is running on instead of the OSGroup parameter?

@ellismg
Copy link
Contributor

ellismg commented Mar 4, 2016

Maybe that file should be changed to filter based on the OS that it is running on instead of the OSGroup parameter?

The only issue with that is I don't believe today we have a property that describes the OS your are running on. AFAIK we only distinguish between "Windows" and "Unix" for the host OS, so we'd need to add something and then plumb things through.

@jonmill
Copy link
Author

jonmill commented Mar 4, 2016

Makes sense... @weshaggard any thoughts on if this will be the right approach?

@jonmill
Copy link
Author

jonmill commented Mar 7, 2016

@weshaggard The problem with any of the variables I found is that they do not match up with our test case filters seen here...for instance, we turn FreeBSD distros into Ubuntu runtime but have BSD test filters. I think we will need to plumb something fully through the system to get the right traits

@jonmill
Copy link
Author

jonmill commented Mar 7, 2016

Adding some logging to check the state of MSBuild variables on all the platforms...

@jonmill
Copy link
Author

jonmill commented Mar 7, 2016

Windows failure is #6732, will retest since it shouldn't be a 100% repro

@jonmill
Copy link
Author

jonmill commented Mar 9, 2016

@chcosta FYI

dir.targets Outdated
<TestFilterCategory Condition="'$(OS)' == 'Linux'">-notrait category=nonlinuxtests</TestFilterCategory>
<TestFilterCategory Condition="'$(OS)' == 'FreeBSD'">-notrait category=nonfreebsdtests</TestFilterCategory>
<TestFilterCategory Condition="'$(OS)' == 'NetBSD'">-notrait category=nonnetbsdtests</TestFilterCategory>
<TestCommandLine>$(TestCommandLine) $(TestFilterCategory)</TestCommandLine>
Copy link
Member

Choose a reason for hiding this comment

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

I'm grabbing a copy of this code change to dir.targets, as-is, for a change I am currently working on. I'll be sure to cc you on the PR so that you are aware of any conflicts if you make additional changes. This change is simpler than the build tools change I was considering, only because coordination between buildtools and corefx won't be required. Is there a plan to move this into BuildTools? This seems somewhat redundant and likely to cause conflicts at some point given that these are additive and keying off of different properties...

https://github.com/dotnet/buildtools/blob/master/src/Microsoft.DotNet.Build.Tasks/PackageFiles/tests.targets#L60

Copy link
Author

Choose a reason for hiding this comment

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

When I last spoke with @weshaggard he mentioned that he usually puts changes like this into CoreFx to vet it first and then moves it over to build tools after.

Copy link
Member

Choose a reason for hiding this comment

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

Yes I'm cool with staging this in corefx and then prompting to buildtools.

As for the specific change I'm not entirely sure $(OS) is the right way to go here. Msbuild will currently only set it to Unix, OSX, or Windows (https://github.com/radical/msbuild/blob/fix-isosx/src/Shared/NativeMethodsShared.cs#L534). I think we probably should start passing it through the builds file as TestOSGroup or something like that which we can default to the OSGroup passed in at the root or we can start explicitly passing it.

@jonmill
Copy link
Author

jonmill commented Mar 17, 2016

Some infrastructure failures, sent emails about them. Will retest

@jonmill
Copy link
Author

jonmill commented Mar 22, 2016

Machines went offline during the build...retrying

@jonmill
Copy link
Author

jonmill commented Mar 22, 2016

@dotnet-bot test this please

@mmitche
Copy link
Member

mmitche commented Mar 22, 2016

Stand by, I'm restarting the system with an update or two

@jonmill
Copy link
Author

jonmill commented Mar 22, 2016

@mmitche cool, let me know when you've completed the update so I can re-test?

@mmitche
Copy link
Member

mmitche commented Mar 23, 2016

@dotnet-bot test this please

@jonmill
Copy link
Author

jonmill commented Mar 25, 2016

@weshaggard Things are green! Can you take another look please?

dir.targets Outdated
<TargetFrameworkProfile></TargetFrameworkProfile>
<!-- We set this property to avoid MSBuild errors regarding not setting TargetFrameworkProfile (see above line) -->
<PortableNuGetMode>true</PortableNuGetMode>

Copy link
Member

Choose a reason for hiding this comment

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

This needs to be reconciled with @Priya91 recent BuildTools PR dotnet/buildtools#564

Copy link
Author

Choose a reason for hiding this comment

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

Looks like I can just use TargetOS instead

Copy link
Author

Choose a reason for hiding this comment

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

When will the BuildTools change be picked up by CoreFx?

Copy link
Member

Choose a reason for hiding this comment

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

I think the TargetOS part is already included, but @Priya91 is also working merging another change with #7255.

<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition="'$(Configuration)'==''">Windows_Debug</Configuration>
<Configuration Condition="'$(Configuration)'==''">$(TargetOS)_Debug</Configuration>
Copy link
Member

Choose a reason for hiding this comment

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

TargetOS isn't set by the time this is evaluated so you are essentially setting it to _Debug which isn't going to help.

Copy link
Author

Choose a reason for hiding this comment

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

Changed to $(OSEnvironment)

@jonmill
Copy link
Author

jonmill commented Mar 30, 2016

Looks like network timeouts. Trying tests again

@jonmill
Copy link
Author

jonmill commented Mar 31, 2016

@dotnet-bot test Innerloop CentOS7.1 Debug Build and Test

@jonmill
Copy link
Author

jonmill commented Mar 31, 2016

@weshaggard Any further feedback or can I merge this change?

<TestOsTarget Condition="'$(OSGroup)'==''">$(OSEnvironment)</TestOsTarget>
</PropertyGroup>
<PropertyGroup>
<InputOSGroup>$(OSGroup)</InputOSGroup>
Copy link
Member

Choose a reason for hiding this comment

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

InputOSGroup - Are you trying to use this to capture what is passed at the command line?

Copy link
Author

Choose a reason for hiding this comment

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

Yes. It will capture whatever is put from the command line OR it will generate it based on the current running platform. This gives me a variable that is guaranteed to be there and have data so I can use it anywhere in the csproj

@jonmill
Copy link
Author

jonmill commented Mar 31, 2016

FYI @maririos

<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition="'$(Configuration)'==''">Windows_Debug</Configuration>
<Configuration Condition=" '$(Configuration)' == '' ">$(OS)_Debug</Configuration>
Copy link
Member

Choose a reason for hiding this comment

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

Lets try this for now but I suspect this isn't going to give us the full experience we want in all scenario.

Copy link
Author

Choose a reason for hiding this comment

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

I can probably change that to $(InputOSGroup)...that would give the desired effect

Copy link
Author

Choose a reason for hiding this comment

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

Ah no it won't, nevermind

Copy link
Member

Choose a reason for hiding this comment

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

Yes it won't but I also don't have a better answer here right now either.

@weshaggard
Copy link
Member

OK after the removal of the OS fallback please squash and then LGTM

Thanks for tackling this.

@jonmill
Copy link
Author

jonmill commented Mar 31, 2016

Merging. Thanks everyone!

@jonmill jonmill merged commit e8326c3 into dotnet:master Mar 31, 2016
@jonmill jonmill deleted the builds branch March 31, 2016 18:41
ellismg added a commit to ellismg/corefx that referenced this pull request Apr 5, 2016
Since dotnet#6572 was merged, we only build test projects for the platforms
they test.  This means the UnsupportedPlatforms metadata is no longer
needed (instead using the .builds file to control when the project is
built is the right thing to do).

Leverage this in run-test.sh, we now simply loop over all the tests in
the relevent folders under bin/tests, depending on the platform in
question.
ellismg added a commit to ellismg/corefx that referenced this pull request Apr 5, 2016
Since dotnet#6572 was merged, we only build test projects for the platforms
they test.  This means the UnsupportedPlatforms metadata is no longer
needed (instead using the .builds file to control when the project is
built is the right thing to do).

Leverage this in run-test.sh, we now simply loop over all the tests in
the relevent folders under bin/tests, depending on the platform in
question.
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
macrogreg pushed a commit to open-telemetry/opentelemetry-dotnet-instrumentation that referenced this pull request Sep 24, 2020
Adding builds files to the test projects

Commit migrated from dotnet/corefx@e8326c3
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Adding builds files to the test projects

Commit migrated from dotnet/corefx@e8326c3
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Since dotnet/corefx#6572 was merged, we only build test projects for the platforms
they test.  This means the UnsupportedPlatforms metadata is no longer
needed (instead using the .builds file to control when the project is
built is the right thing to do).

Leverage this in run-test.sh, we now simply loop over all the tests in
the relevent folders under bin/tests, depending on the platform in
question.


Commit migrated from dotnet/corefx@001983b
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.

7 participants