-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for building just a subset of runtime tests #57142
Conversation
Tagging subscribers to this area: @hoyosjs Issue DetailsThis change adds four new options to the runtime test build command:
Thanks Tomas /cc @dotnet/runtime-infrastructure
|
What's the expected behavior if multiple of these new commands are supplied? Does one override the others, do multiple take effect, or does the script error out? |
It looks like multiple seperate commands take a effect (-dir/-tree), but using for example -test twice for two different tests doesn't. I'm not sure this is wrong exactly, but it is a little odd? |
Right now only the last command of each type is honored; I can trivially change them to item groups by using the semicolon separator and honoring all instances of each; I'll update the PR after our team meeting. |
This change adds four new options to the runtime test build command: 1) test <test project path relative to src\tests> - build just that one test. 2) dir <directory relative to src\tests> - build all tests in the directory. 3) tree <directory relative to src\tests> - build all tests in the given subtree. 4) all - use clean rebuild (i.e. don't apply incrementalism) when building the tests. Thanks Tomas
61e0c30
to
2369d08
Compare
2369d08
to
28830f9
Compare
Would it not be better to name this option |
@AntonLapounov - I don't know; I'm not too happy with
I'll be happy for suggestions. |
Maybe -cleanbuild ? |
Do we actually need the |
I think you're right, that sounds reasonable to me. |
… feedback It also turns out that the rebuild cleanup was in the wrong place in the build.sh script - it was done as part of generate_layout i.e. after the native and managed test components have been built i.o.w. using it ended up building the tests and deleting them afterwards. Thanks Tomas
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.
Looks good, thank you!
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 so happy to see this change. No more hacking for this. Please update the corresponding doc for this new capability.
@fanyang-mono - I have added description of the new options to the workflow docs per your suggestion. Can you please take another look when you have a chance and let me know if you find that sufficient or possibly suggest additional doc updates? |
lengthy (especially in `-priority1` mode) and unnecessary when working on a particular test. | ||
|
||
1) `-test:<test-project>` - build a particular test project specified by its project file path, | ||
either absolute or relative to `src/tests`. The option can be specified multiple times on the command |
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.
Please mention that the option that they could provide multiple items and separate them by semicolon.
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.
Updated in 9th commit.
**Example**: `src/tests/build.sh -test:JIT/Methodical/divrem/div/i4div_cs_do.csproj` | ||
|
||
2) `-dir:<test-folder>` - build all test projects within a given directory path, either absolute | ||
or relative to `src/tests`. The option can be specified multiple times on the command line to request |
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.
same here.
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.
Updated in 9th commit.
**Example**: `src/tests/build.sh -dir:JIT/Methodical/Arrays/huge` | ||
|
||
3) `-tree:<root-folder>` - build all test projects within the subtree specified by its root path, | ||
either absolute or relative to `src/tests`. The option can be specified multiple times on the command |
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.
same here.
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.
Updated in 9th commit.
Seems like it is not compatible with all projects under src/tests. $ git clean -xdf
$ ./build.sh -c release
$ src/tests/build.sh -release -test:ilverify/ILVerification.Tests.csproj
...
...
Managed tests build success!
Creating test wrappers...
Microsoft (R) Build Engine version 17.0.0-preview-21411-04+6ca861613 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
/Users/am11/projects/runtime/.dotnet/sdk/6.0.100-rc.1.21411.28/MSBuild.dll -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/Users/am11/projects/runtime/.dotnet/sdk/6.0.100-rc.1.21411.28/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/Users/am11/projects/runtime/.dotnet/sdk/6.0.100-rc.1.21411.28/dotnet.dll -maxcpucount -verbosity:m /bl:/Users/am11/projects/runtime/artifacts/log/Release/build_test_wrappers_coreclr.binlog /consoleloggerparameters:Summary /fileloggerparameters1:WarningsOnly;LogFile=/Users/am11/projects/runtime/artifacts/log/Check_Test_Build.OSX.x64.Release.wrn /fileloggerparameters2:ErrorsOnly;LogFile=/Users/am11/projects/runtime/artifacts/log/Check_Test_Build.OSX.x64.Release.err /fileloggerparameters:Verbosity=normal;LogFile=/Users/am11/projects/runtime/artifacts/log/Check_Test_Build.OSX.x64.Release.log /nodereuse:false /p:BuildWrappers=true /p:TestBuildMode= /p:TargetsWindows= /p:TargetOS=OSX /p:Configuration=Release /p:TargetArchitecture=x64 /p:RuntimeFlavor=coreclr /Users/am11/projects/runtime/src/tests/run.proj
CSC : warning CS2008: No source files specified. [/Users/am11/projects/runtime/src/tests/Common/test_dependencies/test_dependencies.csproj]
test_dependencies -> /Users/am11/projects/runtime/artifacts/tests/coreclr/OSX.x64.Release/Common/test_dependencies/test_dependencies/test_dependencies.dll
/Users/am11/projects/runtime/src/tests/run.proj(342,9): error MSB4184: The expression "[MSBuild]::MakeRelative('', /**/*.sh)" cannot be evaluated. The path is empty. (Parameter 'path')
Build FAILED.
CSC : warning CS2008: No source files specified. [/Users/am11/projects/runtime/src/tests/Common/test_dependencies/test_dependencies.csproj]
/Users/am11/projects/runtime/src/tests/run.proj(342,9): error MSB4184: The expression "[MSBuild]::MakeRelative('', /**/*.sh)" cannot be evaluated. The path is empty. (Parameter 'path')
1 Warning(s)
1 Error(s) Without bash artifacts/tests/coreclr/OSX.x64.Release/ilverify/ILVerification.Tests.sh \
-coreroot=$(pwd)/artifacts/tests/coreclr/OSX.x64.Release/Tests/Core_Root |
line to request building several individual projects; alternatively, a single occurrence of the option | ||
can represent several project paths separated by semicolons. | ||
|
||
**Example**: `src/tests/build.sh -test:JIT/Methodical/divrem/div/i4div_cs_do.csproj;JIT/Methodical/divrem/div/i8div_cs_do.csproj` |
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.
In all Unix-y shells including powershell, semicolon is a statement terminator. This example only builds i4div_cs_do.csproj. I think having just one approach of multiple -test:
occurrences was enough really. Now we support both approaches to achieve the same thing, with different workwounds each.
@am11 - for the ILVerification.Tests.csproj, sorry about that; as I described in the accompanying documentation, the new options are currently orthogonal to the priority value; as you can easily see the test ILVerification.Tests is Pri1,
and so it won't build unless you specify -priority1 in the src/tests/build.sh command line. I understand it's somewhat countra-intuitive but the other option - forcibly setting priority to 1 whenever a -test / -dir / -tree option is specified it not ideal either because it creates even more complex internal logic where seemingly identical things work differently - e.g. "-tree:." would end up building something different than when -tree is not specified and / or -tree / -dir containing a single test project would behave differently than specifying -test with the same project name. My hope is that, based on my proposal we should be able to reduce the overall number of CoreCLR tests and ultimately get rid of the Pri0 / Pri1 distinction; I plan to start preparatory cleanup work in this direction during the oncoming quality week. For the other comment regarding inappropriate use of semicolon in Unix, perhaps we can just change the semicolon to colon on Unix akin to how search paths are normally stored. |
This change adds four new options to the runtime test build command:
test <test project path relative to src\tests> - build just that
one test.
dir <directory relative to src\tests> - build all tests in the
directory.
tree <directory relative to src\tests> - build all tests in the
given subtree.
all - use clean rebuild (i.e. don't apply incrementalism)
when building the tests.
Thanks
Tomas
/cc @dotnet/runtime-infrastructure