-
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
Proposal revise CoreCLR test build/run design to reduce complexity #36295
Comments
@sdmaclea Thanks for starting this issue. I think there are a lot of good ideas above, but I don't know if they could be used for some areas.
|
It may be nice to use the same traits used by libraries where possible. For example:
I would expect each test to be one
It would be nice to plan for having an option to run tests that can run in a single process (majority of tests) in a single process. |
I agree where possible. This does make debugging the test more complicated and that is something we should consider. I don't think we pay enough attention to the inner dev loop. I would like to see a scenario where we can run everything in a single process in the CI, but locally I should be to able to run a single test outside of VS without a sequence of command line arguments that is longer than my arm. |
/cc @dotnet/jit-contrib |
To my knowledge this proposal still maintains each test running in its own process. @sdmaclea can confirm or not. |
I would suggest this as future work, it is costly as almost all tests inherently assume somehow that they are running as a single application. |
This proposal would most likely make transitioning to dotnet test easier. |
Running tests in single process would be difficult for the cases when we run with GC stress on. That would mean we would have to run the xunit with GC stress enabled too. |
Not necessarily. We can use https://github.com/dotnet/runtime/tree/master/src/libraries/Common/tests/StaticTestGenerator or something alike. (FWIW, .NET Native used scheme like this for codegen and low-level runtime tests.) XUnit is really two parts:
|
I hadn't considered running the tests in the same process. I am happy to keep it as a background future process thought |
I'll have to look more carefully at those and see if they fully meets our needs. IT is likely we will need a superset. Since I was thinking the MSBuild would construct the attributes, I was trying to keep my life simple. But perhaps the simple thing would be to write the csproj XML like <CLRTestAttributes><![CDATA[
[ActiveIssue("https://github.com/dotnet/runtime/issues/26798")]
[PlatformSpecific(TestPlatforms.Windows)]
]]><CLRTestAttributes/> And get the best of both worlds |
I wanted a simple list of tests with the attributes for each test. I am thinking I need a tool which is somewhat the opposite of
|
I'd like to add that, since we are now drawing on the same set of test for multiple runtimes, we should preserve the ability to disable tests based on RuntimeFlavor. |
One of the other questions is whether to
The mixture makes adding new |
Background on complexity
#36253 is adding the ability to build all the coreclr managed tests on any platform.
Working on that PR reminded me how complex our build and test run code is.
Sampling of issues:
YAML
,Powershell
,Bash
,Batch\Cmd.EXE
,python
,MSBUILD
,C#
YAML
->dotnet MSBuild helixpublishwitharcade.proj
run-test.sh
run-test.py
dotnet MSBuild runtest.proj
,<test>.XUnitWrapper.dll
bash
<test.sh>
corerun <assembly>
Constraints/Goal
Target
specific disabling of tests by scenario at run timeCI
moving parts for efficiency and reliabilitydotnet test
for running tests+ w/o a released
runtime
+ w/o a stable
runtime
Proposed design direction
Test metadata
Currently test metadata is stored in
csproj
/ilproj
files.Refine metadata tags for ability to disable running tests globally and per scenario
Condition
true
- all targetsarm
,arm64
,x64
...Windows
,Unix
, ...;
-> or with clear precedence semantics-
-> and with grammatical connection32bit
,64bit
crossgen2
,varargs
,COM
longrunning
test runner assembly
belowCreate an
<test>.xunit.cs
for each test (with MSBuild duringbuild-test.*
)Metadata as C# attributes for
xUnit.net
ClrTestCaseAttribute
xUnit.net
features.[Theory]
data. But wouldn't enable filtering on test features (see below)ITestDiscovery
andITraitDiscovery
ClrTests.dll Xunit runner dll
Move to a singe dll to run all tests.
Build late in the build managed test phase
Simple project, depends on all built runnable test projects
Includes it own source
Includes
<test_artifacts\**\*.xunit.cs
described aboveWill run as
dotnet test ClrTests.dll
Also will run as
dotnet ClrTests.dll <arguments>
Supports running tests with or without bash/batch scripts
Can generate Bash/Batch scripts for tests on demand
Support an option configuration to run using scripts
Stop generating
bash
/batch
scripts using MSBuild, use ClrTests.dll insteadStop using scripts to run on platforms which don't need them
Save lots of process forks and bash/batch script parsing time.
Saves compressing and decompressing 10K*2 highly similar scripts
If we are worried about bit rot, we could test the scripts periodically. Weekly might be sufficient.
Phases and integration
dev/infrastructure
branchDiscussion
I would like feedback around the proposal.
/cc @janvorli @jkotas @echesakovMSFT @dotnet/runtime-infrastructure @vitek-karas @AaronRobinsonMSFT
The text was updated successfully, but these errors were encountered: