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

Changing the TestPath to have more info built in to avoid dir clashes#12634

Merged
joperezr merged 1 commit into
dotnet:masterfrom
joperezr:FixTestBuilds
Oct 14, 2016
Merged

Changing the TestPath to have more info built in to avoid dir clashes#12634
joperezr merged 1 commit into
dotnet:masterfrom
joperezr:FixTestBuilds

Conversation

@joperezr
Copy link
Copy Markdown
Member

Progress towards dotnet/buildtools#1121

cc: @weshaggard @MattGal @karajas @danmosemsft

With this change, I'm introducing this common build property that represents all aspects of the build configuration of a project, and I'm using it to set $(TestPath) which was using $(OSPlatformConfig) before and that was causing that we had some folder clashes when we introduced test builds that had TargetGroup=netcoreapp1.1. This is just the start of a batch of changes(some of which will have to go in buildtools) that will basically replace OSPlatformConfig with this new variable. This change will fix the current build test issues where we fail while trying to zip folder A at the same time that a subfolder B is being modified by a different build.

Comment thread dir.props Outdated
<TargetGroup Condition="'$(TargetGroup)'=='' and $(Configuration.Contains('uap101aot'))">uap101aot</TargetGroup>
<TargetGroup Condition="'$(TargetGroup)'=='' and $(Configuration.Contains('uap101'))">uap101</TargetGroup>

<ProjectRunConfig Condition="'$(TargetGroup)'!=''">$(OSGroup).$(Platform).$(TargetGroup).$(ConfigurationGroup).$(TestTFM)</ProjectRunConfig>
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.

you could simply not special case it and if targetgroup was "" it would just show up as double dots.

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 that's how I had it on my first iteration but I didn't like the double "." I think that might lead to people thinking something is not set correctly.

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.

+1 to being against double dots. It will always trigger the "is that a bug?" response for me.

Comment thread dir.props Outdated
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(IntermediateOutputRootPath)$(MSBuildProjectName)/$(TargetOutputRelPath)</IntermediateOutputPath>

<TestPath Condition="'$(TestPath)'==''">$(TestWorkingDir)$(OSPlatformConfig)/$(MSBuildProjectName)/$(TargetOutputRelPath)</TestPath>
<TestPath Condition="'$(TestPath)'==''">$(TestWorkingDir)$(ProjectRunConfig)/$(MSBuildProjectName)/$(TargetOutputRelPath)</TestPath>
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 take care of where tests will publish to or does this also require consumption of ProjectRunConfig by BuildTools?

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.

It does, publishtest.targets consume $(TestPath) so no need to make a change there.

@MattGal
Copy link
Copy Markdown
Member

MattGal commented Oct 13, 2016

LGTM, other than I had imagined the ProjectRunConfig string might be defined in buildtools.

@joperezr
Copy link
Copy Markdown
Member Author

I had imagined the ProjectRunConfig string might be defined in buildtools.

This was my initial plan, but the problem is that buildtools properties are imported before OSGroup, TargetGroup and some other properties get defined, which themselves are kind of tied to the place they are now because they depend on other stuff to be defined as well. Basically it could probably be done in buildtools, but it would be very hard to figure out the ordering of dir.props right, in order to not break any other property.

@MattGal
Copy link
Copy Markdown
Member

MattGal commented Oct 13, 2016

Ah. In that case, perhaps we should eventually have a concept of "some .props / .targets that is always pulled in first if present" to allow BuildTools to trump properties if it has reason. Outside of the scope of this work.

It's definitely worth running a manual helix test build against packages with this once to make sure all the archives are produced correctly, but if you're feeling bold a clean CI is fine too.

Comment thread dir.props Outdated
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(IntermediateOutputRootPath)$(MSBuildProjectName)/$(TargetOutputRelPath)</IntermediateOutputPath>

<TestPath Condition="'$(TestPath)'==''">$(TestWorkingDir)$(OSPlatformConfig)/$(MSBuildProjectName)/$(TargetOutputRelPath)</TestPath>
<TestPath Condition="'$(TestPath)'==''">$(TestWorkingDir)$(ProjectRunConfig)/$(MSBuildProjectName)/$(TargetOutputRelPath)</TestPath>
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.

For now I would just update TargetOutputRelPath (or another property) to also include TestTFM. Once we move these to buildtools we can start having properties trying to combine the properties in logical groups that people can depend on.

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 go with this approach instead. I will however use a different property, because TargetOutputRelPath is used in some other places that would break things if I change this one directly.

@joperezr joperezr merged commit dba738f into dotnet:master Oct 14, 2016
@joperezr joperezr deleted the FixTestBuilds branch October 14, 2016 20:17
@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
Changing the TestPath to have more info built in to avoid dir clashes

Commit migrated from dotnet/corefx@dba738f
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