Skip to content

Commit 0c0fafa

Browse files
committed
Merge branch 'master' of https://github.com/microsoft/vstest into rel/16.8
2 parents b9cd8eb + 95cb80f commit 0c0fafa

File tree

36 files changed

+272
-180
lines changed

36 files changed

+272
-180
lines changed

NuGet.config

+1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@
2323
<!-- This path is relative as a workaround to https://github.com/NuGet/Home/issues/2831 -->
2424
<add key="globalPackagesFolder" value="packages" />
2525
</config>
26+
<disabledPackageSources />
2627
</configuration>

eng/Version.Details.xml

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
<ProductDependencies>
44
</ProductDependencies>
55
<ToolsetDependencies>
6-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.20411.9">
6+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.20427.6">
77
<Uri>https://github.com/dotnet/arcade</Uri>
8-
<Sha>2e804f8d57972faf64a19a7295728dc7bfcb5fce</Sha>
8+
<Sha>84cd401ce792220bdb17c5587f9b39265170c03f</Sha>
99
</Dependency>
10-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="2.2.0-beta.20411.9">
10+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="2.2.0-beta.20427.6">
1111
<Uri>https://github.com/dotnet/arcade</Uri>
12-
<Sha>2e804f8d57972faf64a19a7295728dc7bfcb5fce</Sha>
12+
<Sha>84cd401ce792220bdb17c5587f9b39265170c03f</Sha>
1313
</Dependency>
14-
<Dependency Name="Microsoft.DotNet.SignTool" Version="1.0.0-beta.20411.9">
14+
<Dependency Name="Microsoft.DotNet.SignTool" Version="1.0.0-beta.20427.6">
1515
<Uri>https://github.com/dotnet/arcade</Uri>
16-
<Sha>2e804f8d57972faf64a19a7295728dc7bfcb5fce</Sha>
16+
<Sha>84cd401ce792220bdb17c5587f9b39265170c03f</Sha>
1717
</Dependency>
18-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="2.0.0-beta.20411.9">
18+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="2.0.0-beta.20427.6">
1919
<Uri>https://github.com/dotnet/arcade</Uri>
20-
<Sha>2e804f8d57972faf64a19a7295728dc7bfcb5fce</Sha>
20+
<Sha>84cd401ce792220bdb17c5587f9b39265170c03f</Sha>
2121
</Dependency>
22-
<Dependency Name="Microsoft.DotNet.SwaggerGenerator.MSBuild" Version="1.0.0-beta.20411.9">
22+
<Dependency Name="Microsoft.DotNet.SwaggerGenerator.MSBuild" Version="1.0.0-beta.20427.6">
2323
<Uri>https://github.com/dotnet/arcade</Uri>
24-
<Sha>2e804f8d57972faf64a19a7295728dc7bfcb5fce</Sha>
24+
<Sha>84cd401ce792220bdb17c5587f9b39265170c03f</Sha>
2525
</Dependency>
2626
<Dependency Name="Microsoft.DotNet.Maestro.Client" Version="1.1.0-beta.19556.4">
2727
<Uri>https://github.com/dotnet/arcade-services</Uri>

eng/Versions.props

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
<XUnitVersion>2.4.1</XUnitVersion>
6161
<XUnitAbstractionsVersion>2.0.3</XUnitAbstractionsVersion>
6262
<XUnitVSRunnerVersion>2.4.1</XUnitVSRunnerVersion>
63-
<MicrosoftDotNetBuildTasksFeedVersion>2.2.0-beta.20411.9</MicrosoftDotNetBuildTasksFeedVersion>
64-
<MicrosoftDotNetSignToolVersion>1.0.0-beta.20411.9</MicrosoftDotNetSignToolVersion>
63+
<MicrosoftDotNetBuildTasksFeedVersion>2.2.0-beta.20427.6</MicrosoftDotNetBuildTasksFeedVersion>
64+
<MicrosoftDotNetSignToolVersion>1.0.0-beta.20427.6</MicrosoftDotNetSignToolVersion>
6565
<MicrosoftAzureDocumentDBVersion>1.22.0</MicrosoftAzureDocumentDBVersion>
6666
<MicrosoftAzureCosmosDBTableVersion>1.1.2</MicrosoftAzureCosmosDBTableVersion>
6767
<MicrosoftAspNetCoreAllVersion>2.0.0</MicrosoftAspNetCoreAllVersion>
@@ -73,7 +73,7 @@
7373
<MicrosoftDiaSymReaderNativeVersion>1.7.0</MicrosoftDiaSymReaderNativeVersion>
7474
<MicrosoftDotNetMaestroClientVersion>1.1.0-beta.19556.4</MicrosoftDotNetMaestroClientVersion>
7575
<MicrosoftSourceLinkVersion>1.0.0-beta2-19554-01</MicrosoftSourceLinkVersion>
76-
<MicrosoftDotNetSwaggerGeneratorMSBuildVersion>1.0.0-beta.20411.9</MicrosoftDotNetSwaggerGeneratorMSBuildVersion>
76+
<MicrosoftDotNetSwaggerGeneratorMSBuildVersion>1.0.0-beta.20427.6</MicrosoftDotNetSwaggerGeneratorMSBuildVersion>
7777
<XliffTasksVersion>1.0.0-beta.20055.1</XliffTasksVersion>
7878
</PropertyGroup>
7979
</Project>

eng/common/darc-init.sh

+22-8
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
source="${BASH_SOURCE[0]}"
44
darcVersion=''
5-
versionEndpoint="https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16"
6-
verbosity=m
5+
versionEndpoint='https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16'
6+
verbosity='minimal'
77

88
while [[ $# > 0 ]]; do
99
opt="$(echo "$1" | awk '{print tolower($0)}')"
@@ -20,6 +20,10 @@ while [[ $# > 0 ]]; do
2020
verbosity=$2
2121
shift
2222
;;
23+
--toolpath)
24+
toolpath=$2
25+
shift
26+
;;
2327
*)
2428
echo "Invalid argument: $1"
2529
usage
@@ -52,17 +56,27 @@ function InstallDarcCli {
5256
InitializeDotNetCli
5357
local dotnet_root=$_InitializeDotNetCli
5458

55-
local uninstall_command=`$dotnet_root/dotnet tool uninstall $darc_cli_package_name -g`
56-
local tool_list=$($dotnet_root/dotnet tool list -g)
57-
if [[ $tool_list = *$darc_cli_package_name* ]]; then
58-
echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name -g)
59+
if [ -z "$toolpath" ]; then
60+
local tool_list=$($dotnet_root/dotnet tool list -g)
61+
if [[ $tool_list = *$darc_cli_package_name* ]]; then
62+
echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name -g)
63+
fi
64+
else
65+
local tool_list=$($dotnet_root/dotnet tool list --tool-path "$toolpath")
66+
if [[ $tool_list = *$darc_cli_package_name* ]]; then
67+
echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name --tool-path "$toolpath")
68+
fi
5969
fi
6070

61-
local arcadeServicesSource="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json"
71+
local arcadeServicesSource="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json"
6272

6373
echo "Installing Darc CLI version $darcVersion..."
6474
echo "You may need to restart your command shell if this is the first dotnet tool you have installed."
65-
echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g)
75+
if [ -z "$toolpath" ]; then
76+
echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g)
77+
else
78+
echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath")
79+
fi
6680
}
6781

6882
InstallDarcCli

global.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dotnet": "5.0.100-rc.1.20380.12"
1010
},
1111
"msbuild-sdks": {
12-
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.20411.9",
13-
"Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.20411.9"
12+
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.20427.6",
13+
"Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.20427.6"
1414
}
1515
}

scripts/build.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ function Create-NugetPackages
717717

718718
# Additional external dependency folders
719719
$microsoftFakesVersion = ([xml](Get-Content $env:TP_ROOT_DIR\scripts\build\TestPlatform.Dependencies.props)).Project.PropertyGroup.MicrosoftFakesVersion
720-
$FakesPackageDir = Join-Path $env:TP_PACKAGES_DIR "Microsoft.VisualStudio.TestPlatform.Fakes\$microsoftFakesVersion\lib"
720+
$FakesPackageDir = Join-Path $env:TP_PACKAGES_DIR "Microsoft.QualityTools.Testing.Fakes.TestRunnerHarness\$microsoftFakesVersion\contentFiles"
721721

722722
# package them from stagingDir
723723
foreach ($file in $nuspecFiles) {

scripts/build/TestPlatform.Dependencies.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<JsonNetVersion>9.0.1</JsonNetVersion>
3333
<MoqVersion>4.7.63</MoqVersion>
3434
<TestPlatformExternalsVersion>16.8.0-preview-3968212</TestPlatformExternalsVersion>
35-
<MicrosoftFakesVersion>16.6.3-beta.20221.2</MicrosoftFakesVersion>
35+
<MicrosoftFakesVersion>16.8.0-beta.20420.2</MicrosoftFakesVersion>
3636

3737
<MicrosoftBuildPackageVersion>16.0.461</MicrosoftBuildPackageVersion>
3838
<MicrosoftBuildFrameworkPackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildFrameworkPackageVersion>

scripts/verify-nupkgs.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function Verify-Nuget-Packages($packageDirectory)
1515
$expectedNumOfFiles = @{
1616
"Microsoft.CodeCoverage" = 29;
1717
"Microsoft.NET.Test.Sdk" = 13;
18-
"Microsoft.TestPlatform" = 469;
18+
"Microsoft.TestPlatform" = 477;
1919
"Microsoft.TestPlatform.Build" = 19;
2020
"Microsoft.TestPlatform.CLI" = 350;
2121
"Microsoft.TestPlatform.Extensions.TrxLogger" = 33;

scripts/vsts-prebuild.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ $JsonNetVersion = ([xml](Get-Content $TP_ROOT_DIR\scripts\build\TestPlatform.Dep
4141
Write-Host "##vso[task.setvariable variable=JsonNetVersion;]$JsonNetVersion"
4242

4343
$microsoftFakesVersion = ([xml](Get-Content $TP_ROOT_DIR\scripts\build\TestPlatform.Dependencies.props)).Project.PropertyGroup.MicrosoftFakesVersion
44-
$FakesPackageDir = Join-Path $TP_ROOT_DIR "packages\Microsoft.VisualStudio.TestPlatform.Fakes\$microsoftFakesVersion\lib"
44+
$FakesPackageDir = Join-Path $TP_ROOT_DIR "packages\Microsoft.QualityTools.Testing.Fakes.TestRunnerHarness\$microsoftFakesVersion\contentFiles"
4545
Write-Host "##vso[task.setvariable variable=FakesPackageDir;]$FakesPackageDir"

src/Microsoft.TestPlatform.Common/Utilities/RunSettingsProviderExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static void UpdateRunSettingsNode(this IRunSettingsProvider runSettingsPr
9595
/// <returns></returns>
9696
public static Match GetTestRunParameterNodeMatch(this IRunSettingsProvider runSettingsProvider, string node)
9797
{
98-
var attrName = $"(?<{AttributeNameString}>\\w+)";
98+
var attrName = $"(?<{AttributeNameString}>[\\w.:-]+)";
9999
var attrValue = $"(?<{AttributeValueString}>.+)";
100100
Regex regex = new Regex($"{Constants.TestRunParametersName}.{ParameterString}\\(name\\s*=\\s*\"{attrName}\"\\s*,\\s*value\\s*=\\s*\"{attrValue}\"\\)");
101101
Match match = regex.Match(node);

src/Microsoft.TestPlatform.CommunicationUtilities/Interfaces/Communication/CommunicationException.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@ namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Interfaces
1111
public class CommunicationException : Exception
1212
{
1313
/// <summary>
14-
/// Initializes a new instance of <see cref="CommunicationException" /> class.
14+
/// Initializes a new instance of the <see cref="CommunicationException" /> class.
1515
/// </summary>
1616
public CommunicationException()
1717
{
1818
}
1919

2020
/// <summary>
21-
/// Initializes a new instance of <see cref="CommunicationException" /> class with provided
21+
/// Initializes a new instance of the <see cref="CommunicationException" /> class with provided
2222
/// message.
2323
/// </summary>
24-
/// <param Name="message">Message describing the error.</param>
24+
/// <param name="message">Message describing the error.</param>
2525
public CommunicationException(string message)
2626
: base(message)
2727
{
2828
}
2929

3030
/// <summary>
31-
/// Initializes a new instance of <see cref="CommunicationException" /> class with provided
31+
/// Initializes a new instance of the <see cref="CommunicationException" /> class with provided
3232
/// message and inner exception.
3333
/// </summary>
34-
/// <param Name="message">Message describing the error.</param>
35-
/// <param Name="inner">Inner exception.</param>
34+
/// <param name="message">Message describing the error.</param>
35+
/// <param name="inner">Inner exception.</param>
3636
public CommunicationException(string message, Exception inner)
3737
: base(message, inner)
3838
{

src/Microsoft.TestPlatform.Extensions.BlameDataCollector/BlameCollector.cs

+24-36
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public class BlameCollector : DataCollector, ITestExecutionEnvironmentSpecifier
4646
private IInactivityTimer inactivityTimer;
4747
private TimeSpan inactivityTimespan = TimeSpan.FromMinutes(DefaultInactivityTimeInMinutes);
4848
private int testHostProcessId;
49-
private bool dumpWasCollectedByHangDumper;
5049
private string targetFramework;
5150
private List<KeyValuePair<string, string>> environmentVariables = new List<KeyValuePair<string, string>>();
5251
private bool uploadDumpFiles;
@@ -223,7 +222,7 @@ private void CollectDumpAndAbortTesthost()
223222
}
224223
catch (Exception ex)
225224
{
226-
ConsoleOutput.Instance.Error(true, $"Blame: Creating hang dump failed with error {ex}.");
225+
this.logger.LogError(this.context.SessionDataCollectionContext, $"Blame: Creating hang dump failed with error.", ex);
227226
}
228227

229228
if (this.collectProcessDumpOnTrigger)
@@ -244,7 +243,6 @@ private void CollectDumpAndAbortTesthost()
244243
{
245244
if (!string.IsNullOrEmpty(dumpFile))
246245
{
247-
this.dumpWasCollectedByHangDumper = true;
248246
var fileTransferInformation = new FileTransferInformation(this.context.SessionDataCollectionContext, dumpFile, true, this.fileHelper);
249247
this.dataCollectionSink.SendFileAsync(fileTransferInformation);
250248
}
@@ -263,7 +261,7 @@ private void CollectDumpAndAbortTesthost()
263261
}
264262
catch (Exception ex)
265263
{
266-
ConsoleOutput.Instance.Error(true, $"Blame: Collecting hang dump failed with error {ex}.");
264+
this.logger.LogError(this.context.SessionDataCollectionContext, $"Blame: Collecting hang dump failed with error.", ex);
267265
}
268266
}
269267
else
@@ -452,47 +450,37 @@ private void SessionEndedHandler(object sender, SessionEndEventArgs args)
452450
this.logger.LogWarning(this.context.SessionDataCollectionContext, Resources.Resources.NotGeneratingSequenceFile);
453451
}
454452

455-
if (this.collectProcessDumpOnTrigger)
453+
if (this.uploadDumpFiles)
456454
{
457-
// If there was a test case crash or if we need to collect dump on process exit.
458-
//
459-
// Do not try to collect dump when we already collected one from the hang dump
460-
// we won't dump the killed process again and that would just show a warning on the command line
461-
if ((this.testStartCount > this.testEndCount || this.collectDumpAlways) && !this.dumpWasCollectedByHangDumper)
455+
try
462456
{
463-
if (this.uploadDumpFiles)
457+
var dumpFiles = this.processDumpUtility.GetDumpFiles();
458+
foreach (var dumpFile in dumpFiles)
464459
{
465-
try
460+
if (!string.IsNullOrEmpty(dumpFile))
466461
{
467-
var dumpFiles = this.processDumpUtility.GetDumpFiles();
468-
foreach (var dumpFile in dumpFiles)
462+
try
469463
{
470-
if (!string.IsNullOrEmpty(dumpFile))
471-
{
472-
try
473-
{
474-
var fileTranferInformation = new FileTransferInformation(this.context.SessionDataCollectionContext, dumpFile, true);
475-
this.dataCollectionSink.SendFileAsync(fileTranferInformation);
476-
}
477-
catch (FileNotFoundException ex)
478-
{
479-
EqtTrace.Warning(ex.ToString());
480-
this.logger.LogWarning(args.Context, ex.ToString());
481-
}
482-
}
464+
var fileTranferInformation = new FileTransferInformation(this.context.SessionDataCollectionContext, dumpFile, true);
465+
this.dataCollectionSink.SendFileAsync(fileTranferInformation);
466+
}
467+
catch (FileNotFoundException ex)
468+
{
469+
EqtTrace.Warning(ex.ToString());
470+
this.logger.LogWarning(args.Context, ex.ToString());
483471
}
484472
}
485-
catch (FileNotFoundException ex)
486-
{
487-
EqtTrace.Warning(ex.ToString());
488-
this.logger.LogWarning(args.Context, ex.ToString());
489-
}
490-
}
491-
else
492-
{
493-
EqtTrace.Info("BlameCollector.CollectDumpAndAbortTesthost: Custom path to dump directory was provided via VSTEST_DUMP_PATH. Skipping attachment upload, the caller is responsible for collecting and uploading the dumps themselves.");
494473
}
495474
}
475+
catch (FileNotFoundException ex)
476+
{
477+
EqtTrace.Warning(ex.ToString());
478+
this.logger.LogWarning(args.Context, ex.ToString());
479+
}
480+
}
481+
else
482+
{
483+
EqtTrace.Info("BlameCollector.CollectDumpAndAbortTesthost: Custom path to dump directory was provided via VSTEST_DUMP_PATH. Skipping attachment upload, the caller is responsible for collecting and uploading the dumps themselves.");
496484
}
497485
}
498486
finally

src/Microsoft.TestPlatform.Extensions.BlameDataCollector/BlameLogger.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,13 @@ private void TestRunCompleteHandler(object sender, TestRunCompleteEventArgs e)
112112
return;
113113
}
114114

115-
this.output.Error(false, Resources.Resources.AbortedTestRun);
116-
117115
StringBuilder sb = new StringBuilder();
118116
foreach (var tcn in testCaseNames)
119117
{
120118
sb.Append(tcn).Append(Environment.NewLine);
121119
}
122120

123-
this.output.Error(false, sb.ToString());
121+
this.output.Error(false, Resources.Resources.AbortedTestRun, sb.ToString());
124122
}
125123

126124
#endregion

src/Microsoft.TestPlatform.Extensions.BlameDataCollector/CrashDumperFactory.cs

+14
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ public ICrashDumper Create(string targetFramework)
3737
return new ProcDumpCrashDumper();
3838
}
3939

40+
// On net5.0 we don't have the capability to crash dump on exit, which is useful in rare cases
41+
// like when user exits the testhost process with a random exit code, adding this evn variable
42+
// to force using procdump. This relies on netclient dumper actualy doing all it's work in blame collector
43+
// where it sets all the environment variables, so in effect we will have two crash dumpers active at the same time.
44+
// This proven to be working okay while net5.0 could not create dumps from Task.Run, and I was using this same technique
45+
// to get dump of testhost. This needs PROCDUMP_PATH set to directory with procdump.exe, or having it in path.
46+
var procdumpOverride = Environment.GetEnvironmentVariable("VSTEST_DUMP_FORCEPROCDUMP")?.Trim();
47+
var forceUsingProcdump = !string.IsNullOrWhiteSpace(procdumpOverride) && procdumpOverride != "0";
48+
if (forceUsingProcdump)
49+
{
50+
EqtTrace.Info($"CrashDumperFactory: This is Windows on {targetFramework}. Forcing the use of ProcDumpCrashDumper that uses ProcDump utility, via VSTEST_DUMP_FORCEPROCDUMP={procdumpOverride}.");
51+
return new ProcDumpCrashDumper();
52+
}
53+
4054
EqtTrace.Info($"CrashDumperFactory: This is Windows on {targetFramework}, returning the .NETClient dumper which uses env variables to collect crashdumps of testhost and any child process.");
4155
return new NetClientCrashDumper();
4256
}

0 commit comments

Comments
 (0)