-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add basic check that the correct number of tests is built #19290
Conversation
@dotnet-bot test Windows_NT x64 Build and Test |
@dotnet-bot test Windows_NT x86 Checked Build and Test |
@dotnet-bot test OSX10.12 x64 Checked CoreFX Tests |
I understand the need for this type of check, it is something that was manually required to verify before #18695 was merged. As it is I suggest changes to this PR, either to add this information in one place in runtest.proj (as awful as that sounds it at least unifies it), or duplicate the logic in build-test.sh. Third option is to wait for a build-test unification similar to runtest unification done in #19213, and have a unified script to do these post-build checks. |
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.
See above for opinions on changes
@dotnet-bot test Windows_NT x64 Build and Test |
@jashook How's this look? |
Just needs the call from build-test.sh as well thanks! |
@dotnet-bot test Ubuntu x64 Build and Test |
build-test.cmd
Outdated
@@ -314,6 +314,10 @@ for /l %%G in (1, 1, %__BuildLoopCount%) do ( | |||
set __AppendToLog=true | |||
) | |||
|
|||
REM Check that we've built about as many tests as we expect. This is primarily intended to prevent accidental changes that cause us to build | |||
REM drastically fewer Pri-1 tests than expected. | |||
call %__DotnetHost% msbuild %__ProjectDir%\tests\runtest.proj /t:CheckTestBuild /p:Priority=%__Priority% %__msbuildArgs% %__unprocessedBuildArgs% |
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.
The property shouldn't be Priority
, it should be CLRTestPriorityToBuild
. This mapping is defined in coreclr/config.json
<- this appears to be passed to run.exe
.
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.
Ugh.. Sorry, you are using Priority
in your target.... instead, can you please use the standard property for tests: CLRTestPriorityToBuild
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.
BTW that is the core issue for why the previous PR was failing....
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.
@AaronRobinsonMSFT I'm not invoking run.exe, I'm using msbuild directly.
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 realize that post statement. My point is we have too many properties/variables that hold priority. We already have one in MSBuild (i.e. CLRTestPriorityToBuild
) so we should reuse that one instead of the generic Priority
.
bc0b967
to
1d03638
Compare
@dotnet-bot test Ubuntu x64 Build and Test |
@BruceForstall I am generally against these kind of checks. This is the exact kind of code that atrophies within a week and then inevitably gets abused and confuses future team members, however I can appreciate the concern about loss of coverage - a real issue as demonstrated by the recent issue. What is the long term maintenance approach for this code? At the very least it should be documented in one of the test markdown files so people know this mechanism exists and should be considered when working with tests in coreclr. |
Also, check msbuild exit code for failure.
@dotnet-bot test Ubuntu x64 Build and Test |
@AaronRobinsonMSFT I don't see how this code atrophies: if it fails, it will be a noisy failure. I don't see this as a maintenance issue: if it fails, because someone maybe added or removed a lot of tests, they'll see it. I've added a bunch of comments to the msbuild target. Note that the coverage lost last week was by no means the first time we've had this problem. |
@BruceForstall This code atrophies because when more tests are added and the the count becomes 20000, when 8000 go missing it is again an issue. I am not saying there is no value, but any hard-coded value that represents a point in time quantity by definition atrophies if the quantity can change over time. Adding comments in MSBuild isn't where people look for how to integrate into the system, it is where they look when something breaks. Knowing ahead of time that this mechanism exists is helpful so if someone adds many new tests or removes many, there is a heads up in the process document. Basically, this is exactly the kind of thing that should be mentioned in the documentation for working with tests in coreclr. |
I just got this: BUILDTEST: Check the managed tests build D:\coreclr\tests\runtest.proj(75,5): error : Unexpected test count. Expected < 3000, found 7242.' |
Fixes #19286