Skip to content
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

Ensure green test runs in VS #8329

Open
9 of 10 tasks
JanKrivanek opened this issue Jan 20, 2023 · 7 comments
Open
9 of 10 tasks

Ensure green test runs in VS #8329

JanKrivanek opened this issue Jan 20, 2023 · 7 comments
Labels
Area: Our Own Build Problems affecting the build or build infrastructure of the MSBuild repo itself. backlog bug Priority:3 Work that is nice to have triaged

Comments

@JanKrivanek
Copy link
Member

JanKrivanek commented Jan 20, 2023

Issue Description

Running unit tests in VS leads to some test failures - this should not be a case. VS-centric developer workflow should not be neglected

Classes of problems to tackle:

@JanKrivanek JanKrivanek added bug needs-triage Have yet to determine what bucket this goes in. labels Jan 20, 2023
@JanKrivanek
Copy link
Member Author

#8328 as inspiration for proper conditional skipping of tests

@vlada-shubina vlada-shubina self-assigned this Jan 23, 2023
@ladipro
Copy link
Member

ladipro commented Jan 23, 2023

Running unit tests in VS leads to some test failures

Just wanted to mention that some of these issues reproduce on the command line as well. For example, dotnet test in src\Build.OM.UnitTests on Windows happily runs Unix-only test cases such as LogUnixWarningUponBuildingProjectWithDriveEnumeration.

@vlada-shubina
Copy link
Member

LogUnixWarningUponBuildingProjectWithDriveEnumeration

It seems Visual Studio ignores those attributes [PlatformSpecific(TestPlatforms.AnyUnix)], whereas CI build filter tests based on them. I had the same situation with BuildEnvironmentHelper_Tests today.

Visual Studio shows them as failing
image
but they are still run.

I'm not sure whether this is a problem in how VS handling traits, or this is expected UX in VS, imo custom theory / fact attributes seems better solution as they work in VS and cmd and CI equally.

@vlada-shubina
Copy link
Member

vlada-shubina commented Jan 24, 2023

Not related to VS Run, but when running test of x64: .\build.cmd -test -ci /p:Platform="x64
Microsoft.Build.Graph.UnitTests.IsolateProjectsTests.UndeclaredReferenceEnforcementShouldNormalizeFilePaths took more than 1:30, after i killed the job.

@vlada-shubina
Copy link
Member

vlada-shubina commented Jan 24, 2023

#8348 solves # 2, 3 and 4 in the list, and likely other cases as well. The Unix only cases will be skipped in VS now, as the tests running on unsupported framework. This should reduce number of red tests in VS.

JaynieBai pushed a commit that referenced this issue Feb 8, 2023
Fixes #7330
(plus one subtask of #8329)

Tests only change (no production code affected)

Context
Drive enumeration integration tests need to simulate attempt to enumerate whole drive.
To prevent security and test runtime considerations - a dummy folder is created and mapped to a free letter to be offered to test as a drive for enumeration.

Changes Made
Added utility for mapping drives and mounted to affected unit tests.
@vlada-shubina
Copy link
Member

vlada-shubina commented Feb 16, 2023

Tests which are still failing:

Microsoft.Build.Utilities.UnitTests (net7.0): 1 test
Microsoft.Build.UnitTests.PrintLineDebugger_Tests.ArtifactsDirectoryLooksGood

Microsoft.Build.Utilities.UnitTests (net472): 1 test
Microsoft.Build.UnitTests.PrintLineDebugger_Tests.ArtifactsDirectoryLooksGood


Microsoft.Build.Tasks.UnitTests (net7.0): 13 tests + 1 hangs
Microsoft.Build.UnitTests.CreateItem_Tests.RecursiveDirOutOfProc - hangs
Microsoft.Build.UnitTests.PrintLineDebugger_Tests.ArtifactsDirectoryLooksGood
Microsoft.Build.UnitTests.MSBuildTask_Tests.ProjectItemSpecTooLong
Microsoft.Build.UnitTests.CreateItem_Tests.LogWindowsWarningUponItemCreationWithDriveEnumeration (3 sets)
Microsoft.Build.UnitTests.CreateItem_Tests.LogWindowsWarningUponCreateItemExecution (3 sets)
Microsoft.Build.Tasks.UnitTests.RoslynCodeTaskFactory_Tests.RoslynCodeTaskFactory_ReuseCompilation
Microsoft.Build.Tasks.UnitTests.ResourceManagement_Tests (4 tests)


Microsoft.Build.Tasks.UnitTests (net472): 8 tests
Microsoft.Build.UnitTests.PrintLineDebugger_Tests.ArtifactsDirectoryLooksGood
Microsoft.Build.UnitTests.MSBuildTask_Tests.ProjectItemSpecTooLong
Microsoft.Build.UnitTests.CreateItem_Tests.LogWindowsWarningUponItemCreationWithDriveEnumeration (3 sets)
Microsoft.Build.UnitTests.CreateItem_Tests.LogWindowsWarningUponCreateItemExecution (3 sets)


Microsoft.Build.Engine.UnitTests (net7.0): 55 tests
Microsoft.Build.Engine.UnitTests.EvaluationProfiler_Tests (12 tests) - also took 60 minutes
Microsoft.Build.Engine.UnitTests.BackEnd.TaskHostFactory_Tests (all tests) - 2 tests - took 10 minutes
Microsoft.Build.Engine.UnitTests.ProjectCache.ProjectCacheTests.RunningProxyBuildsOnOutOfProcNodesShouldIssueWarning - 2 sets took 10 minutes
Microsoft.Build.Engine.UnitTests.ProjectCache.ProjectCacheTests.ProxyCacheHitsOnPreviousCacheMissesShouldWork - took 40 minutes
Microsoft.Build.Engine.UnitTests.ProjectCache.ProjectCacheTests.ProjectCacheByVsScenarioWorks - took 40 minutes
Microsoft.Build.Engine.UnitTests.ProjectCache.ProjectCacheTests.ProjectCacheByBuildParametersAndGraphBuildWorks - took 30 minutes
Microsoft.Build.Engine.UnitTests.ProjectCache.ProjectCacheTests.ProjectCacheByBuildParametersAndBottomUpBuildWorks - took 35.1 minutes
Microsoft.Build.Engine.UnitTests.ProjectCache.ProjectCacheTests.ParallelStressTestForVsScenario - 2 sets - took 160.1 minutes
Microsoft.Build.Engine.UnitTests.ProjectCache.ProjectCacheTests.ParallelStressTest (1 data set) - took 20 minutes
Microsoft.Build.Engine.UnitTests.ProjectCache.ProjectCacheTests.CacheShouldNotGetQueriedForNestedBuildRequests - took 5 minutes
Microsoft.Build.Engine.UnitTests.ProjectCache.ProjectCacheTests.CacheShouldBeQueriedInParallelDuringGraphBuilds - 1 set - took 10 minutes
Microsoft.Build.Graph.UnitTests.IsolateProjectsTests.UndeclaredReferenceEnforcementShouldNormalizeFilePaths - 70 minutes
Microsoft.Build.Graph.UnitTests.IsolateProjectsTests.UndeclaredReferenceEnforcementShouldFailOnUndeclaredReference - 2 sets -  10 minutes
Microsoft.Build.Graph.UnitTests.IsolateProjectsTests.UndeclaredReferenceEnforcementShouldFailOnPreviouslyBuiltButUndeclaredReferences - 5 minutes
Microsoft.Build.Graph.UnitTests.IsolateProjectsTests.SkippedTargetsShouldNotTriggerCacheMissEnforcement
Microsoft.Build.Graph.UnitTests.IsolateProjectsTests.IsolationRelatedMessagesShouldNotBePresentInNonIsolatedBuilds
Microsoft.Build.Graph.UnitTests.IsolateProjectsTests.IsolationRelatedMessageShouldBePresentInIsolatedBuildsWithMessaging - 5 mintes
Microsoft.Build.Graph.UnitTests.IsolateProjectsTests.EnforcementsCanBeSkipped - 4 sets - 20 minutes
Microsoft.Build.Graph.UnitTests.IsolateProjectsTests.CacheEnforcementShouldFailWhenReferenceWasNotPreviouslyBuiltWithoutContinueOnError
Microsoft.Build.Graph.UnitTests.IsolateProjectsTests.CacheEnforcementShouldAcceptPreviouslyBuiltReferences - 2 sets - 10 minutes
Microsoft.Build.Graph.UnitTests.IsolateProjectsTests.CacheAndUndeclaredReferenceEnforcementShouldAcceptSelfReferences - 2 sets - 10 minutes
Microsoft.Build.Graph.UnitTests.IsolateProjectsTests.CacheAndUndeclaredReferenceEnforcementShouldAcceptCallTarget
Microsoft.Build.UnitTests.EscapingInProjects_Tests.SimpleScenarios.SemicolonInPropertyPassedIntoStringParam_UsingTaskHost
Microsoft.Build.UnitTests.EscapingInProjects_Tests.SimpleScenarios.ItemTransformContainingSemicolon_InTaskHost
Microsoft.Build.UnitTests.EscapingInProjects_Tests.SimpleScenarios.EscapedWildcardsShouldNotBeExpanded_InTaskHost
Microsoft.Build.UnitTests.PrintLineDebugger_Tests.ArtifactsDirectoryLooksGood
Microsoft.Build.UnitTests.MSBuildTask_Tests.ProjectItemSpecTooLong
Microsoft.Build.UnitTests.FileMatcherTest.DriveEnumeratingWildcardIsLoggedOnWindows (4 sets)
Microsoft.Build.UnitTests.BackEnd.TaskHost_Tests.TasksGetNoGlobalPropertiesIfNoneSpecified
Microsoft.Build.UnitTests.BackEnd.TaskHost_Tests.TasksCanGetGlobalProperties
Microsoft.Build.UnitTests.BackEnd.SdkResultOutOfProc_Tests.RunOutOfProcBuild - 5 minutes
Microsoft.Build.UnitTests.BackEnd.SdkResultOutOfProc_Tests.RunOutOfProcBuildWithTwoProjects - 5 minutes
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.VerifyMultipleRequestForSameProjectWithErrors_Simple
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.VerifyMultipleRequestForSameProjectWithErrors_OnErrorChain
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.VerifyMultipleRequestForSameProjectWithErrors_ErrorAndContinue
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.VerifyMultipleRequestForSameProjectWithErrors_DifferentEntrypoints
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.TestSimultaneousSubmissionsWithLegacyThreadingData_P2P_MP - do not run in VS
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.TaskInputLoggingIsExposedToTasks (2 data sets)
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.SimpleP2PBuildOutOfProc
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.SimpleP2PBuildInProc
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.SimpleBuildWithFailure
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.SimpleBuildOutOfProcess
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.ShouldBuildMutatedProjectInstanceWhoseProjectWasPreviouslyBuiltAsAP2PDependency
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.SequentialBuildsOfTheSameProjectAllowed
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.SequentialBuild
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.RequestedResultsAreSatisfied
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.Regress265010
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.Regress251333
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.Regress239661
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.ProjectInstanceTransfersToOOPNode
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.OverlappingBuildSubmissions
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.OutOfProcProjectInstanceBasedBuildDoesNotReloadFromDisk(2 data sets)
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.OutOfProcFileBasedP2PBuildSucceeds
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.OutOfProcEvaluationIdsUnique
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.MultiProcReentrantProjectWithCallTargetDoesNotFail
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.MsBuildForwardAllPropertiesFromChildLaunchChildNode
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.GraphBuildFail
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.ForwardNoPropertiesLaunchChildNodeDefault
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.ForwardNoPropertiesLaunchChildNode
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.FailedAfterTargetInP2PShouldCauseOverallBuildFailure_MultipleEntrypoints(1 data set)
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.ExplicitInprocAffinityGetsOverruledByDisableInprocNode
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.DisableInProcNode
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.CancelledBuildWithDelay40
Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.CacheLifetime



Microsoft.Build.Engine.UnitTests (net472): 12 tests
Microsoft.Build.UnitTests.PrintLineDebugger_Tests.ArtifactsDirectoryLooksGood
Microsoft.Build.UnitTests.MSBuildTask_Tests.ProjectItemSpecTooLong
Microsoft.Build.UnitTests.FileUtilities_Tests.FileOrDirectoryExistsNoThrowTooLongWithDotsRelative
Microsoft.Build.UnitTests.FileUtilities_Tests.FileOrDirectoryExistsNoThrowTooLongWithDots
Microsoft.Build.UnitTests.FileUtilities_Tests.FileExistsNoThrowTooLongWithDotsRelative
Microsoft.Build.UnitTests.FileUtilities_Tests.FileExistsNoThrowTooLongWithDots
Microsoft.Build.UnitTests.FileUtilities_Tests.DirectoryExistsNoThrowTooLongWithDotsRelative
Microsoft.Build.UnitTests.FileMatcherTest.DriveEnumeratingWildcardIsLoggedOnWindows (4 sets)
Microsoft.Build.Engine.UnitTests.BuildEnvironmentHelper_Tests.BuildEnvironmentFindsAmd64RunningInAmd64


Microsoft.Build.Engine.OM.UnitTests (net7.0): 4 tests
Microsoft.Build.UnitTests.OM.Instance.ProjectItemInstance_Tests.LogWindowsWarningUponBuildingProjectWithDriveEnumeration (4 sets)

Microsoft.Build.Engine.OM.UnitTests (net472): 4 tests
Microsoft.Build.UnitTests.OM.Instance.ProjectItemInstance_Tests.LogWindowsWarningUponBuildingProjectWithDriveEnumeration (4 sets)


Microsoft.Build.CommandLine.UnitTests (net472): 1 test
Microsoft.Build.Engine.UnitTests.MSBuildServer_Tests.MSBuildServerTest

@vlada-shubina
Copy link
Member

Related issue: #8457

@vlada-shubina vlada-shubina removed their assignment Feb 20, 2023
@AR-May AR-May added backlog Area: Our Own Build Problems affecting the build or build infrastructure of the MSBuild repo itself. Priority:3 Work that is nice to have and removed needs-triage Have yet to determine what bucket this goes in. labels Aug 15, 2023
@JaynieBai JaynieBai self-assigned this Sep 14, 2023
JaynieBai added a commit that referenced this issue Oct 10, 2023
Fixes #7330
(plus one subtask of #8329)

Changes Made
Based on Add ability to create temp mapped drive for integration tests #8366 fixes to enable other Drive enumeration integration tests with a dummy folder in windows
Remove one test data https://github.com/dotnet/msbuild/blob/fecef0fdffe59ba8b0251701a23be48bbd552726/src/Build.OM.UnitTests/Instance/ProjectItemInstance_Tests.cs#L1010-L1012C45 since there is no warning when inlude is not null and exclude with enumerating wildcards. The related logical code is
msbuild/src/Build/Utilities/EngineFileUtilities.cs

Line 339 in fecef0f

 private static void LogDriveEnumerationWarningWithTargetLoggingContext(TargetLoggingContext targetLoggingContext, IElementLocation includeLocation, IElementLocation excludeLocation, bool excludeFileSpecIsEmpty, bool disableExcludeDriveEnumerationWarning, string fileSpec) 
. There is no condition satisfied.
Associate unix Enumeration Tests long time run with issue Unix drive enumeration imports not expanded? #8373
bulatgrzegorz pushed a commit to bulatgrzegorz/selective-condition-evaluator that referenced this issue Oct 16, 2023
Fixes dotnet#7330
(plus one subtask of dotnet#8329)

Changes Made
Based on Add ability to create temp mapped drive for integration tests dotnet#8366 fixes to enable other Drive enumeration integration tests with a dummy folder in windows
Remove one test data https://github.com/dotnet/msbuild/blob/fecef0fdffe59ba8b0251701a23be48bbd552726/src/Build.OM.UnitTests/Instance/ProjectItemInstance_Tests.cs#L1010-L1012C45 since there is no warning when inlude is not null and exclude with enumerating wildcards. The related logical code is
msbuild/src/Build/Utilities/EngineFileUtilities.cs

Line 339 in fecef0f

 private static void LogDriveEnumerationWarningWithTargetLoggingContext(TargetLoggingContext targetLoggingContext, IElementLocation includeLocation, IElementLocation excludeLocation, bool excludeFileSpecIsEmpty, bool disableExcludeDriveEnumerationWarning, string fileSpec) 
. There is no condition satisfied.
Associate unix Enumeration Tests long time run with issue Unix drive enumeration imports not expanded? dotnet#8373
MichalPavlik pushed a commit that referenced this issue Oct 17, 2023
Fixes #7330
(plus one subtask of #8329)

Changes Made
Based on Add ability to create temp mapped drive for integration tests #8366 fixes to enable other Drive enumeration integration tests with a dummy folder in windows
Remove one test data https://github.com/dotnet/msbuild/blob/fecef0fdffe59ba8b0251701a23be48bbd552726/src/Build.OM.UnitTests/Instance/ProjectItemInstance_Tests.cs#L1010-L1012C45 since there is no warning when inlude is not null and exclude with enumerating wildcards. The related logical code is
msbuild/src/Build/Utilities/EngineFileUtilities.cs

Line 339 in fecef0f

 private static void LogDriveEnumerationWarningWithTargetLoggingContext(TargetLoggingContext targetLoggingContext, IElementLocation includeLocation, IElementLocation excludeLocation, bool excludeFileSpecIsEmpty, bool disableExcludeDriveEnumerationWarning, string fileSpec) 
. There is no condition satisfied.
Associate unix Enumeration Tests long time run with issue Unix drive enumeration imports not expanded? #8373
@JaynieBai JaynieBai removed their assignment Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Our Own Build Problems affecting the build or build infrastructure of the MSBuild repo itself. backlog bug Priority:3 Work that is nice to have triaged
Projects
None yet
Development

No branches or pull requests

6 participants