Merge pull request #14899 from dotnet/marcpopMSFT-fixtelemetrytestversion

Get the telemetry version from the --version command and use it to fi…
This commit is contained in:
Marc Paine 2022-11-08 14:20:55 -08:00 committed by GitHub
commit 0576e20e69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,13 @@ namespace EndToEnd.Tests
[Fact]
public void TelemetryOptOutDefaultAttribute()
{
var dotnetdir = Path.Combine(Path.GetDirectoryName(RepoDirectoriesProvider.DotnetUnderTest), "sdk", "7.0.101");
var versionCommand = new DotnetCommand()
.ExecuteWithCapturedOutput("--version");
var sdkVersion = versionCommand.StdOut.Trim();
var dotnetdir = Path.Combine(Path.GetDirectoryName(RepoDirectoriesProvider.DotnetUnderTest), "sdk", sdkVersion);
var result = AssemblyInfo.Get(Path.Combine(dotnetdir, "dotnet.dll"), "AssemblyMetadataAttribute");
result.Should().Contain("TelemetryOptOutDefault:False");
}