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

Use dotnet MSBuild for tests #19324

Merged

Conversation

AaronRobinsonMSFT
Copy link
Member

Revert the revert of #19254

cc @BruceForstall @chsienki

@AaronRobinsonMSFT AaronRobinsonMSFT added the test enhancement Improvements of test source code label Aug 7, 2018
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 3.0 milestone Aug 7, 2018
@AaronRobinsonMSFT
Copy link
Member Author

Verified locally that when running build-test.cmd -priority=2 over 12000 .cmd test scripts are created.

if %__Priority% GTR 0 (set "__PriorityArg=-priority=%__Priority%")
if %__Priority% GTR 0 (
set "__PriorityArg=-priority=%__Priority%"
set "__PriorityMsbuildArg=/p:CLRTestPriorityToBuild=%__Priority%"
Copy link
Member Author

@AaronRobinsonMSFT AaronRobinsonMSFT Aug 7, 2018

Choose a reason for hiding this comment

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

The issue was that for MSBuild the correct property is CLRTestPriorityToBuild, not Priority. The priority flag that was previously passed is mapped in the config.json file and converted in the depths of run.exe 😖 unclear why this mapping logic exists.

@AaronRobinsonMSFT
Copy link
Member Author

FYI @RussKeldorph with this commit, the work that @chsienki started should be complete.

@AaronRobinsonMSFT
Copy link
Member Author

@chsienki Was there a reason we didn't update build-test.sh with similar logic?

<Exec Condition="'$(RunningOnCore)' == 'false'" Command="$(DotnetRestoreCommand) $(RestoreProj) $(PackageVersionArg)" StandardOutputImportance="Low" />
<Exec Condition="'$(RunningOnCore)' == 'true'" Command="$(DotnetRestoreCommand) -r $(__DistroRid) $(RestoreProj) $(PackageVersionArg)" StandardOutputImportance="Low" />
<Exec Condition="'$(__DistroRid)' == ''" Command="$(DotnetRestoreCommand) $(RestoreProj) $(PackageVersionArg)" StandardOutputImportance="Low" />
<Exec Condition="'$(__DistroRid)' != ''" Command="$(DotnetRestoreCommand) -r $(__DistroRid) $(RestoreProj) $(PackageVersionArg)" StandardOutputImportance="Low" />

Choose a reason for hiding this comment

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

Dependency restore is one of the pain points in test build. Could we explicitly output more detailed info on restore process? It would be sufficient to hook above commands log output at normal verbosity to logs and have a StandardOutputImportance console output set to High with minimal verbosity for console output set in restore command.

Copy link
Member Author

Choose a reason for hiding this comment

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

What exactly is the pain point? Does it fail? Does it not properly fully restore? I am more than willing to add logging, but I would like to understand pain points because there may be a more general fix.

Choose a reason for hiding this comment

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

The problem is that there are multiple already attempts at fixing dependencies in particular for performance tests where majority of them failed from different reasons. See #16647 #9281 #16126. Discussion related to the problem was in some comments of the https://github.com/dotnet/corefx/issues/31536#issuecomment-409635103 issue.

In general build-test configuration causes download of roughly 2.5 GB of assemblies out of which only about 500 - 600 are necessary. There is a possibility of reducing that amount by careful management of dependencies. This will lead to deterministic build which should be made against built product and chosen CoreFX or netstandard assemblies. Detailed information on dependency graph resolution would make any feature test dependencies updates easier.

Part of the above goal can be achieved by introducing new features into NuGet which would allow to override resolution of inbox assemblies with latest used version.

Solution which will not impact standard builds could be based on verbosity parameter passed to build-test.(cmd|sh) which would be used in the above code to set logging verbosity for restore and visibility of command line messages in console output by changing StandardOutputImportance

Copy link
Member Author

@AaronRobinsonMSFT AaronRobinsonMSFT Aug 8, 2018

Choose a reason for hiding this comment

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

That is indeed a valuable goal. In this case, however providing a new knob to configure logging for the update isn't the purpose of this PR. It is for a long standing work item related to consolidating usage of dotnet's MSBuild version. I think adding that support is very valid and should be done.

@chsienki
Copy link

chsienki commented Aug 7, 2018

@AaronRobinsonMSFT My understanding is that using build-test.sh eventually builds using dotnet msbuild, whereas our build-test.cmd ends up with desktop

build-test.cmd -> run.cmd -> (via config.json) -> Tools\msbuild.cmd -> msbuild.exe (desktop)

build-test.sh -> run.sh -> (via config.json) -> Tools\msbuild.sh -> dotnet msbuild (core msbuild)

We could theoretically edit the config.json to make it flip between desktop and core msbuilds on windows as needed, but my understanding is that a lot of this stuff will go away with ARCADE, so we're not updating it in buildtools, but going directly to msbuild ourselves (that's what @sbomer did when he updated the xunit wrappers anyway, so I just copied him :))

@AaronRobinsonMSFT
Copy link
Member Author

@chsienki Sounds good, thanks.

@AaronRobinsonMSFT
Copy link
Member Author

@BruceForstall or @jashook Can you kick off the ARM tests for validation? Thanks.

@BruceForstall
Copy link
Member

@dotnet-bot test Windows_NT x86 Checked Build and Test
@dotnet-bot test Windows_NT x64 Build and Test
@dotnet-bot test Windows_NT arm Cross Checked Innerloop Build and Test
@dotnet-bot test Windows_NT arm64 Cross Checked Innerloop Build and Test

@BruceForstall
Copy link
Member

@dotnet-bot test Windows_NT arm64 Cross Checked normal Build and Test
@dotnet-bot test Windows_NT arm Cross Checked normal Build and Test

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
test enhancement Improvements of test source code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants