diff --git a/scripts/verify-nupkgs.ps1 b/scripts/verify-nupkgs.ps1 index ca37e0fffb..de298b360c 100644 --- a/scripts/verify-nupkgs.ps1 +++ b/scripts/verify-nupkgs.ps1 @@ -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; diff --git a/scripts/vsts-prebuild.ps1 b/scripts/vsts-prebuild.ps1 index f49ad135a2..ba170867ad 100644 --- a/scripts/vsts-prebuild.ps1 +++ b/scripts/vsts-prebuild.ps1 @@ -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 @@ -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 diff --git a/src/vstest.console/CommandLine/Executor.cs b/src/vstest.console/CommandLine/Executor.cs index 52beddf73e..7c4b033d30 100644 --- a/src/vstest.console/CommandLine/Executor.cs +++ b/src/vstest.console/CommandLine/Executor.cs @@ -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; @@ -375,10 +376,19 @@ private bool ExecuteArgumentProcessor(IArgumentProcessor processor, ref int exit /// /// Displays the Company and Copyright splash title info immediately after launch /// - 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); diff --git a/test/vstest.console.UnitTests/ExecutorUnitTests.cs b/test/vstest.console.UnitTests/ExecutorUnitTests.cs index 0585398afb..3fe3820b8f 100644 --- a/test/vstest.console.UnitTests/ExecutorUnitTests.cs +++ b/test/vstest.console.UnitTests/ExecutorUnitTests.cs @@ -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]