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

Revert detecting default architecture, to allow 64-bit #2492

Merged
1 commit merged into from
Jul 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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