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

Remove architecture validation #3371

Merged
merged 3 commits into from
Feb 16, 2022
Merged
Show file tree
Hide file tree
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
24 changes: 0 additions & 24 deletions src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,6 @@ public static void UpdateRunSettingsWithUserProvidedSwitches(XmlDocument runSett

EqtTrace.Verbose("Using effective platform:{0} effective framework:{1}", architecture, framework);

// check if platform is compatible with current system architecture.
VerifyCompatibilityWithOsArchitecture(architecture);

// Check if inputRunSettings has results directory configured.
var hasResultsDirectory = runSettingsDocument.SelectSingleNode(ResultsDirectoryNodePath) != null;

Expand Down Expand Up @@ -559,27 +556,6 @@ private static void ValidateRunConfiguration(XPathNavigator runSettingsNavigator
}
}

/// <summary>
/// Throws SettingsException if platform is incompatible with system architecture.
/// </summary>
/// <param name="architecture"></param>
private static void VerifyCompatibilityWithOsArchitecture(Architecture architecture)
{
var osArchitecture = XmlRunSettingsUtilities.OSArchitecture;

if (architecture == Architecture.X86 && osArchitecture == Architecture.X64)
{
return;
}

if (architecture == osArchitecture)
{
return;
}

throw new SettingsException(string.Format(CultureInfo.CurrentCulture, UtilitiesResources.SystemArchitectureIncompatibleWithTargetPlatform, architecture, osArchitecture));
}

/// <summary>
/// Regenerates the RunConfiguration node with new values under runsettings.
/// </summary>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/Microsoft.TestPlatform.Utilities/Resources/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@
<data name="RunSettingsParseError" xml:space="preserve">
<value>An error occurred while loading the settings. Error: {0}.</value>
</data>
<data name="SystemArchitectureIncompatibleWithTargetPlatform" xml:space="preserve">
<value>Incompatible Target platform settings '{0}' with system architecture '{1}'.</value>
</data>
<data name="UnExpectedSettingsFile" xml:space="preserve">
<value>Unexpected settings file specified.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
<note></note>
<target state="translated">Při načítání nastavení se stala chyba. Chyba: {0}</target>
</trans-unit>
<trans-unit id="SystemArchitectureIncompatibleWithTargetPlatform">
<source>Incompatible Target platform settings '{0}' with system architecture '{1}'.</source>
<note></note>
<target state="translated">Nastavení cílové platformy {0} není kompatibilní s architekturou systému {1}.</target>
</trans-unit>
<trans-unit id="UnExpectedSettingsFile">
<source>Unexpected settings file specified.</source>
<note></note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
<note></note>
<target state="translated">Fehler beim Laden der Einstellungen. Fehler: {0}.</target>
</trans-unit>
<trans-unit id="SystemArchitectureIncompatibleWithTargetPlatform">
<source>Incompatible Target platform settings '{0}' with system architecture '{1}'.</source>
<note></note>
<target state="translated">Inkompatible Zielplattformeinstellungen "{0}" mit der Systemarchitektur "{1}".</target>
</trans-unit>
<trans-unit id="UnExpectedSettingsFile">
<source>Unexpected settings file specified.</source>
<note></note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
<note></note>
<target state="translated">Error al cargar la configuración. Error: {0}.</target>
</trans-unit>
<trans-unit id="SystemArchitectureIncompatibleWithTargetPlatform">
<source>Incompatible Target platform settings '{0}' with system architecture '{1}'.</source>
<note></note>
<target state="translated">La configuración de plataforma de destino '{0}' es incompatible con la arquitectura del sistema '{1}'.</target>
</trans-unit>
<trans-unit id="UnExpectedSettingsFile">
<source>Unexpected settings file specified.</source>
<note></note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
<note></note>
<target state="translated">Une erreur s'est produite durant le chargement des paramètres. Erreur : {0}.</target>
</trans-unit>
<trans-unit id="SystemArchitectureIncompatibleWithTargetPlatform">
<source>Incompatible Target platform settings '{0}' with system architecture '{1}'.</source>
<note></note>
<target state="translated">Paramètres de plateforme cible '{0}' incompatibles avec l'architecture système '{1}'.</target>
</trans-unit>
<trans-unit id="UnExpectedSettingsFile">
<source>Unexpected settings file specified.</source>
<note></note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
<note></note>
<target state="translated">Si è verificato un errore durante il caricamento delle impostazioni. Errore: {0}.</target>
</trans-unit>
<trans-unit id="SystemArchitectureIncompatibleWithTargetPlatform">
<source>Incompatible Target platform settings '{0}' with system architecture '{1}'.</source>
<note></note>
<target state="translated">Le impostazioni della piattaforma di destinazione '{0}' non sono compatibili con l'architettura di sistema '{1}'.</target>
</trans-unit>
<trans-unit id="UnExpectedSettingsFile">
<source>Unexpected settings file specified.</source>
<note></note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
<note></note>
<target state="translated">設定の読み込み中にエラーが発生しました。エラー: {0}。</target>
</trans-unit>
<trans-unit id="SystemArchitectureIncompatibleWithTargetPlatform">
<source>Incompatible Target platform settings '{0}' with system architecture '{1}'.</source>
<note></note>
<target state="translated">ターゲット プラットフォームの設定 '{0}' はシステム アーキテクチャ '{1}' と互換性がありません。</target>
</trans-unit>
<trans-unit id="UnExpectedSettingsFile">
<source>Unexpected settings file specified.</source>
<note></note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
<note></note>
<target state="translated">설정을 로드하는 동안 오류가 발생했습니다. 오류: {0}.</target>
</trans-unit>
<trans-unit id="SystemArchitectureIncompatibleWithTargetPlatform">
<source>Incompatible Target platform settings '{0}' with system architecture '{1}'.</source>
<note></note>
<target state="translated">대상 플랫폼 설정 '{0}'이(가) 시스템 아키텍처 '{1}'과(와) 호환되지 않습니다.</target>
</trans-unit>
<trans-unit id="UnExpectedSettingsFile">
<source>Unexpected settings file specified.</source>
<note></note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
<note></note>
<target state="translated">Wystąpił błąd podczas ładowania ustawień. Błąd: {0}</target>
</trans-unit>
<trans-unit id="SystemArchitectureIncompatibleWithTargetPlatform">
<source>Incompatible Target platform settings '{0}' with system architecture '{1}'.</source>
<note></note>
<target state="translated">Niezgodne ustawienia platformy docelowej „{0}” z architekturą systemu „{1}”.</target>
</trans-unit>
<trans-unit id="UnExpectedSettingsFile">
<source>Unexpected settings file specified.</source>
<note></note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
<note></note>
<target state="translated">Ocorreu um erro ao carregar as configurações. Erro: {0}.</target>
</trans-unit>
<trans-unit id="SystemArchitectureIncompatibleWithTargetPlatform">
<source>Incompatible Target platform settings '{0}' with system architecture '{1}'.</source>
<note></note>
<target state="translated">Configurações da plataforma de destino '{0}' incompatíveis com a arquitetura do sistema '{1}'.</target>
</trans-unit>
<trans-unit id="UnExpectedSettingsFile">
<source>Unexpected settings file specified.</source>
<note></note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
<note></note>
<target state="translated">Произошла ошибка при загрузке параметров. Ошибка: {0}.</target>
</trans-unit>
<trans-unit id="SystemArchitectureIncompatibleWithTargetPlatform">
<source>Incompatible Target platform settings '{0}' with system architecture '{1}'.</source>
<note></note>
<target state="translated">Параметры целевой платформы "{0}" несовместимы с архитектурой системы "{1}".</target>
</trans-unit>
<trans-unit id="UnExpectedSettingsFile">
<source>Unexpected settings file specified.</source>
<note></note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
<note></note>
<target state="translated">Ayarlar yüklenirken bir hata oluştu. Hata: {0}.</target>
</trans-unit>
<trans-unit id="SystemArchitectureIncompatibleWithTargetPlatform">
<source>Incompatible Target platform settings '{0}' with system architecture '{1}'.</source>
<note></note>
<target state="translated">'{0}' hedef platform ayarları, '{1}' sistem mimarisiyle uyumlu değil.</target>
</trans-unit>
<trans-unit id="UnExpectedSettingsFile">
<source>Unexpected settings file specified.</source>
<note></note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
<source>An error occurred while loading the settings. Error: {0}.</source>
<note></note>
</trans-unit>
<trans-unit id="SystemArchitectureIncompatibleWithTargetPlatform">
<source>Incompatible Target platform settings '{0}' with system architecture '{1}'.</source>
<note></note>
</trans-unit>
<trans-unit id="UnExpectedSettingsFile">
<source>Unexpected settings file specified.</source>
<note></note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
<note></note>
<target state="translated">加载设置时出错。错误: {0}。</target>
</trans-unit>
<trans-unit id="SystemArchitectureIncompatibleWithTargetPlatform">
<source>Incompatible Target platform settings '{0}' with system architecture '{1}'.</source>
<note></note>
<target state="translated">目标平台设置“{0}”与系统体系结构“{1}”不兼容。</target>
</trans-unit>
<trans-unit id="UnExpectedSettingsFile">
<source>Unexpected settings file specified.</source>
<note></note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
<note></note>
<target state="translated">載入設定時發生錯誤。錯誤: {0}。</target>
</trans-unit>
<trans-unit id="SystemArchitectureIncompatibleWithTargetPlatform">
<source>Incompatible Target platform settings '{0}' with system architecture '{1}'.</source>
<note></note>
<target state="translated">目標平台設定 '{0}' 與系統架構 '{1}' 不相容。</target>
</trans-unit>
<trans-unit id="UnExpectedSettingsFile">
<source>Unexpected settings file specified.</source>
<note></note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace Microsoft.TestPlatform.Utilities.UnitTests;

using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using OMResources = VisualStudio.TestPlatform.ObjectModel.Resources.CommonResources;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities;
using Microsoft.VisualStudio.TestPlatform.Utilities;
using VisualStudio.TestTools.UnitTesting;
using MSTest.TestFramework.AssertExtensions;
Expand Down Expand Up @@ -217,21 +216,6 @@ public void UpdateRunSettingsShouldReturnBackACompleteRunSettings()
Assert.AreEqual(expectedRunSettings, xml);
}

[TestMethod]
public void UpdateRunSettingsShouldThrowIfArchitectureSetIsIncompatibleWithCurrentSystemArchitecture()
{
var settings = @"<RunSettings></RunSettings>";
var xmlDocument = GetXmlDocument(settings);

Action action = () => InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(xmlDocument, Architecture.ARM, Framework.DefaultFramework, "temp");

Assert.That.Throws<SettingsException>(action)
.WithMessage(string.Format(
"Incompatible Target platform settings '{0}' with system architecture '{1}'.",
"ARM",
XmlRunSettingsUtilities.OSArchitecture.ToString()));
}

[TestMethod]
public void UpdateDesignModeOrCsiShouldNotModifyXmlIfNodeIsAlreadyPresent()
{
Expand Down