From bb01e836f3d2cd7f147fae8ed80a6711a449cffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Wed, 8 Jul 2026 19:52:46 +0200 Subject: [PATCH] Native MTP integration for MSTest (Phase 6a): native providers, config, resources Make the experimental native MTP path fully self-contained on the request/registration side, without changing shipping behavior (the VSTest bridge remains the default and stays referenced). The risky default-flip + bridge-reference removal becomes a trivial follow-up. - Register MSTest's own command-line option providers, runsettings configuration source and environment-variable provider natively (identical option names/descriptions to the bridge), replacing the bridge Helpers. Both frameworks read options by name, so the swap is safe for the default bridged path too. - Add a native IMSTestTrxReportCapability; MSTestCapabilities implements both it and the bridge's IInternalVSTestBridgeTrxReportCapability so both frameworks observe TRX enablement. - Own the localized strings natively via PlatformAdapterResources (resx + xlf copied from the bridge's ExtensionResources), instead of reading the bridge's resources. - Fix native localization at runtime: MSTest.TestAdapter slims localized satellites to the build-machine culture (fine for VSTest, where the UI language is fixed at build time). For MTP the UI language is chosen at run time, so copy every culture's satellite to the output when EnableMSTestRunner is true; keep the slim behavior otherwise. - Bump the MSTest.TestAdapter expected package file count for the added satellites. Validated: full build clean; unit tests (45 + 898) pass; native-path acceptance sweep green (runsettings incl. localization, filter, help, TRX, threading); default bridged path unaffected. The only failures are 3 pre-existing NativeAOT smoke tests that also fail on the untouched default path (VSTest ObjectModel trim warnings-as-errors in this environment). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- eng/verify-nupkgs.ps1 | 2 +- .../Resources/PlatformAdapterResources.resx | 164 ++++++++++++++++++ .../xlf/PlatformAdapterResources.cs.xlf | 62 +++++++ .../xlf/PlatformAdapterResources.de.xlf | 62 +++++++ .../xlf/PlatformAdapterResources.es.xlf | 62 +++++++ .../xlf/PlatformAdapterResources.fr.xlf | 62 +++++++ .../xlf/PlatformAdapterResources.it.xlf | 62 +++++++ .../xlf/PlatformAdapterResources.ja.xlf | 62 +++++++ .../xlf/PlatformAdapterResources.ko.xlf | 62 +++++++ .../xlf/PlatformAdapterResources.pl.xlf | 62 +++++++ .../xlf/PlatformAdapterResources.pt-BR.xlf | 62 +++++++ .../xlf/PlatformAdapterResources.ru.xlf | 62 +++++++ .../xlf/PlatformAdapterResources.tr.xlf | 62 +++++++ .../xlf/PlatformAdapterResources.zh-Hans.xlf | 62 +++++++ .../xlf/PlatformAdapterResources.zh-Hant.xlf | 62 +++++++ .../IMSTestTrxReportCapability.cs | 18 ++ .../MSTestFilterContext.cs | 4 +- .../MSTestRunSettings.cs | 29 ++-- ...stRunSettingsCommandLineOptionsProvider.cs | 59 +++++++ .../MSTestRunSettingsConfigurationProvider.cs | 74 ++++++++ ...tRunSettingsEnvironmentVariableProvider.cs | 106 +++++++++++ ...estCaseFilterCommandLineOptionsProvider.cs | 26 +++ .../MSTestTestFramework.cs | 7 +- ...RunParametersCommandLineOptionsProvider.cs | 40 +++++ .../TestApplicationBuilderExtensions.cs | 28 ++- .../common/MSTest.TestAdapter.targets | 26 ++- 26 files changed, 1352 insertions(+), 37 deletions(-) create mode 100644 src/Adapter/MSTest.TestAdapter/Resources/PlatformAdapterResources.resx create mode 100644 src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.cs.xlf create mode 100644 src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.de.xlf create mode 100644 src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.es.xlf create mode 100644 src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.fr.xlf create mode 100644 src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.it.xlf create mode 100644 src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.ja.xlf create mode 100644 src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.ko.xlf create mode 100644 src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.pl.xlf create mode 100644 src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.pt-BR.xlf create mode 100644 src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.ru.xlf create mode 100644 src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.tr.xlf create mode 100644 src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.zh-Hans.xlf create mode 100644 src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.zh-Hant.xlf create mode 100644 src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/IMSTestTrxReportCapability.cs create mode 100644 src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettingsCommandLineOptionsProvider.cs create mode 100644 src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettingsConfigurationProvider.cs create mode 100644 src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettingsEnvironmentVariableProvider.cs create mode 100644 src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestCaseFilterCommandLineOptionsProvider.cs create mode 100644 src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestRunParametersCommandLineOptionsProvider.cs diff --git a/eng/verify-nupkgs.ps1 b/eng/verify-nupkgs.ps1 index 96f5e560f3..aa50dec024 100644 --- a/eng/verify-nupkgs.ps1 +++ b/eng/verify-nupkgs.ps1 @@ -21,7 +21,7 @@ function Confirm-NugetPackages { $expectedNumOfFiles = @{ "MSTest.Sdk" = 15 "MSTest.TestFramework" = 105 - "MSTest.TestAdapter" = 53 + "MSTest.TestAdapter" = 66 "MSTest" = 10 "MSTest.Analyzers" = 56 } diff --git a/src/Adapter/MSTest.TestAdapter/Resources/PlatformAdapterResources.resx b/src/Adapter/MSTest.TestAdapter/Resources/PlatformAdapterResources.resx new file mode 100644 index 0000000000..c682da555c --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/Resources/PlatformAdapterResources.resx @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + runsettings file '{0}' cannot be read + 0 is the {Locked="runsettings"} file path. + + + runsettings file '{0}' does not exist + 0 is the {Locked="runsettings"} file path. + + + The bridged framework supports only one session at a time. A session with UID {0} is already open. + {0} is the session {Locked="UID"}. + + + Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Do not localize link {Locked="https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests"}. + + + The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Do not localize file extension {Locked=".runsettings"} or link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file"}. + + + Specify or override a key-value pair parameter. For more information and examples, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Do not localize link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters"}. + + + argument '{0}' is not a parameter. Parameters arguments are matching the following pattern 'key=value'. + 0 is the invalid argument. Do not localize pattern {Locked="key=value"}. + + + Invalid .runsettings file, '<RunSettings>' attribute is missing + Do not localize file extension {Locked=".runsettings"} or element {Locked="<RunSettings>"}. + + + Runsettings loggers are not supported by Microsoft.Testing.Platform and will be ignored + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + Runsettings datacollectors are not supported by Microsoft.Testing.Platform and will be ignored + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + Runsettings attribute '{0}' is not supported by Microsoft.Testing.Platform and will be ignored + 0 is the unsupported {Locked="Runsettings"} attribute name. Do not localize {Locked="Microsoft.Testing.Platform"}. + + \ No newline at end of file diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.cs.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.cs.xlf new file mode 100644 index 0000000000..1c55430bd7 --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.cs.xlf @@ -0,0 +1,62 @@ + + + + + + Invalid .runsettings file, '<RunSettings>' attribute is missing + Neplatný soubor .runsettings. Chybí atribut <RunSettings>. + Do not localize file extension {Locked=".runsettings"} or element {Locked="<RunSettings>"}. + + + The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Relativní nebo absolutní cesta k souboru .runsettings. Další informace a příklady konfigurace testovacího běhu najdete v tématu https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Do not localize file extension {Locked=".runsettings"} or link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file"}. + + + runsettings file '{0}' cannot be read + Soubor runsettings „{0}“ nejde přečíst + 0 is the {Locked="runsettings"} file path. + + + runsettings file '{0}' does not exist + Soubor runsettings „{0}“ neexistuje + 0 is the {Locked="runsettings"} file path. + + + Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Filtruje testy pomocí daného výrazu. Další informace najdete v části s podrobnostmi o možnosti filtru. Další informace a příklady použití selektivního filtrování testů jednotek najdete v tématu https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Do not localize link {Locked="https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests"}. + + + argument '{0}' is not a parameter. Parameters arguments are matching the following pattern 'key=value'. + argument {0} není parametr. Argumenty parametrů odpovídají následujícímu vzoru key=value (klíč=hodnota). + 0 is the invalid argument. Do not localize pattern {Locked="key=value"}. + + + Specify or override a key-value pair parameter. For more information and examples, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Zadejte nebo přepište parametr páru klíč-hodnota. Další informace a příklady najdete tady: https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Do not localize link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters"}. + + + Runsettings attribute '{0}' is not supported by Microsoft.Testing.Platform and will be ignored + Microsoft.Testing.Platform nepodporuje atribut Runsettings {0}. Bude ho proto ignorovat. + 0 is the unsupported {Locked="Runsettings"} attribute name. Do not localize {Locked="Microsoft.Testing.Platform"}. + + + Runsettings datacollectors are not supported by Microsoft.Testing.Platform and will be ignored + Microsoft.Testing.Platform nepodporuje kolekce dat Runsettings. Bude je proto ignorovat. + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + Runsettings loggers are not supported by Microsoft.Testing.Platform and will be ignored + Microsoft.Testing.Platform nepodporuje protokolovače Runsettings. Bude je proto ignorovat. + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + The bridged framework supports only one session at a time. A session with UID {0} is already open. + Přemostěná architektura podporuje najednou pouze jednu relaci. Relace s UID {0} je už otevřená. + {0} is the session {Locked="UID"}. + + + + \ No newline at end of file diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.de.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.de.xlf new file mode 100644 index 0000000000..8572c88570 --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.de.xlf @@ -0,0 +1,62 @@ + + + + + + Invalid .runsettings file, '<RunSettings>' attribute is missing + Ungültige .runsettings-Datei, "<RunSettings>"-Attribut fehlt. + Do not localize file extension {Locked=".runsettings"} or element {Locked="<RunSettings>"}. + + + The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Der relative oder absolute Pfad zur Datei „.runsettings“. Weitere Informationen und Beispiele zum Konfigurieren des Testlaufs finden Sie unter https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Do not localize file extension {Locked=".runsettings"} or link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file"}. + + + runsettings file '{0}' cannot be read + runsettings-Datei „{0}“ kann nicht gelesen werden. + 0 is the {Locked="runsettings"} file path. + + + runsettings file '{0}' does not exist + runsettings-Datei „{0}“ ist nicht vorhanden. + 0 is the {Locked="runsettings"} file path. + + + Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Filtert Tests mithilfe des angegebenen Ausdrucks. Weitere Informationen finden Sie im Abschnitt „Filteroptionsdetails“. Weitere Informationen und Beispiele zur Verwendung der selektiven Komponententestfilterung finden Sie unter https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Do not localize link {Locked="https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests"}. + + + argument '{0}' is not a parameter. Parameters arguments are matching the following pattern 'key=value'. + Das Argument „{0}“ ist kein Parameter. Parameterargumente stimmen mit dem folgenden Muster „key=value“ überein. + 0 is the invalid argument. Do not localize pattern {Locked="key=value"}. + + + Specify or override a key-value pair parameter. For more information and examples, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Geben Sie einen Schlüssel-Wert-Paarparameter an, oder überschreiben Sie diesen. Weitere Informationen und Beispiele finden Sie unter https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Do not localize link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters"}. + + + Runsettings attribute '{0}' is not supported by Microsoft.Testing.Platform and will be ignored + Runsettings-Attribut "{0}" wird von Microsoft.Testing.Platform nicht unterstützt und wird ignoriert. + 0 is the unsupported {Locked="Runsettings"} attribute name. Do not localize {Locked="Microsoft.Testing.Platform"}. + + + Runsettings datacollectors are not supported by Microsoft.Testing.Platform and will be ignored + Runsettings-Datacollectors werden von Microsoft.Testing.Platform nicht unterstützt und werden ignoriert. + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + Runsettings loggers are not supported by Microsoft.Testing.Platform and will be ignored + Runsettings-Protokollierungen werden von Microsoft.Testing.Platform nicht unterstützt und werden ignoriert. + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + The bridged framework supports only one session at a time. A session with UID {0} is already open. + Das Brückenframework unterstützt jeweils nur eine Sitzung. Eine Sitzung mit UID {0} ist bereits geöffnet. + {0} is the session {Locked="UID"}. + + + + \ No newline at end of file diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.es.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.es.xlf new file mode 100644 index 0000000000..886679c323 --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.es.xlf @@ -0,0 +1,62 @@ + + + + + + Invalid .runsettings file, '<RunSettings>' attribute is missing + Archivo .runsettings no válido, falta el atributo "<RunSettings>" + Do not localize file extension {Locked=".runsettings"} or element {Locked="<RunSettings>"}. + + + The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Ruta de acceso, relativa o absoluta, al archivo .runsettings. Para obtener más información y ejemplos sobre cómo configurar la serie de pruebas, consulte https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Do not localize file extension {Locked=".runsettings"} or link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file"}. + + + runsettings file '{0}' cannot be read + No se puede leer el archivo '{0}' de runsettings + 0 is the {Locked="runsettings"} file path. + + + runsettings file '{0}' does not exist + El archivo '{0}' de runsettings no existe + 0 is the {Locked="runsettings"} file path. + + + Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Filtra las pruebas mediante la expresión especificada. Para obtener más información, consulte la sección Detalles de la opción Filtrar. Para obtener más información y ejemplos sobre cómo usar el filtrado de pruebas unitarias selectivas, consulte https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Do not localize link {Locked="https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests"}. + + + argument '{0}' is not a parameter. Parameters arguments are matching the following pattern 'key=value'. + el argumento "{0}" no es un parámetro. Los argumentos de parámetros coinciden con el patrón "key=value" siguiente. + 0 is the invalid argument. Do not localize pattern {Locked="key=value"}. + + + Specify or override a key-value pair parameter. For more information and examples, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Especifique o invalide un parámetro de par clave-valor. Para más información y ejemplos, consulte https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Do not localize link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters"}. + + + Runsettings attribute '{0}' is not supported by Microsoft.Testing.Platform and will be ignored + Microsoft.Testing.Platform no admite el atributo "{0}" de Runsettings y se omitirá + 0 is the unsupported {Locked="Runsettings"} attribute name. Do not localize {Locked="Microsoft.Testing.Platform"}. + + + Runsettings datacollectors are not supported by Microsoft.Testing.Platform and will be ignored + Microsoft.Testing.Platform no admite los recopiladores de datos de Runsettings y se omitirán + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + Runsettings loggers are not supported by Microsoft.Testing.Platform and will be ignored + Microsoft.Testing.Platform no admite los registradores de Runsettings y se omitirán + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + The bridged framework supports only one session at a time. A session with UID {0} is already open. + El marco puente solo admite una sesión a la vez. Ya hay abierta una sesión con {0} UID. + {0} is the session {Locked="UID"}. + + + + \ No newline at end of file diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.fr.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.fr.xlf new file mode 100644 index 0000000000..e337095d28 --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.fr.xlf @@ -0,0 +1,62 @@ + + + + + + Invalid .runsettings file, '<RunSettings>' attribute is missing + Fichier .runsettings non valide, « <RunSettings> » attribut est manquant + Do not localize file extension {Locked=".runsettings"} or element {Locked="<RunSettings>"}. + + + The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Chemin d’accès, relatif ou absolu, au fichier .runsettings. Pour plus d’informations et d’exemples sur la configuration de la série de tests, consultez https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Do not localize file extension {Locked=".runsettings"} or link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file"}. + + + runsettings file '{0}' cannot be read + impossible de lire le fichier runsettings « {0} » + 0 is the {Locked="runsettings"} file path. + + + runsettings file '{0}' does not exist + Le fichier .runsettings n’existe pas sur « {0} » + 0 is the {Locked="runsettings"} file path. + + + Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Filtre les tests à l’aide de l’expression donnée. Pour plus d’informations, consultez la section des détails de l’option Filtrer. Pour plus d’informations et d’exemples sur l’utilisation du filtrage sélectif des tests unitaires, consultez https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Do not localize link {Locked="https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests"}. + + + argument '{0}' is not a parameter. Parameters arguments are matching the following pattern 'key=value'. + l’argument « {0} » n’est pas un paramètre. Les arguments de paramètres correspondent au modèle suivant « key=value ». + 0 is the invalid argument. Do not localize pattern {Locked="key=value"}. + + + Specify or override a key-value pair parameter. For more information and examples, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Spécifiez ou remplacez un paramètre de paire clé-valeur. Pour découvrir plus d’informations et d’exemples, voir https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Do not localize link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters"}. + + + Runsettings attribute '{0}' is not supported by Microsoft.Testing.Platform and will be ignored + Les attributs Runsettings « {0} » ne sont pas pris en charge par Microsoft.Testing.Platform et seront ignorés + 0 is the unsupported {Locked="Runsettings"} attribute name. Do not localize {Locked="Microsoft.Testing.Platform"}. + + + Runsettings datacollectors are not supported by Microsoft.Testing.Platform and will be ignored + Les datacollecteurs Runsettings ne sont pas pris en charge par Microsoft.Testing.Platform et seront ignorés + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + Runsettings loggers are not supported by Microsoft.Testing.Platform and will be ignored + Les loggers Runsettings ne sont pas pris en charge par Microsoft.Testing.Platform et seront ignorés + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + The bridged framework supports only one session at a time. A session with UID {0} is already open. + Le framework ponté ne prend en charge qu’une seule session à la fois. Une session avec UID {0} est déjà ouverte. + {0} is the session {Locked="UID"}. + + + + \ No newline at end of file diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.it.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.it.xlf new file mode 100644 index 0000000000..f246accfd3 --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.it.xlf @@ -0,0 +1,62 @@ + + + + + + Invalid .runsettings file, '<RunSettings>' attribute is missing + File .runsettings non valido. Attributo '<RunSettings>' mancante + Do not localize file extension {Locked=".runsettings"} or element {Locked="<RunSettings>"}. + + + The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Percorso, relativo o assoluto, del file .runsettings. Per altre informazioni ed esempi su come configurare l'esecuzione dei test, vedere https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Do not localize file extension {Locked=".runsettings"} or link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file"}. + + + runsettings file '{0}' cannot be read + Non è possibile leggere il file runsettings '{0}' + 0 is the {Locked="runsettings"} file path. + + + runsettings file '{0}' does not exist + Il file runsettings '{0}' non esiste + 0 is the {Locked="runsettings"} file path. + + + Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Filtra i test usando l'espressione specificata. Per ulteriori informazioni, vedere la sezione dei dettagli dell'opzione Filtro. Per altre informazioni ed esempi su come usare il filtro selettivo unit test, vedere https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Do not localize link {Locked="https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests"}. + + + argument '{0}' is not a parameter. Parameters arguments are matching the following pattern 'key=value'. + l'argomento '{0}' non è un parametro. Gli argomenti dei parametri corrispondono al criterio 'key=value' seguente. + 0 is the invalid argument. Do not localize pattern {Locked="key=value"}. + + + Specify or override a key-value pair parameter. For more information and examples, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Specificare o eseguire l'override di un parametro di coppia chiave-valore. Per altre informazioni ed esempi, vedere https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Do not localize link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters"}. + + + Runsettings attribute '{0}' is not supported by Microsoft.Testing.Platform and will be ignored + L’attributo Runsettings ‘{0}’ non è supportato da Microsoft.Testing.Platform e verrà ignorato + 0 is the unsupported {Locked="Runsettings"} attribute name. Do not localize {Locked="Microsoft.Testing.Platform"}. + + + Runsettings datacollectors are not supported by Microsoft.Testing.Platform and will be ignored + I datacollector Runsettings non sono supportati da Microsoft.Testing.Platform e verranno ignorati + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + Runsettings loggers are not supported by Microsoft.Testing.Platform and will be ignored + I logger Runsettings non sono supportati da Microsoft.Testing.Platform e verranno ignorati + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + The bridged framework supports only one session at a time. A session with UID {0} is already open. + Il framework bridged supporta solo una sessione alla volta. Una sessione con UID {0} è già aperta. + {0} is the session {Locked="UID"}. + + + + \ No newline at end of file diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.ja.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.ja.xlf new file mode 100644 index 0000000000..707ee8e681 --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.ja.xlf @@ -0,0 +1,62 @@ + + + + + + Invalid .runsettings file, '<RunSettings>' attribute is missing + .runsettings ファイルが無効です。'<RunSettings>' 属性がありません + Do not localize file extension {Locked=".runsettings"} or element {Locked="<RunSettings>"}. + + + The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + .runsettings ファイルへの相対パスまたは絶対パス。テストの実行を構成する方法の詳細と例については、https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file を参照してください + Do not localize file extension {Locked=".runsettings"} or link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file"}. + + + runsettings file '{0}' cannot be read + runsettings ファイル '{0}' を読み取れません + 0 is the {Locked="runsettings"} file path. + + + runsettings file '{0}' does not exist + runsettings ファイル '{0}' が存在しません + 0 is the {Locked="runsettings"} file path. + + + Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + 指定された式を使用してテストをフィルター処理します。詳細については、「フィルター オプションの詳細」セクションを参照してください。選択的単体テスト フィルターの使用方法の詳細と例については、https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests を参照してください。 + Do not localize link {Locked="https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests"}. + + + argument '{0}' is not a parameter. Parameters arguments are matching the following pattern 'key=value'. + 引数 '{0}' はパラメーターではありません。パラメーター引数は、次のパターン 'key=value' と一致しています。 + 0 is the invalid argument. Do not localize pattern {Locked="key=value"}. + + + Specify or override a key-value pair parameter. For more information and examples, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + キーと値のペア パラメーターを指定またはオーバーライドします。詳細情報と例については、「https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters」を参照してください。 + Do not localize link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters"}. + + + Runsettings attribute '{0}' is not supported by Microsoft.Testing.Platform and will be ignored + Runsettings 属性 '{0}' は Microsoft.Testing.Platform でサポートされていないため、無視されます + 0 is the unsupported {Locked="Runsettings"} attribute name. Do not localize {Locked="Microsoft.Testing.Platform"}. + + + Runsettings datacollectors are not supported by Microsoft.Testing.Platform and will be ignored + Runsettings datacollectors は Microsoft.Testing.Platform でサポートされていないため、無視されます + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + Runsettings loggers are not supported by Microsoft.Testing.Platform and will be ignored + Runsettings loggers は Microsoft.Testing.Platform でサポートされていないため、無視されます + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + The bridged framework supports only one session at a time. A session with UID {0} is already open. + ブリッジ されたフレームワークは、一度に 1 つのセッションのみをサポートします。UID{0} のセッションは既に開かれています。 + {0} is the session {Locked="UID"}. + + + + \ No newline at end of file diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.ko.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.ko.xlf new file mode 100644 index 0000000000..bf2bc8c1c8 --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.ko.xlf @@ -0,0 +1,62 @@ + + + + + + Invalid .runsettings file, '<RunSettings>' attribute is missing + .runsettings 파일이 잘못되었습니다. '<RunSettings>' 특성이 없습니다. + Do not localize file extension {Locked=".runsettings"} or element {Locked="<RunSettings>"}. + + + The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + .runsettings 파일에 대한 상대 또는 절대 경로입니다. 테스트 실행을 구성하는 방법에 관한 자세한 내용 및 예시는 https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file을 참조하세요. + Do not localize file extension {Locked=".runsettings"} or link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file"}. + + + runsettings file '{0}' cannot be read + runsettings 파일 '{0}'을(를) 읽을 수 없습니다. + 0 is the {Locked="runsettings"} file path. + + + runsettings file '{0}' does not exist + runsettings 파일 '{0}'이(가) 없습니다. + 0 is the {Locked="runsettings"} file path. + + + Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + 지정된 식을 사용하여 테스트를 필터링합니다. 자세한 내용은 필터 옵션 세부 정보 섹션을 참조하세요. 선택적 단위 테스트 필터링을 사용하는 방법에 관한 자세한 내용과 예시는 https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests를 참조하세요. + Do not localize link {Locked="https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests"}. + + + argument '{0}' is not a parameter. Parameters arguments are matching the following pattern 'key=value'. + '{0}' 인수는 매개 변수가 아닙니다. 매개 변수 인수가 다음 패턴 'key=value'와 일치합니다. + 0 is the invalid argument. Do not localize pattern {Locked="key=value"}. + + + Specify or override a key-value pair parameter. For more information and examples, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + 키-값 쌍 매개 변수를 지정하거나 재정의합니다. 자세한 내용 및 예제는 https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters를 참조하세요. + Do not localize link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters"}. + + + Runsettings attribute '{0}' is not supported by Microsoft.Testing.Platform and will be ignored + Runsettings 특성 '{0}'은(는) Microsoft.Testing.Platform에서 지원되지 않으며 무시됩니다. + 0 is the unsupported {Locked="Runsettings"} attribute name. Do not localize {Locked="Microsoft.Testing.Platform"}. + + + Runsettings datacollectors are not supported by Microsoft.Testing.Platform and will be ignored + Runsettings datacollectors는 Microsoft.Testing.Platform에서 지원되지 않으며 무시됩니다. + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + Runsettings loggers are not supported by Microsoft.Testing.Platform and will be ignored + Runsettings 로거는 Microsoft.Testing.Platform에서 지원되지 않으며 무시됩니다. + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + The bridged framework supports only one session at a time. A session with UID {0} is already open. + 브리지된 프레임워크는 한 번에 하나의 세션만 지원합니다. UID가 {0}인 세션이 이미 열려 있습니다. + {0} is the session {Locked="UID"}. + + + + \ No newline at end of file diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.pl.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.pl.xlf new file mode 100644 index 0000000000..97e68a0893 --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.pl.xlf @@ -0,0 +1,62 @@ + + + + + + Invalid .runsettings file, '<RunSettings>' attribute is missing + Nieprawidłowy plik .runsettings, brak atrybutu „<RunSettings>” + Do not localize file extension {Locked=".runsettings"} or element {Locked="<RunSettings>"}. + + + The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Ścieżka względna lub bezwzględna pliku .runsettings. Aby uzyskać więcej informacji i przykładów dotyczących konfigurowania przebiegu testu, zobacz: https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Do not localize file extension {Locked=".runsettings"} or link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file"}. + + + runsettings file '{0}' cannot be read + nie można odczytać pliku runsettings „{0}” + 0 is the {Locked="runsettings"} file path. + + + runsettings file '{0}' does not exist + plik runsettings „{0}” nie istnieje + 0 is the {Locked="runsettings"} file path. + + + Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Filtruje testy przy użyciu danego wyrażenia. Aby uzyskać więcej informacji, zobacz sekcję szczegółów opcji filtru. Aby uzyskać więcej informacji i przykładów dotyczących używania selektywnego filtrowania testów jednostkowych, zobacz: https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Do not localize link {Locked="https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests"}. + + + argument '{0}' is not a parameter. Parameters arguments are matching the following pattern 'key=value'. + argument „{0}” nie jest parametrem. Argumenty parametrów pasują do następującego wzorca „key=value”. + 0 is the invalid argument. Do not localize pattern {Locked="key=value"}. + + + Specify or override a key-value pair parameter. For more information and examples, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Określ lub zastąp parametr pary klucz-wartość. Aby uzyskać więcej informacji i przykładów, zobacz stronę https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Do not localize link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters"}. + + + Runsettings attribute '{0}' is not supported by Microsoft.Testing.Platform and will be ignored + Atrybut Runsettings „{0}” nie jest obsługiwany przez element Microsoft.Testing.Platform i zostanie zignorowany. + 0 is the unsupported {Locked="Runsettings"} attribute name. Do not localize {Locked="Microsoft.Testing.Platform"}. + + + Runsettings datacollectors are not supported by Microsoft.Testing.Platform and will be ignored + Kolektory danych Runsettings nie są obsługiwane przez element Microsoft.Testing.Platform i będą ignorowane + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + Runsettings loggers are not supported by Microsoft.Testing.Platform and will be ignored + Rejestratory Runsettings nie są obsługiwane przez element Microsoft.Testing.Platform i będą ignorowane. + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + The bridged framework supports only one session at a time. A session with UID {0} is already open. + Platforma mostkowania obsługuje tylko jedną sesję naraz. Sesja z identyfikatorem UID {0} jest już otwarta. + {0} is the session {Locked="UID"}. + + + + \ No newline at end of file diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.pt-BR.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.pt-BR.xlf new file mode 100644 index 0000000000..9c54058367 --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.pt-BR.xlf @@ -0,0 +1,62 @@ + + + + + + Invalid .runsettings file, '<RunSettings>' attribute is missing + Arquivo .runsettings inválido, o atributo "<RunSettings>" está ausente + Do not localize file extension {Locked=".runsettings"} or element {Locked="<RunSettings>"}. + + + The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + O caminho, relativo ou absoluto, para o arquivo .runsettings. Para obter mais informações e exemplos sobre como configurar a execução de teste, consulte https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Do not localize file extension {Locked=".runsettings"} or link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file"}. + + + runsettings file '{0}' cannot be read + o arquivo runsettings "{0}" não pode ser lido + 0 is the {Locked="runsettings"} file path. + + + runsettings file '{0}' does not exist + o arquivo runsettings "{0}" não existe + 0 is the {Locked="runsettings"} file path. + + + Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Filtra testes usando a expressão fornecida. Para obter mais informações, consulte a seção detalhes da opção Filtro. Para obter mais informações e exemplos sobre como usar a filtragem de teste de unidade seletiva, consulte https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Do not localize link {Locked="https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests"}. + + + argument '{0}' is not a parameter. Parameters arguments are matching the following pattern 'key=value'. + o argumento '{0}' não é um parâmetro. Os argumentos de parâmetros correspondem ao padrão 'key=value' a seguir. + 0 is the invalid argument. Do not localize pattern {Locked="key=value"}. + + + Specify or override a key-value pair parameter. For more information and examples, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Especifique ou substitua um parâmetro de par chave-valor. Para obter mais informações e exemplos, consulte https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Do not localize link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters"}. + + + Runsettings attribute '{0}' is not supported by Microsoft.Testing.Platform and will be ignored + O atributo Runsettings "{0}" não tem suporte no Microsoft.Testing.Platform e será ignorado + 0 is the unsupported {Locked="Runsettings"} attribute name. Do not localize {Locked="Microsoft.Testing.Platform"}. + + + Runsettings datacollectors are not supported by Microsoft.Testing.Platform and will be ignored + Os coletores de dados de arquivos Runsettings não são compatíveis com Microsoft.Testing.Platform e serão ignorados + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + Runsettings loggers are not supported by Microsoft.Testing.Platform and will be ignored + Os registradores de arquivos Runsettings não têm suporte no Microsoft.Testing.Platform e serão ignorados + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + The bridged framework supports only one session at a time. A session with UID {0} is already open. + A estrutura em ponte dá suporte a apenas uma sessão por vez. Uma sessão com UID {0} já está aberta. + {0} is the session {Locked="UID"}. + + + + \ No newline at end of file diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.ru.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.ru.xlf new file mode 100644 index 0000000000..63f0fe22d8 --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.ru.xlf @@ -0,0 +1,62 @@ + + + + + + Invalid .runsettings file, '<RunSettings>' attribute is missing + Недопустимый файл .runsettings, отсутствует атрибут "<RunSettings>" + Do not localize file extension {Locked=".runsettings"} or element {Locked="<RunSettings>"}. + + + The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Относительный или абсолютный путь к файлу .runsettings. Дополнительные сведения и примеры настройки тестового запуска см. на странице https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Do not localize file extension {Locked=".runsettings"} or link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file"}. + + + runsettings file '{0}' cannot be read + не удается прочитать файл runsettings "{0}" + 0 is the {Locked="runsettings"} file path. + + + runsettings file '{0}' does not exist + файл runsettings "{0}" не существует + 0 is the {Locked="runsettings"} file path. + + + Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Фильтрация тестов с использованием заданного выражения. Дополнительные сведения см. в разделе сведений о параметрах фильтра. Дополнительные сведения и примеры использования выборочной фильтрации модульных тестов см. на странице https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Do not localize link {Locked="https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests"}. + + + argument '{0}' is not a parameter. Parameters arguments are matching the following pattern 'key=value'. + аргумент "{0}" не является параметром. Аргументы параметров соответствуют следующему шаблону: "key=value". + 0 is the invalid argument. Do not localize pattern {Locked="key=value"}. + + + Specify or override a key-value pair parameter. For more information and examples, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Укажите или переопределите параметр пары "ключ-значение". Дополнительные сведения и примеры см. на странице https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Do not localize link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters"}. + + + Runsettings attribute '{0}' is not supported by Microsoft.Testing.Platform and will be ignored + Атрибут Runsettings "{0}" не поддерживается в Microsoft.Testing.Platform и будет пропущен + 0 is the unsupported {Locked="Runsettings"} attribute name. Do not localize {Locked="Microsoft.Testing.Platform"}. + + + Runsettings datacollectors are not supported by Microsoft.Testing.Platform and will be ignored + Сборщики данных Runsettings не поддерживаются в Microsoft.Testing.Platform и будут пропущены + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + Runsettings loggers are not supported by Microsoft.Testing.Platform and will be ignored + Средства ведения журналов Runsettings не поддерживаются в Microsoft.Testing.Platform и будут пропущены + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + The bridged framework supports only one session at a time. A session with UID {0} is already open. + Интегрированная среда Bridged Framework поддерживает только один сеанс одновременно. Сеанс с UID {0} уже открыт. + {0} is the session {Locked="UID"}. + + + + \ No newline at end of file diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.tr.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.tr.xlf new file mode 100644 index 0000000000..643a979008 --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.tr.xlf @@ -0,0 +1,62 @@ + + + + + + Invalid .runsettings file, '<RunSettings>' attribute is missing + Geçersiz .runsettings dosyası, '<RunSettings>' özniteliği eksik + Do not localize file extension {Locked=".runsettings"} or element {Locked="<RunSettings>"}. + + + The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + .runsettings dosyasının göreli veya mutlak yolu. Test çalıştırmasını yapılandırma hakkında daha fazla bilgi ve örnek için şu sayfaya bakın: https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Do not localize file extension {Locked=".runsettings"} or link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file"}. + + + runsettings file '{0}' cannot be read + '{0}' runsettings dosyası okunamıyor + 0 is the {Locked="runsettings"} file path. + + + runsettings file '{0}' does not exist + '{0}' runsettings dosyası mevcut değil + 0 is the {Locked="runsettings"} file path. + + + Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Belirtilen ifadeyi kullanarak testleri filtreler. Daha fazla bilgi için Filtre seçeneği ayrıntıları bölümüne bakın. Seçici birim testi filtreleme hakkında daha fazla bilgi ve örnek için şu sayfaya bakın: https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + Do not localize link {Locked="https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests"}. + + + argument '{0}' is not a parameter. Parameters arguments are matching the following pattern 'key=value'. + '{0}' bağımsız değişkeni bir parametre değil. Parametre bağımsız değişkenleri aşağıdaki 'key=value' deseniyle eşleşiyor. + 0 is the invalid argument. Do not localize pattern {Locked="key=value"}. + + + Specify or override a key-value pair parameter. For more information and examples, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Anahtar-değer çifti parametresi belirtin veya geçersiz kılın. Daha fazla bilgi ve örnek için şu sayfaya bakın: https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Do not localize link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters"}. + + + Runsettings attribute '{0}' is not supported by Microsoft.Testing.Platform and will be ignored + '{0}' Runsettings özniteliği Microsoft.Testing.Platform tarafından desteklenmiyor ve yoksayılacak + 0 is the unsupported {Locked="Runsettings"} attribute name. Do not localize {Locked="Microsoft.Testing.Platform"}. + + + Runsettings datacollectors are not supported by Microsoft.Testing.Platform and will be ignored + Runsettings veri toplayıcıları Microsoft.Testing.Platform tarafından desteklenmiyor ve yoksayılacak + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + Runsettings loggers are not supported by Microsoft.Testing.Platform and will be ignored + Runsettings günlükçüleri Microsoft.Testing.Platform tarafından desteklenmiyor ve yoksayılacak + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + The bridged framework supports only one session at a time. A session with UID {0} is already open. + Köprülü çerçeve aynı anda yalnızca bir oturumu destekler. UID'si {0} olan bir oturum zaten açık. + {0} is the session {Locked="UID"}. + + + + \ No newline at end of file diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.zh-Hans.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.zh-Hans.xlf new file mode 100644 index 0000000000..00d6f1cce8 --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.zh-Hans.xlf @@ -0,0 +1,62 @@ + + + + + + Invalid .runsettings file, '<RunSettings>' attribute is missing + .runsettings 文件无效,缺少 '<RunSettings>' 属性 + Do not localize file extension {Locked=".runsettings"} or element {Locked="<RunSettings>"}. + + + The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + .runsettings 文件的相对路径或绝对路径。有关如何配置测试运行的详细信息和示例,请参阅 https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Do not localize file extension {Locked=".runsettings"} or link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file"}. + + + runsettings file '{0}' cannot be read + 无法读取 runsettings 文件“{0}” + 0 is the {Locked="runsettings"} file path. + + + runsettings file '{0}' does not exist + runsettings 文件“{0}”不存在 + 0 is the {Locked="runsettings"} file path. + + + Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + 使用给定的表达式筛选测试。有关详细信息,请参阅“筛选器选项详细信息”部分。有关如何使用选择性单元测试筛选的详细信息和示例,请参阅 https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests。 + Do not localize link {Locked="https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests"}. + + + argument '{0}' is not a parameter. Parameters arguments are matching the following pattern 'key=value'. + 自变量“{0}”不是参数。参数自变量与以下模式“key=value”相匹配。 + 0 is the invalid argument. Do not localize pattern {Locked="key=value"}. + + + Specify or override a key-value pair parameter. For more information and examples, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + 指定或替代键值对参数。有关详细信息和示例,请参阅 https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Do not localize link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters"}. + + + Runsettings attribute '{0}' is not supported by Microsoft.Testing.Platform and will be ignored + Microsoft.Testing.Platform 不支持 Runsettings 属性“{0}”,将被忽略 + 0 is the unsupported {Locked="Runsettings"} attribute name. Do not localize {Locked="Microsoft.Testing.Platform"}. + + + Runsettings datacollectors are not supported by Microsoft.Testing.Platform and will be ignored + Microsoft.Testing.Platform 不支持 Runsettings 数据收集器,将被忽略 + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + Runsettings loggers are not supported by Microsoft.Testing.Platform and will be ignored + Microsoft.Testing.Platform 不支持 Runsettings 记录器,将被忽略 + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + The bridged framework supports only one session at a time. A session with UID {0} is already open. + 桥接框架一次仅支持一个会话。已打开具有 UID {0} 的会话。 + {0} is the session {Locked="UID"}. + + + + \ No newline at end of file diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.zh-Hant.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.zh-Hant.xlf new file mode 100644 index 0000000000..a505d399a0 --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/PlatformAdapterResources.zh-Hant.xlf @@ -0,0 +1,62 @@ + + + + + + Invalid .runsettings file, '<RunSettings>' attribute is missing + .runsettings 檔案無效,遺漏 '<RunSettings>' 屬性 + Do not localize file extension {Locked=".runsettings"} or element {Locked="<RunSettings>"}. + + + The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + .runsettings 檔案的相對或絕對路徑。如需如何設定測試回合的詳細資訊和範例,請參閱 https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file + Do not localize file extension {Locked=".runsettings"} or link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file"}. + + + runsettings file '{0}' cannot be read + 無法讀取 runsettings 檔案 '{0}' + 0 is the {Locked="runsettings"} file path. + + + runsettings file '{0}' does not exist + .runsettings 檔案 '{0}' 不存在 + 0 is the {Locked="runsettings"} file path. + + + Filters tests using the given expression. For more information, see the Filter option details section. For more information and examples on how to use selective unit test filtering, see https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests. + 使用指定運算式的篩選測試。如需詳細資訊,請參閱篩選選項詳細資料區段。如需如何使用選擇性單元測試篩選的詳細資訊和範例,請參閱 https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests。 + Do not localize link {Locked="https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests"}. + + + argument '{0}' is not a parameter. Parameters arguments are matching the following pattern 'key=value'. + 引數 '{0}' 不是參數。參數引數符合下列模式 'key=value'。 + 0 is the invalid argument. Do not localize pattern {Locked="key=value"}. + + + Specify or override a key-value pair parameter. For more information and examples, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + 指定或覆寫機碼值組參數。如需詳細資訊和範例,請參閱 https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters + Do not localize link {Locked="https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters"}. + + + Runsettings attribute '{0}' is not supported by Microsoft.Testing.Platform and will be ignored + Runsettings 屬性 '{0}' 不受 Microsoft.Testing.Platform 支援,將會予以忽略 + 0 is the unsupported {Locked="Runsettings"} attribute name. Do not localize {Locked="Microsoft.Testing.Platform"}. + + + Runsettings datacollectors are not supported by Microsoft.Testing.Platform and will be ignored + Runsettings 資料收集器不受 Microsoft.Testing.Platform 支援,將會予以忽略 + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + Runsettings loggers are not supported by Microsoft.Testing.Platform and will be ignored + Runsettings 記錄器不受 Microsoft.Testing.Platform 支援,將會予以忽略 + Do not localize {Locked="Runsettings"} or {Locked="Microsoft.Testing.Platform"}. + + + The bridged framework supports only one session at a time. A session with UID {0} is already open. + 橋接器架構一次只支援一個工作階段。已開啟具有 UID {0} 的工作階段。 + {0} is the session {Locked="UID"}. + + + + \ No newline at end of file diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/IMSTestTrxReportCapability.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/IMSTestTrxReportCapability.cs new file mode 100644 index 0000000000..7c87f0fcaa --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/IMSTestTrxReportCapability.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if !WINDOWS_UWP +using Microsoft.Testing.Extensions.TrxReport.Abstractions; + +namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.TestingPlatformAdapter; + +/// +/// MSTest-native TRX report capability that also exposes whether TRX reporting has been enabled for the run. +/// This mirrors the VSTest bridge's internal capability so the native framework can determine TRX enablement +/// without depending on the bridge. +/// +internal interface IMSTestTrxReportCapability : ITrxReportCapability +{ + bool IsTrxEnabled { get; } +} +#endif diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestFilterContext.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestFilterContext.cs index ca393aefe4..4cac88b90a 100644 --- a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestFilterContext.cs +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestFilterContext.cs @@ -26,8 +26,8 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.TestingPlatform [SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")] internal abstract class MSTestFilterContextBase { - // Keep in sync with the bridge's TestCaseFilterCommandLineOptionsProvider.TestCaseFilterOptionName. - private const string TestCaseFilterOptionName = "filter"; + // References the native --filter option provider's name. + private const string TestCaseFilterOptionName = MSTestTestCaseFilterCommandLineOptionsProvider.TestCaseFilterOptionName; protected MSTestFilterContextBase(ICommandLineOptions commandLineOptions, IRunSettings runSettings, ITestExecutionFilter filter) { diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettings.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettings.cs index 65f5f63851..d3fdc80f83 100644 --- a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettings.cs +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettings.cs @@ -2,11 +2,11 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if !WINDOWS_UWP -using Microsoft.Testing.Extensions.VSTestBridge.Resources; using Microsoft.Testing.Platform.CommandLine; using Microsoft.Testing.Platform.Configurations; using Microsoft.Testing.Platform.Services; using Microsoft.Testing.Platform.TestHost; +using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Resources; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; @@ -24,10 +24,6 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.TestingPlatform [SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")] internal sealed class MSTestRunSettings : IRunSettings { - // Keep in sync with the bridge's option provider constants (options are still registered by the bridge). - private const string RunSettingsOptionName = "settings"; - private const string TestRunParameterOptionName = "test-parameter"; - private static readonly char[] TestRunParameterSeparator = ['=']; private static readonly string[] UnsupportedRunConfigurationSettings = @@ -49,7 +45,8 @@ public MSTestRunSettings( IClientInfo client, IMessageLogger messageLogger) { - string runSettingsXml = ReadRunSettings(commandLineOptions, fileSystem); + _ = commandLineOptions.TryGetOptionArgumentList(MSTestRunSettingsCommandLineOptionsProvider.RunSettingsOptionName, out string[]? fileNames); + string runSettingsXml = ReadRunSettings(fileNames, fileSystem); XDocument runSettingsDocument = Patch(runSettingsXml, configuration, client, commandLineOptions); WarnOnUnsupportedEntries(runSettingsDocument, messageLogger); @@ -62,13 +59,11 @@ public MSTestRunSettings( // Not used by MSTest (matches the bridge's RunSettingsAdapter). public ISettingsProvider? GetSettings(string? settingsName) => throw new NotImplementedException(); - internal static string ReadRunSettings(ICommandLineOptions commandLineOptions, IFileSystem fileSystem) + internal static string ReadRunSettings(string[]? fileNames, IFileSystem fileSystem) { - _ = commandLineOptions.TryGetOptionArgumentList(RunSettingsOptionName, out string[]? fileNames); - - // Match the runsettings environment-variable provider (which reads the same --settings option): use the - // first provided path rather than requiring exactly one, so a valid value is not ignored when more than - // one argument is present. + // Use the first provided --settings path rather than requiring exactly one, matching the runsettings + // environment-variable provider that reads the same option, so a valid value is not ignored when more + // than one argument is present. if (fileNames is { Length: > 0 } && fileSystem.ExistFile(fileNames[0])) { return fileSystem.ReadAllText(fileNames[0]); @@ -106,7 +101,7 @@ private static XDocument PatchSettingsWithDefaults(string? runSettingsXml, bool var document = XDocument.Parse(runSettingsXml); if (document.Element("RunSettings") is not { } runSettingsElement) { - throw new InvalidOperationException(ExtensionResources.MissingRunSettingsAttribute); + throw new InvalidOperationException(PlatformAdapterResources.MissingRunSettingsAttribute); } bool isPatchingCommentAdded = false; @@ -156,7 +151,7 @@ private static void AddPatchingCommentIfNeeded(XElement element, ref bool isPatc private static void PatchTestRunParameters(XDocument runSettingsDocument, ICommandLineOptions commandLineOptions) { - if (!commandLineOptions.TryGetOptionArgumentList(TestRunParameterOptionName, out string[]? testRunParameters)) + if (!commandLineOptions.TryGetOptionArgumentList(MSTestTestRunParametersCommandLineOptionsProvider.TestRunParameterOptionName, out string[]? testRunParameters)) { return; } @@ -196,12 +191,12 @@ private static void WarnOnUnsupportedEntries(XDocument document, IMessageLogger if (runSettingsElement.Element("LoggerRunSettings") is not null) { - messageLogger.SendMessage(TestMessageLevel.Warning, ExtensionResources.UnsupportedRunsettingsLoggers); + messageLogger.SendMessage(TestMessageLevel.Warning, PlatformAdapterResources.UnsupportedRunsettingsLoggers); } if (runSettingsElement.Element("DataCollectionRunSettings") is not null) { - messageLogger.SendMessage(TestMessageLevel.Warning, ExtensionResources.UnsupportedRunsettingsDatacollectors); + messageLogger.SendMessage(TestMessageLevel.Warning, PlatformAdapterResources.UnsupportedRunsettingsDatacollectors); } if (runSettingsElement.Element("RunConfiguration") is not { } runConfigurationElement) @@ -211,7 +206,7 @@ private static void WarnOnUnsupportedEntries(XDocument document, IMessageLogger foreach (string unsupportedRunConfigurationSetting in UnsupportedRunConfigurationSettings.Where(setting => runConfigurationElement.Element(setting) is not null)) { - messageLogger.SendMessage(TestMessageLevel.Warning, string.Format(CultureInfo.InvariantCulture, ExtensionResources.UnsupportedRunconfigurationSetting, unsupportedRunConfigurationSetting)); + messageLogger.SendMessage(TestMessageLevel.Warning, string.Format(CultureInfo.InvariantCulture, PlatformAdapterResources.UnsupportedRunconfigurationSetting, unsupportedRunConfigurationSetting)); } } } diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettingsCommandLineOptionsProvider.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettingsCommandLineOptionsProvider.cs new file mode 100644 index 0000000000..bccf259cf4 --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettingsCommandLineOptionsProvider.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if !WINDOWS_UWP +using Microsoft.Testing.Platform.CommandLine; +using Microsoft.Testing.Platform.Extensions; +using Microsoft.Testing.Platform.Extensions.CommandLine; +using Microsoft.Testing.Platform.Helpers; +using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Resources; + +using IFileSystem = Microsoft.Testing.Platform.Helpers.IFileSystem; + +namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.TestingPlatformAdapter; + +/// +/// MSTest-native command-line provider for the VSTest --settings (.runsettings) option. Mirrors the VSTest +/// bridge's RunSettingsCommandLineOptionsProvider (identical option name, description and validation) so the +/// --help surface is unchanged. +/// +[SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")] +internal sealed class MSTestRunSettingsCommandLineOptionsProvider : CommandLineOptionsProviderBase +{ + public const string RunSettingsOptionName = "settings"; + private readonly IFileSystem _fileSystem; + + public MSTestRunSettingsCommandLineOptionsProvider(IExtension extension) + : this(extension, new SystemFileSystem()) + { + } + + internal MSTestRunSettingsCommandLineOptionsProvider(IExtension extension, IFileSystem fileSystem) + : base(extension, [new CommandLineOption(RunSettingsOptionName, PlatformAdapterResources.RunSettingsOptionDescription, ArgumentArity.ExactlyOne, false)]) + => _fileSystem = fileSystem; + + public override Task ValidateOptionArgumentsAsync(CommandLineOption commandOption, string[] arguments) + { + string filePath = arguments[0]; + + return !_fileSystem.ExistFile(filePath) + ? ValidationResult.InvalidTask(string.Format(CultureInfo.InvariantCulture, PlatformAdapterResources.RunsettingsFileDoesNotExist, filePath)) + : !CanReadFile(filePath) + ? ValidationResult.InvalidTask(string.Format(CultureInfo.InvariantCulture, PlatformAdapterResources.RunsettingsFileCannotBeRead, filePath)) + : ValidationResult.ValidTask; + } + + private bool CanReadFile(string filePath) + { + try + { + using IFileStream stream = _fileSystem.NewFileStream(filePath, FileMode.Open, FileAccess.Read); + return true; + } + catch (IOException) + { + return false; + } + } +} +#endif diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettingsConfigurationProvider.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettingsConfigurationProvider.cs new file mode 100644 index 0000000000..c23e7b217c --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettingsConfigurationProvider.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if !WINDOWS_UWP +using Microsoft.Testing.Platform.CommandLine; +using Microsoft.Testing.Platform.Configurations; +using Microsoft.Testing.Platform.Extensions; + +using IFileSystem = Microsoft.Testing.Platform.Helpers.IFileSystem; + +namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.TestingPlatformAdapter; + +/// +/// MSTest-native configuration source that bridges the <ResultsDirectory> from a .runsettings file into +/// the Microsoft.Testing.Platform configuration model. Mirrors the VSTest bridge's +/// RunSettingsConfigurationProvider without depending on the bridge. +/// +[SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")] +internal sealed class MSTestRunSettingsConfigurationProvider : IConfigurationSource, IConfigurationProvider +{ + private readonly IExtension _extension; + private readonly IFileSystem _fileSystem; + private string? _runSettingsFileContent; + + public MSTestRunSettingsConfigurationProvider(IExtension extension, IFileSystem fileSystem) + { + _extension = extension; + _fileSystem = fileSystem; + } + + public string Uid => nameof(MSTestRunSettingsConfigurationProvider); + + public string Version => _extension.Version; + + public string DisplayName => "MSTest: runsettings configuration"; + + public string Description => "Configuration source to bridge VSTest xml runsettings configuration into Microsoft Testing Platform configuration model."; + + public int Order => 2; + + public Task IsEnabledAsync() => Task.FromResult(true); + + public Task LoadAsync() => Task.CompletedTask; + + public bool TryGet(string key, out string? value) + { + if (string.IsNullOrEmpty(_runSettingsFileContent)) + { + value = null; + return false; + } + + if (key == PlatformConfigurationConstants.PlatformResultDirectory) + { + var document = XDocument.Parse(_runSettingsFileContent); + value = document.Element("RunSettings")?.Element("RunConfiguration")?.Element("ResultsDirectory")?.Value; + if (value is not null) + { + return true; + } + } + + value = null; + return false; + } + + public Task BuildAsync(CommandLineParseResult commandLineParseResult) + { + _ = commandLineParseResult.TryGetOptionArgumentList(MSTestRunSettingsCommandLineOptionsProvider.RunSettingsOptionName, out string[]? fileNames); + _runSettingsFileContent = MSTestRunSettings.ReadRunSettings(fileNames, _fileSystem); + return Task.FromResult(this); + } +} +#endif diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettingsEnvironmentVariableProvider.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettingsEnvironmentVariableProvider.cs new file mode 100644 index 0000000000..c1ae378e91 --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestRunSettingsEnvironmentVariableProvider.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if !WINDOWS_UWP +using Microsoft.Testing.Platform.CommandLine; +using Microsoft.Testing.Platform.Extensions; +using Microsoft.Testing.Platform.Extensions.TestHostControllers; + +using IEnvironment = Microsoft.Testing.Platform.Helpers.IEnvironment; +using IFileStream = Microsoft.Testing.Platform.Helpers.IFileStream; +using IFileSystem = Microsoft.Testing.Platform.Helpers.IFileSystem; + +namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.TestingPlatformAdapter; + +/// +/// MSTest-native test host environment-variable provider that applies the <EnvironmentVariables> from a +/// .runsettings file to the test host. Mirrors the VSTest bridge's RunSettingsEnvironmentVariableProvider +/// without depending on the bridge. +/// +[SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")] +internal sealed class MSTestRunSettingsEnvironmentVariableProvider : ITestHostEnvironmentVariableProvider +{ + private readonly IExtension _extension; + private readonly ICommandLineOptions _commandLineOptions; + private readonly IFileSystem _fileSystem; + private readonly IEnvironment _environment; + private XDocument? _runSettings; + + public MSTestRunSettingsEnvironmentVariableProvider(IExtension extension, ICommandLineOptions commandLineOptions, IFileSystem fileSystem, IEnvironment environment) + { + _extension = extension; + _commandLineOptions = commandLineOptions; + _fileSystem = fileSystem; + _environment = environment; + } + + public string Uid => _extension.Uid; + + public string Version => _extension.Version; + + public string DisplayName => _extension.DisplayName; + + public string Description => _extension.Description; + + public async Task IsEnabledAsync() + { + string? runSettingsFilePath = null; + string? runSettingsContent = null; + + if (_commandLineOptions.TryGetOptionArgumentList(MSTestRunSettingsCommandLineOptionsProvider.RunSettingsOptionName, out string[]? runsettings) + && runsettings.Length > 0 + && _fileSystem.ExistFile(runsettings[0])) + { + runSettingsFilePath = runsettings[0]; + } + + if (runSettingsFilePath is null) + { + runSettingsContent = _environment.GetEnvironmentVariable("TESTINGPLATFORM_EXPERIMENTAL_VSTEST_RUNSETTINGS"); + } + + if (runSettingsFilePath is null && string.IsNullOrEmpty(runSettingsContent)) + { + string? envVarFilePath = _environment.GetEnvironmentVariable("TESTINGPLATFORM_VSTESTBRIDGE_RUNSETTINGS_FILE"); + if (!string.IsNullOrEmpty(envVarFilePath) && _fileSystem.ExistFile(envVarFilePath!)) + { + runSettingsFilePath = envVarFilePath; + } + } + + if (runSettingsFilePath is not null) + { + using IFileStream fileStream = _fileSystem.NewFileStream(runSettingsFilePath, FileMode.Open, FileAccess.Read); +#if NETCOREAPP + _runSettings = await XDocument.LoadAsync(fileStream.Stream, LoadOptions.None, CancellationToken.None).ConfigureAwait(false); +#else + using StreamReader streamReader = new(fileStream.Stream); + _runSettings = XDocument.Parse(await streamReader.ReadToEndAsync().ConfigureAwait(false)); +#endif + } + else if (!string.IsNullOrEmpty(runSettingsContent)) + { + _runSettings = XDocument.Parse(runSettingsContent); + } + else + { + return false; + } + + return _runSettings.Element("RunSettings")?.Element("RunConfiguration")?.Element("EnvironmentVariables") is not null; + } + + public Task UpdateAsync(IEnvironmentVariables environmentVariables) + { + foreach (XElement element in _runSettings!.Element("RunSettings")!.Element("RunConfiguration")!.Element("EnvironmentVariables")!.Elements()) + { + environmentVariables.SetVariable(new(element.Name.ToString(), element.Value, true, true)); + } + + return Task.CompletedTask; + } + + public Task ValidateTestHostEnvironmentVariablesAsync(IReadOnlyEnvironmentVariables environmentVariables) + => ValidationResult.ValidTask; +} +#endif diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestCaseFilterCommandLineOptionsProvider.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestCaseFilterCommandLineOptionsProvider.cs new file mode 100644 index 0000000000..566d9f122e --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestCaseFilterCommandLineOptionsProvider.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if !WINDOWS_UWP +using Microsoft.Testing.Platform.CommandLine; +using Microsoft.Testing.Platform.Extensions; +using Microsoft.Testing.Platform.Extensions.CommandLine; +using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Resources; + +namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.TestingPlatformAdapter; + +/// +/// MSTest-native command-line provider for the VSTest --filter (test case filter) option. Mirrors the VSTest +/// bridge's TestCaseFilterCommandLineOptionsProvider (identical option name and description). +/// +[SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")] +internal sealed class MSTestTestCaseFilterCommandLineOptionsProvider : CommandLineOptionsProviderBase +{ + public const string TestCaseFilterOptionName = "filter"; + + public MSTestTestCaseFilterCommandLineOptionsProvider(IExtension extension) + : base(extension, [new CommandLineOption(TestCaseFilterOptionName, PlatformAdapterResources.TestCaseFilterOptionDescription, ArgumentArity.ExactlyOne, false)]) + { + } +} +#endif diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestFramework.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestFramework.cs index 7768de015f..3d27a9eb09 100644 --- a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestFramework.cs +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestFramework.cs @@ -3,8 +3,6 @@ #if !WINDOWS_UWP using Microsoft.Testing.Extensions.TrxReport.Abstractions; -using Microsoft.Testing.Extensions.VSTestBridge.Capabilities; -using Microsoft.Testing.Extensions.VSTestBridge.Resources; using Microsoft.Testing.Platform.Capabilities.TestFramework; using Microsoft.Testing.Platform.Extensions.Messages; using Microsoft.Testing.Platform.Extensions.TestFramework; @@ -16,6 +14,7 @@ using Microsoft.Testing.Platform.Telemetry; using Microsoft.Testing.Platform.TestHost; using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; +using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Resources; using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.TestingPlatformAdapter; using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; @@ -79,7 +78,7 @@ public MSTestTestFramework(MSTestExtension extension, Func ]; private bool IsTrxEnabled - => _isTrxEnabled ??= _trxReportCapability is IInternalVSTestBridgeTrxReportCapability internalCapability + => _isTrxEnabled ??= _trxReportCapability is IMSTestTrxReportCapability internalCapability ? internalCapability.IsTrxEnabled : _trxReportCapability is { IsSupported: true }; @@ -91,7 +90,7 @@ public Task CreateTestSessionAsync(CreateTestSessionCon if (_sessionUid is not null) { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, ExtensionResources.VSTestBridgedTestFrameworkSessionAlreadyCreatedErrorMessage, _sessionUid.Value.Value)); + throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, PlatformAdapterResources.VSTestBridgedTestFrameworkSessionAlreadyCreatedErrorMessage, _sessionUid.Value.Value)); } _sessionUid = context.SessionUid; diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestRunParametersCommandLineOptionsProvider.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestRunParametersCommandLineOptionsProvider.cs new file mode 100644 index 0000000000..7a37545b2f --- /dev/null +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestRunParametersCommandLineOptionsProvider.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if !WINDOWS_UWP +using Microsoft.Testing.Platform.CommandLine; +using Microsoft.Testing.Platform.Extensions; +using Microsoft.Testing.Platform.Extensions.CommandLine; +using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Resources; + +namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.TestingPlatformAdapter; + +/// +/// MSTest-native command-line provider for the VSTest --test-parameter (TestRunParameters) option. Mirrors +/// the VSTest bridge's TestRunParametersCommandLineOptionsProvider (identical option name, description and +/// validation). +/// +[SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")] +internal sealed class MSTestTestRunParametersCommandLineOptionsProvider : CommandLineOptionsProviderBase +{ + public const string TestRunParameterOptionName = "test-parameter"; + + public MSTestTestRunParametersCommandLineOptionsProvider(IExtension extension) + : base(extension, [new CommandLineOption(TestRunParameterOptionName, PlatformAdapterResources.TestRunParameterOptionDescription, ArgumentArity.OneOrMore, false)]) + { + } + + public override Task ValidateOptionArgumentsAsync(CommandLineOption commandOption, string[] arguments) + { + foreach (string argument in arguments) + { + if (!argument.Contains('=')) + { + return ValidationResult.InvalidTask(string.Format(CultureInfo.CurrentCulture, PlatformAdapterResources.TestRunParameterOptionArgumentIsNotParameter, argument)); + } + } + + return ValidationResult.ValidTask; + } +} +#endif diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/TestApplicationBuilderExtensions.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/TestApplicationBuilderExtensions.cs index eda3811103..7d56e5213e 100644 --- a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/TestApplicationBuilderExtensions.cs +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/TestApplicationBuilderExtensions.cs @@ -4,11 +4,11 @@ #if !WINDOWS_UWP using Microsoft.Testing.Extensions.TrxReport.Abstractions; using Microsoft.Testing.Extensions.VSTestBridge.Capabilities; -using Microsoft.Testing.Extensions.VSTestBridge.Helpers; using Microsoft.Testing.Platform.Builder; using Microsoft.Testing.Platform.Capabilities.TestFramework; using Microsoft.Testing.Platform.Helpers; using Microsoft.Testing.Platform.Services; +using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.TestingPlatformAdapter; namespace Microsoft.VisualStudio.TestTools.UnitTesting; @@ -18,9 +18,11 @@ namespace Microsoft.VisualStudio.TestTools.UnitTesting; [SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")] public static class TestApplicationBuilderExtensions { - // NOTE: We intentionally use this class and not VSTestBridgeExtensionBaseCapabilities because - // we don't want MSTest to use vstestProvider capability - private sealed class MSTestCapabilities : IInternalVSTestBridgeTrxReportCapability + // NOTE: We intentionally do not use the bridge's VSTestBridgeExtensionBaseCapabilities because we don't want + // MSTest to use the vstestProvider capability. This implements BOTH the bridge's TRX capability interface (read + // by MSTestBridgedTestFramework, the current default) and MSTest's native one (read by MSTestTestFramework), so + // both frameworks observe the same TRX enablement. + private sealed class MSTestCapabilities : IInternalVSTestBridgeTrxReportCapability, IMSTestTrxReportCapability { public bool IsTrxEnabled { get; private set; } @@ -38,11 +40,21 @@ void ITrxReportCapability.Enable() public static void AddMSTest(this ITestApplicationBuilder testApplicationBuilder, Func> getTestAssemblies) { MSTestExtension extension = new(); - testApplicationBuilder.AddRunSettingsService(extension); - testApplicationBuilder.AddTestCaseFilterService(extension); - testApplicationBuilder.AddTestRunParametersService(extension); + + // Register MSTest's own command-line options, runsettings configuration source and environment-variable + // provider natively (identical option names/descriptions to the VSTest bridge), so both the native and the + // bridged framework read them by name. + if (testApplicationBuilder is TestApplicationBuilder concreteBuilder) + { + concreteBuilder.Configuration.AddConfigurationSource(() => new MSTestRunSettingsConfigurationProvider(extension, new SystemFileSystem())); + } + + testApplicationBuilder.CommandLine.AddProvider(() => new MSTestRunSettingsCommandLineOptionsProvider(extension)); + testApplicationBuilder.CommandLine.AddProvider(() => new MSTestTestCaseFilterCommandLineOptionsProvider(extension)); + testApplicationBuilder.CommandLine.AddProvider(() => new MSTestTestRunParametersCommandLineOptionsProvider(extension)); testApplicationBuilder.AddMaximumFailedTestsService(extension); - testApplicationBuilder.AddRunSettingsEnvironmentVariableProvider(extension); + testApplicationBuilder.TestHostControllers.AddEnvironmentVariableProvider(serviceProvider + => new MSTestRunSettingsEnvironmentVariableProvider(extension, serviceProvider.GetCommandLineOptions(), serviceProvider.GetFileSystem(), serviceProvider.GetEnvironment())); // When the experimental native MTP integration is enabled, MSTest plugs into Microsoft.Testing.Platform // directly (no VSTest bridge object model on the request path). Off by default, so shipping behavior is diff --git a/src/Adapter/MSTest.TestAdapter/buildTransitive/common/MSTest.TestAdapter.targets b/src/Adapter/MSTest.TestAdapter/buildTransitive/common/MSTest.TestAdapter.targets index 04cfa32158..c0fa96f247 100644 --- a/src/Adapter/MSTest.TestAdapter/buildTransitive/common/MSTest.TestAdapter.targets +++ b/src/Adapter/MSTest.TestAdapter/buildTransitive/common/MSTest.TestAdapter.targets @@ -48,13 +48,29 @@ + + + + + %(RecursiveDir) + + + + - + @@ -67,9 +83,9 @@ This is populated here (rather than inside CopyMSTestV2Resources) so the item group is available when the Inputs/Outputs of CopyMSTestV2Resources are evaluated for incremental build. --> - + - %(CurrentUICultureHierarchy.Identity) + %(CurrentUICultureHierarchy.Identity)\ @@ -79,12 +95,12 @@ Condition=" '$(EnableMSTestV2CopyResources)' == 'true' " DependsOnTargets="GetMSTestV2CultureHierarchy" Inputs="@(MSTestV2Files)" - Outputs="@(MSTestV2Files->'$(TargetDir)%(UICulture)\%(FileName)%(Extension)')"> + Outputs="@(MSTestV2Files->'$(TargetDir)%(UICulture)%(FileName)%(Extension)')"> - %(MSTestV2Files.UICulture)\%(FileName).dll + %(MSTestV2Files.UICulture)%(FileName).dll PreserveNewest %(FullPath) False