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

Add basic check that the correct number of tests is built #19290

Merged
merged 2 commits into from
Aug 7, 2018

Conversation

BruceForstall
Copy link

Fixes #19286

@BruceForstall
Copy link
Author

@dotnet-bot test Windows_NT x64 Build and Test
@dotnet-bot test Windows_NT x86 Checked Build and Test

@BruceForstall
Copy link
Author

@dotnet-bot test Windows_NT x86 Checked Build and Test

@BruceForstall
Copy link
Author

@dotnet-bot test OSX10.12 x64 Checked CoreFX Tests

@jashook
Copy link

jashook commented Aug 6, 2018

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.

Copy link

@jashook jashook left a 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

@BruceForstall
Copy link
Author

@dotnet-bot test Windows_NT x64 Build and Test
@dotnet-bot test Windows_NT x86 Checked Build and Test

@BruceForstall
Copy link
Author

@jashook How's this look?

@jashook
Copy link

jashook commented Aug 6, 2018

Just needs the call from build-test.sh as well thanks!

@BruceForstall
Copy link
Author

@dotnet-bot test Ubuntu x64 Build and Test
@dotnet-bot test Windows_NT x64 Build and Test
@dotnet-bot test Windows_NT x86 Checked 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%
Copy link
Member

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.

Copy link
Member

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

Copy link
Member

@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.

BTW that is the core issue for why the previous PR was failing....

Copy link
Author

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.

Copy link
Member

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.

@BruceForstall
Copy link
Author

@dotnet-bot test Ubuntu x64 Build and Test
@dotnet-bot test Windows_NT x64 Build and Test
@dotnet-bot test Windows_NT x86 Checked Build and Test

@AaronRobinsonMSFT
Copy link
Member

AaronRobinsonMSFT commented Aug 7, 2018

@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.
@BruceForstall
Copy link
Author

@dotnet-bot test Ubuntu x64 Build and Test
@dotnet-bot test Windows_NT x64 Build and Test
@dotnet-bot test Windows_NT x86 Checked Build and Test

@BruceForstall
Copy link
Author

@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.

@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.

@AaronRobinsonMSFT
Copy link
Member

AaronRobinsonMSFT commented Aug 7, 2018

@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.

@BruceForstall BruceForstall merged commit 01908e9 into dotnet:master Aug 7, 2018
@BruceForstall BruceForstall deleted the CheckTestCount branch August 7, 2018 21:58
@Maoni0
Copy link
Member

Maoni0 commented Aug 14, 2018

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.'

D:\coreclr\tests\runtest.proj(75,5): error : Unexpected test count. Expected < 3000, found 7242.'
BUILDTEST: Error: build failed.

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.

5 participants