From 6ba6af0cb11482425a5eae72e4bb2b4fbf0bdb69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Tue, 25 Aug 2020 13:25:27 +0200 Subject: [PATCH] Merge rel16.7 into master (#2534) * Hide -release in console * Add param block * Match on whole branch name * Set var * Change assertion * Trim version * Update dependencies from https://github.com/dotnet/arcade build 20200602.3 (#2456) Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.SignTool , Microsoft.DotNet.SwaggerGenerator.MSBuild From Version 5.0.0-beta.20052.1 -> To Version 1.0.0-beta.20302.3 Co-authored-by: dotnet-maestro[bot] * Update feeds * Revert to previous dotnet version * Added new exception handling (#2461) * Test space added * Exception handler was added to catch AccessDeniedException while trying to create TestResults folder * Remove unnecessary space * Deleted unnecessary test. Changed console message and corrected folder path in that message * Remove unnecessary dot * Removed unnecessary lines and usings and coreccted exception message * Removed unnecessary line * Updating resource files * New exception handling was added * Formatted exception message * Adding test run attachments processing (#2463) * v1 * Merging v1 * Rename to MultiTestRunsFinalization * New version * More changes * More changes * Next changes * Fix * test * More changes * Dmc chagnes * next * small changes * compiled * More changes * acceptance tests green * Review comments #1 * Resolving more comments * Tests for design mode client * Tests for events handler * revert not related changes * More changes * Compiling OK, tests OK * Unit tests for manager * More changes * More tests * tests for reqeust sender * more tests * Tests for cancelling * Acceptance tests done * Remove not used stuff * Fix comments * Fix race condition in test * Fix another race condition * Fix converting to xml * fix next test * fix test * Next changes * Review changes #1 * Fixing multi test finalization manager tests * Fixes * Fix last unit test * Fix acceptance tests * Progress feature, compiling + unit tests * acceptance tests changes * More changes * Fixing resources accesability * Fix test * Fix race conditions in acceptance tests * RFC changes merged * Log warning in case of unexpected message id * Fix spelling * Additional comment * Restore some stuff in interfaces * Big renaming * Added processingSettings * Fix naming * Move explanation to * Fixed code coverage compatibility issue (#2527) Fixed code coverage compatibility issue Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: dotnet-maestro[bot] Co-authored-by: Sanan Yuzbashiyev Co-authored-by: Jakub Chocholowicz <59966772+jakubch1@users.noreply.github.com> Co-authored-by: Codrin-Victor Poienaru --- scripts/verify-nupkgs.ps1 | 3 ++- scripts/vsts-prebuild.ps1 | 17 ++++++++++++++--- src/vstest.console/CommandLine/Executor.cs | 18 ++++++++++++++---- .../ExecutorUnitTests.cs | 14 ++++++++------ 4 files changed, 38 insertions(+), 14 deletions(-) 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]