Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ Copyright (c) .NET Foundation. All rights reserved.
<TFTelemetry Include="OutputType" Value="$(OutputType)" />
<TFTelemetry Include="UseArtifactsOutput" Value="$(UseArtifactsOutput)" />
<TFTelemetry Include="ArtifactsPathLocationType" Value="$(_ArtifactsPathLocationType)" />
<TFTelemetry Include="TargetPlatformIdentifier" Value="$(TargetPlatformIdentifier)" />
<TFTelemetry Include="UseMonoRuntime" Value="$(UseMonoRuntime)" />
<TFTelemetry Include="PublishAot" Value="$(PublishAot)" />
<TFTelemetry Include="PublishTrimmed" Value="$(PublishTrimmed)" />
<TFTelemetry Include="PublishSelfContained" Value="$(PublishSelfContained)" />
<TFTelemetry Include="PublishReadyToRun" Value="$(PublishReadyToRun)" />
<TFTelemetry Include="PublishReadyToRunComposite" Value="$(PublishReadyToRunComposite)" />
<TFTelemetry Include="PublishProtocol" Value="$(PublishProtocol)" />
<TFTelemetry Include="Configuration" Value="$(Configuration)" />
</ItemGroup>
<AllowEmptyTelemetry EventName="targetframeworkeval" EventData="@(TFTelemetry)" />
</Target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@ public GivenThatWeWantToBuildANetCoreAppAndPassingALogger(ITestOutputHelper log)
{
}

private string CreateTargetFrameworkEvalTelemetryJson(
string targetFrameworkVersion,
string targetPlatformIdentifier = "null",
string runtimeIdentifier = "null",
string selfContained = "null",
string useApphost = "null",
string outputType = "Library",
string useArtifactsOutput = "null",
string artifactsPathLocationType = "null",
string useMonoRuntime = "null",
string publishAot = "null",
string publishTrimmed = "null",
string publishSelfContained = "null",
string publishReadyToRun = "null",
string publishReadyToRunComposite = "false",
string publishProtocol = "null",
string configuration = "Debug")
{
return $"{{\"EventName\":\"targetframeworkeval\",\"Properties\":{{\"TargetFrameworkVersion\":\"{targetFrameworkVersion}\",\"RuntimeIdentifier\":\"{runtimeIdentifier}\",\"SelfContained\":\"{selfContained}\",\"UseApphost\":\"{useApphost}\",\"OutputType\":\"{outputType}\",\"UseArtifactsOutput\":\"{useArtifactsOutput}\",\"ArtifactsPathLocationType\":\"{artifactsPathLocationType}\",\"TargetPlatformIdentifier\":\"{targetPlatformIdentifier}\",\"UseMonoRuntime\":\"{useMonoRuntime}\",\"PublishAot\":\"{publishAot}\",\"PublishTrimmed\":\"{publishTrimmed}\",\"PublishSelfContained\":\"{publishSelfContained}\",\"PublishReadyToRun\":\"{publishReadyToRun}\",\"PublishReadyToRunComposite\":\"{publishReadyToRunComposite}\",\"PublishProtocol\":\"{publishProtocol}\",\"Configuration\":\"{configuration}\"}}";
}

[CoreMSBuildOnlyFact]
public void It_collects_TargetFramework_version_and_other_properties()
{
Expand All @@ -32,7 +53,8 @@ public void It_collects_TargetFramework_version_and_other_properties()
buildCommand
.Execute(TelemetryTestLogger)
.StdOut.Should()
.Contain($"{{\"EventName\":\"targetframeworkeval\",\"Properties\":{{\"TargetFrameworkVersion\":\".NETCoreApp,Version=v{ToolsetInfo.CurrentTargetFrameworkVersion}\",\"RuntimeIdentifier\":\"null\",\"SelfContained\":\"null\",\"UseApphost\":\"null\",\"OutputType\":\"Library\",\"UseArtifactsOutput\":\"null\",\"ArtifactsPathLocationType\":\"null\"}}");
.Contain(CreateTargetFrameworkEvalTelemetryJson(
$".NETCoreApp,Version=v{ToolsetInfo.CurrentTargetFrameworkVersion}"));
}

[CoreMSBuildOnlyFact]
Expand All @@ -59,11 +81,13 @@ public void It_collects_multi_TargetFramework_version_and_other_properties()

result
.StdOut.Should()
.Contain(
"{\"EventName\":\"targetframeworkeval\",\"Properties\":{\"TargetFrameworkVersion\":\".NETFramework,Version=v4.6\",\"RuntimeIdentifier\":\"null\",\"SelfContained\":\"null\",\"UseApphost\":\"null\",\"OutputType\":\"Library\",\"UseArtifactsOutput\":\"null\",\"ArtifactsPathLocationType\":\"null\"}")
.Contain(CreateTargetFrameworkEvalTelemetryJson(
".NETFramework,Version=v4.6",
targetPlatformIdentifier: "Windows",
publishReadyToRunComposite: "null"))
.And
.Contain(
$"{{\"EventName\":\"targetframeworkeval\",\"Properties\":{{\"TargetFrameworkVersion\":\".NETCoreApp,Version=v{ToolsetInfo.CurrentTargetFrameworkVersion}\",\"RuntimeIdentifier\":\"null\",\"SelfContained\":\"null\",\"UseApphost\":\"null\",\"OutputType\":\"Library\",\"UseArtifactsOutput\":\"null\",\"ArtifactsPathLocationType\":\"null\"}}");
.Contain(CreateTargetFrameworkEvalTelemetryJson(
$".NETCoreApp,Version=v{ToolsetInfo.CurrentTargetFrameworkVersion}"));
}
}
}