Skip to content

Commit 227f6b4

Browse files
committed
fix test case by making it pack as a tool so that the requested target actually exists
1 parent 7e9e0cf commit 227f6b4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/Microsoft.NET.Build.Tests/GivenThatWeWantToCollectExceptionTelemetry.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ public void It_collects_Exception()
1717
Type loggerType = typeof(LogTelemetryToStdOutForTest);
1818
string telemetryTestLogger = $"/Logger:{loggerType.FullName},{loggerType.GetTypeInfo().Assembly.Location}";
1919

20-
var testAsset = _testAssetsManager.CopyTestAsset("HelloWorld").WithSource();
20+
var testAsset = _testAssetsManager.CopyTestAsset("HelloWorld").WithSource()
21+
.WithProjectChanges(projectFile =>
22+
projectFile.Root!.Descendants()
23+
.First(e => e.Name.LocalName == "PropertyGroup")
24+
.Add(XElement.Parse("""
25+
<PackAsTool>true</PackAsTool>
26+
""")));
2127

2228
var mSBuildCommand = new MSBuildCommand(Log, "GenerateToolsSettingsFileFromBuildProperty", Path.Combine(testAsset.TestRoot));
2329

0 commit comments

Comments
 (0)