未验证 提交 019bc7f1 编写于 作者: T Tomáš Rylek 提交者: GitHub

Fix a few issues with merged wrappers uncovered by local testing (#67211)

After merging in the last preparatory change (deduplication of
tests with the same assembly names) I'm now testing the "final"
JIT/Methodical switchover change; this testing uncovered a few
previously unseen issues related to the merged wrappers and I'm
sending them for a separate PR to decouple them from the big
mechanical switchover change.

1) For out-of-process tests, "Method" contains the relative test
execution script path; we need to prefix the string with "@"
to avoid complaining about backslashes on Windows.

2) Jeremy recently added a consistency check to catch multiple
projects producing assemblies with the same simple name; turns
out there was a subtle bug where the check blew up on projects
with DisableProjectBuild set to true.

3) A similar problem exists for projects with the property
CLRTestTargetUnsupported but I haven't added it to the fix;
I believe it is healthy to receive this type of error in the build
as with the merged wrappers the CLRTestTargetUnsupported clauses
need to be removed and replaced with ConditionalFactAttribute
annotations, otherwise we could lose part of the conditional
code coverage as in the lab the managed tests are build only
once on an arbitrary platform so their individual platform-specific
exclusions must be postponed to execution time.

Thanks

Tomas
上级 afc175f3
......@@ -354,6 +354,6 @@ public string WrapTestExecutionWithReporting(string testExecutionExpression, ITe
public string GenerateSkippedTestReporting(ITestInfo skippedTest)
{
return $"{_summaryLocalIdentifier}.ReportSkippedTest({skippedTest.TestNameExpression}, \"{skippedTest.ContainingType}\", \"{skippedTest.Method}\", System.TimeSpan.Zero, string.Empty);";
return $"{_summaryLocalIdentifier}.ReportSkippedTest({skippedTest.TestNameExpression}, \"{skippedTest.ContainingType}\", @\"{skippedTest.Method}\", System.TimeSpan.Zero, string.Empty);";
}
}
<Project>
<Target Name="_ValidateNoTestProjectsDroppedByConflictResolution" AfterTargets="ResolveReferences">
<MSBuild Projects="@(ProjectReference)" Targets="GetProjectsWithDisabledBuild" SkipNonexistentTargets="true">
<Output TaskParameter="TargetOutputs" ItemName="_ReferenceWithDisabledBuild" />
</MSBuild>
<ItemGroup>
<_ProjectReferencesUsedByReferencePaths Include="@(ReferencePath->Metadata('ProjectReferenceOriginalItemSpec'))" />
<_ProjectAssemblyReferences Include="@(ProjectReference)" Condition="'%(ProjectReference.OutputItemType)' == ''" />
<_ProjectAssemblyReferences Remove="@(_ReferenceWithDisabledBuild->Metadata('OriginalItemSpec'))" />
<_ProjectReferencesRemovedDueToConflictResolution Include="@(_ProjectAssemblyReferences)" Exclude="@(_ProjectReferencesUsedByReferencePaths)" />
</ItemGroup>
<!--
......
......@@ -430,6 +430,12 @@
</Target>
<Target Name="GetProjectsWithDisabledBuild" Returns="@(ProjectWithDisabledBuild)">
<ItemGroup Condition="'$(_WillCLRTestProjectBuild)' != 'true'">
<ProjectWithDisabledBuild Include="$(MSBuildProjectFullPath)" />
</ItemGroup>
</Target>
<Target Name="GetRequiresProcessIsolation" Returns="@(ProjectRequiringProcessIsolation)">
<ItemGroup Condition="'$(RequiresProcessIsolation)' == 'true'">
<ProjectRequiringProcessIsolation Include="$(MSBuildProjectFullPath)" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册