Skip to content

Commit

Permalink
Revert detecting default architecture, to allow dotnet to default to …
Browse files Browse the repository at this point in the history
…64-bit (#2492)
  • Loading branch information
nohwnd authored Jul 24, 2020
1 parent 42c50e1 commit c4c4491
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/vstest.console/TestPlatformHelpers/TestRequestManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public void DiscoverTests(DiscoveryRequestPayload discoveryPayload, ITestDiscove
// Collect Commands
this.LogCommandsTelemetryPoints(requestData);
}

// create discovery request
var criteria = new DiscoveryCriteria(discoveryPayload.Sources, batchSize, this.commandLineOptions.TestStatsEventTimeout, runsettings)
{
Expand Down Expand Up @@ -332,7 +332,7 @@ public void ProcessTestRunAttachments(TestRunAttachmentsProcessingPayload attach
this.currentAttachmentsProcessingCancellationTokenSource = new CancellationTokenSource();

Task task = this.attachmentsProcessingManager.ProcessTestRunAttachmentsAsync(requestData, attachmentsProcessingPayload.Attachments, attachmentsProcessingEventsHandler, this.currentAttachmentsProcessingCancellationTokenSource.Token);
task.Wait();
task.Wait();
}
finally
{
Expand All @@ -357,7 +357,7 @@ private void LogTelemetryForLegacySettings(IRequestData requestData, string runs

if (InferRunSettingsHelper.TryGetLegacySettingElements(runsettings, out Dictionary<string, string> legacySettingsTelemetry))
{
foreach( var ciData in legacySettingsTelemetry)
foreach (var ciData in legacySettingsTelemetry)
{
// We are collecting telemetry for the legacy nodes and attributes used in the runsettings.
requestData.MetricsCollection.Add(string.Format("{0}.{1}", TelemetryDataConstants.LegacySettingPrefix, ciData.Key), ciData.Value);
Expand Down Expand Up @@ -444,8 +444,15 @@ private bool UpdateRunSettingsIfRequired(string runsettingsXml, List<string> sou

settingsUpdated |= this.UpdateFramework(document, navigator, sources, sourceFrameworks, registrar, out Framework chosenFramework);

// Set default architecture as X86
// Choose default architecture based on the framework
// For .NET core, the default platform architecture should be based on the process.
Architecture defaultArchitecture = Architecture.X86;
if (chosenFramework.Name.IndexOf("netstandard", StringComparison.OrdinalIgnoreCase) >= 0
|| chosenFramework.Name.IndexOf("netcoreapp", StringComparison.OrdinalIgnoreCase) >= 0
|| chosenFramework.Name.IndexOf("net5", StringComparison.OrdinalIgnoreCase) >= 0)
{
defaultArchitecture = Environment.Is64BitProcess ? Architecture.X64 : Architecture.X86;
}

settingsUpdated |= this.UpdatePlatform(document, navigator, sources, sourcePlatforms, defaultArchitecture, out Architecture chosenPlatform);
this.CheckSourcesForCompatibility(chosenFramework, chosenPlatform, defaultArchitecture, sourcePlatforms, sourceFrameworks, registrar);
Expand All @@ -455,7 +462,7 @@ private bool UpdateRunSettingsIfRequired(string runsettingsXml, List<string> sou
settingsUpdated |= this.AddOrUpdateConsoleLogger(document, runConfiguration, loggerRunSettings);

updatedRunSettingsXml = navigator.OuterXml;
}
}
}

return settingsUpdated;
Expand Down

0 comments on commit c4c4491

Please sign in to comment.