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

Merge rel16.7 into master #2534

Merged
merged 14 commits into from
Aug 25, 2020
3 changes: 2 additions & 1 deletion scripts/verify-nupkgs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ function Unzip
function Verify-Nuget-Packages($packageDirectory)
{
Write-Log "Starting Verify-Nuget-Packages."
$expectedNumOfFiles = @{"Microsoft.CodeCoverage" = 29;
$expectedNumOfFiles = @{
"Microsoft.CodeCoverage" = 29;
"Microsoft.NET.Test.Sdk" = 13;
"Microsoft.TestPlatform" = 469;
"Microsoft.TestPlatform.Build" = 19;
Expand Down
17 changes: 14 additions & 3 deletions scripts/vsts-prebuild.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Sets variables which are used across the build tasks.

$buildSuffix = $args[0]
$IsRtmBuild = $args[1]
param (
[Parameter(Mandatory)]
[string] $BuildSuffix,
[Parameter(Mandatory)]
[string] $IsRtmBuild,
[Parameter(Mandatory)]
$Branch
)

$TP_ROOT_DIR = (Get-Item (Split-Path $MyInvocation.MyCommand.Path)).Parent.FullName

Expand All @@ -11,9 +17,14 @@ $buildPrefix = $TpVersion.Trim()

if ($IsRtmBuild.ToLower() -eq "false")
{
if ($null -ne $Branch -and $Branch -like "refs/heads/rel/*")
{
$BuildSuffix = $BuildSuffix -replace "preview", "release"
}

$packageVersion = $buildPrefix+"-"+$buildSuffix
}
else
else
{
$packageVersion = $buildPrefix
$buildSuffix = [string]::Empty
Expand Down
18 changes: 14 additions & 4 deletions src/vstest.console/CommandLine/Executor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ internal int Execute(params string[] args)
}
else
{
this.PrintSplashScreen();
var isDiag = args != null && args.Any(arg => arg.StartsWith("--diag", StringComparison.OrdinalIgnoreCase));
this.PrintSplashScreen(isDiag);
}

int exitCode = 0;
Expand Down Expand Up @@ -375,10 +376,19 @@ private bool ExecuteArgumentProcessor(IArgumentProcessor processor, ref int exit
/// <summary>
/// Displays the Company and Copyright splash title info immediately after launch
/// </summary>
private void PrintSplashScreen()
private void PrintSplashScreen(bool isDiag)
{
string assemblyVersion = string.Empty;
assemblyVersion = Product.Version;
string assemblyVersion = Product.Version;
if (!isDiag)
{
var end = Product.Version?.IndexOf("-release");

if (end >= 0)
{
assemblyVersion = Product.Version?.Substring(0, end.Value);
}
}

string commandLineBanner = string.Format(CultureInfo.CurrentUICulture, CommandLineResources.MicrosoftCommandLineTitle, assemblyVersion);
this.Output.WriteLine(commandLineBanner, OutputLevel.Information);
this.Output.WriteLine(CommandLineResources.CopyrightCommandLineTitle, OutputLevel.Information);
Expand Down
14 changes: 8 additions & 6 deletions test/vstest.console.UnitTests/ExecutorUnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ public void ExecutorPrintsSplashScreenTest()
Assert.IsNotNull(mockOutput.Messages.First().Message, "First Printed Message cannot be null or empty");

// Just check first 20 characters - don't need to check whole thing as assembly version is variable
Assert.IsTrue(
mockOutput.Messages.First()
.Message.Contains(CommandLineResources.MicrosoftCommandLineTitle.Substring(0, 20)),
"First Printed message must be Microsoft Copyright");

Assert.IsTrue(mockOutput.Messages.First().Message.EndsWith(assemblyVersion));
// "First Printed message must be Microsoft Copyright");
StringAssert.Contains(mockOutput.Messages.First().Message,
CommandLineResources.MicrosoftCommandLineTitle.Substring(0, 20));

var suffixIndex = assemblyVersion.IndexOf("-");
var version = suffixIndex == -1 ? assemblyVersion : assemblyVersion.Substring(0, suffixIndex);
StringAssert.Contains(mockOutput.Messages.First().Message,
version);
}

[TestMethod]
Expand Down