diff --git a/Tasks/PublishTestResultsV2/make.json b/Tasks/PublishTestResultsV2/make.json index 67c28fd1e3c3..8d4f6517cd31 100644 --- a/Tasks/PublishTestResultsV2/make.json +++ b/Tasks/PublishTestResultsV2/make.json @@ -2,7 +2,7 @@ "externals": { "archivePackages": [ { - "url": "https://publishtestresult.blob.core.windows.net/publishtestresult/22540424/PublishTestResults.zip", + "url": "https://publishtestresult.blob.core.windows.net/publishtestresult/25028726/PublishTestResults.zip", "dest": "./" } ] diff --git a/Tasks/PublishTestResultsV2/task.json b/Tasks/PublishTestResultsV2/task.json index 4d57a58d77bc..83eff1dbf477 100644 --- a/Tasks/PublishTestResultsV2/task.json +++ b/Tasks/PublishTestResultsV2/task.json @@ -14,7 +14,7 @@ "version": { "Major": 2, "Minor": 233, - "Patch": 0 + "Patch": 1 }, "demands": [], "releaseNotes": "", diff --git a/Tasks/PublishTestResultsV2/task.loc.json b/Tasks/PublishTestResultsV2/task.loc.json index 69c0faea8962..6967ccc67950 100644 --- a/Tasks/PublishTestResultsV2/task.loc.json +++ b/Tasks/PublishTestResultsV2/task.loc.json @@ -14,7 +14,7 @@ "version": { "Major": 2, "Minor": 233, - "Patch": 0 + "Patch": 1 }, "demands": [], "releaseNotes": "ms-resource:loc.releaseNotes", diff --git a/_generated/PublishTestResultsV2.versionmap.txt b/_generated/PublishTestResultsV2.versionmap.txt index a3ee7f8ae323..9f8269016a76 100644 --- a/_generated/PublishTestResultsV2.versionmap.txt +++ b/_generated/PublishTestResultsV2.versionmap.txt @@ -1,2 +1,2 @@ -Default|2.233.0 -Node20_229_13|2.233.1 +Default|2.233.1 +Node20_229_13|2.233.2 diff --git a/_generated/PublishTestResultsV2/Strings/resources.resjson/de-DE/resources.resjson b/_generated/PublishTestResultsV2/Strings/resources.resjson/de-DE/resources.resjson new file mode 100644 index 000000000000..fc0a4477998b --- /dev/null +++ b/_generated/PublishTestResultsV2/Strings/resources.resjson/de-DE/resources.resjson @@ -0,0 +1,33 @@ +{ + "loc.friendlyName": "Testergebnisse veröffentlichen", + "loc.helpMarkDown": "[Weitere Informationen zu dieser Aufgabe](https://go.microsoft.com/fwlink/?LinkID=613742)", + "loc.description": "Hiermit werden Testergebnisse in Azure Pipelines veröffentlicht.", + "loc.instanceNameFormat": "Testergebnisse $(testResultsFiles) veröffentlichen", + "loc.releaseNotes": "", + "loc.group.displayName.advanced": "Erweitert", + "loc.input.label.testRunner": "Testergebnisformat", + "loc.input.help.testRunner": "Das Format der Testergebnisdateien, die vom ausgewählten Test Runner generiert werden, z. B. JUnit, VSTest, XUnit V2, NUnit und CTest.", + "loc.input.label.testResultsFiles": "Testergebnisdateien", + "loc.input.help.testResultsFiles": "Pfad der Testergebnisdateien. Unterstützt mehrere Zeilen von Minimatchmustern. [Weitere Informationen](https://go.microsoft.com/fwlink/?LinkId=835764)", + "loc.input.label.searchFolder": "Suchordner", + "loc.input.help.searchFolder": "Ordner, der nach Testergebnisdateien durchsucht wird. Standardmäßig ist dies \"$(System.DefaultWorkingDirectory)\".", + "loc.input.label.mergeTestResults": "Testergebnisse mergen", + "loc.input.help.mergeTestResults": "Für jede Ergebnisdatei wird ein Testlauf erstellt. Aktivieren Sie diese Option, um die Ergebnisse in einem einzigen Testlauf zusammenzuführen. Zur Leistungsoptimierung werden die Ergebnisse unabhängig von dieser Option in einem einzigen Lauf zusammengeführt, wenn mehr als 100 Ergebnisdateien vorliegen.", + "loc.input.label.failTaskOnFailedTests": "Bei Testfehlern als fehlerhaft markieren", + "loc.input.help.failTaskOnFailedTests": "Aufgabe bei Testfehlern als fehlerhaft markieren. Aktivieren Sie diese Option, um die Aufgabe als fehlerhaft zu markieren, wenn in den Ergebnisdateien Fehler ermittelt werden.", + "loc.input.label.failTaskOnFailureToPublishResults": "Fehler, wenn die Veröffentlichung von Testergebnissen fehlschlägt", + "loc.input.help.failTaskOnFailureToPublishResults": "Fehler, wenn die Veröffentlichung von Testergebnissen fehlschlägt. Aktivieren Sie diese Option, um den Task als fehlerhaft festzulegen, wenn die Veröffentlichung der Testergebnisse teilweise fehlgeschlagen ist.", + "loc.input.label.failTaskOnMissingResultsFile": "Fehler, wenn keine Ergebnisdateien gefunden werden", + "loc.input.help.failTaskOnMissingResultsFile": "Die Aufgabe schlägt fehl, wenn keine Ergebnisdateien gefunden werden.", + "loc.input.label.testRunTitle": "Testlauftitel", + "loc.input.help.testRunTitle": "Geben Sie einen Namen für den Testlauf an.", + "loc.input.label.platform": "Buildplattform", + "loc.input.help.platform": "Plattform, für die die Tests ausgeführt wurden", + "loc.input.label.configuration": "Buildkonfiguration", + "loc.input.help.configuration": "Konfiguration, für die die Tests ausgeführt wurden", + "loc.input.label.publishRunAttachments": "Testergebnisdateien hochladen", + "loc.input.help.publishRunAttachments": "Laden Sie Protokolle und weitere Dateien mit Diagnoseinformationen hoch, die beim Ausführen der Tests gesammelt wurden.", + "loc.messages.NoMatchingFilesFound": "Keine übereinstimmenden Testergebnisdateien für \"%s\" gefunden.", + "loc.messages.ErrorTestResultsPublisher": "Fehler beim Ausführen von TestResultsPublisher: %s.", + "loc.messages.ErrorFailTaskOnFailedTests": "Es wurde mindestens ein Testfehler in den Ergebnisdateien erkannt. Eine detaillierte Zusammenfassung der veröffentlichten Testergebnisse kann auf der Registerkarte \"Tests\" angezeigt werden." +} \ No newline at end of file diff --git a/_generated/PublishTestResultsV2/Strings/resources.resjson/en-US/resources.resjson b/_generated/PublishTestResultsV2/Strings/resources.resjson/en-US/resources.resjson new file mode 100644 index 000000000000..60e89a5f59e5 --- /dev/null +++ b/_generated/PublishTestResultsV2/Strings/resources.resjson/en-US/resources.resjson @@ -0,0 +1,33 @@ +{ + "loc.friendlyName": "Publish Test Results", + "loc.helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=613742)", + "loc.description": "Publish test results to Azure Pipelines", + "loc.instanceNameFormat": "Publish Test Results $(testResultsFiles)", + "loc.releaseNotes": "", + "loc.group.displayName.advanced": "Advanced", + "loc.input.label.testRunner": "Test result format", + "loc.input.help.testRunner": "Format of test result files generated by your choice of test runner e.g. JUnit, VSTest, XUnit V2, NUnit and CTest.", + "loc.input.label.testResultsFiles": "Test results files", + "loc.input.help.testResultsFiles": "Test results files path. Supports multiple lines of minimatch patterns. [More Information](https://go.microsoft.com/fwlink/?LinkId=835764)", + "loc.input.label.searchFolder": "Search folder", + "loc.input.help.searchFolder": "Folder to search for the test result files. Defaults to $(System.DefaultWorkingDirectory).", + "loc.input.label.mergeTestResults": "Merge test results", + "loc.input.help.mergeTestResults": "A test run is created for each results file. Check this option to merge results into a single test run. To optimize for better performance, results will be merged into a single run if there are more than 100 result files, irrespective of this option.", + "loc.input.label.failTaskOnFailedTests": "Fail if there are test failures", + "loc.input.help.failTaskOnFailedTests": "Fail the task if there are any test failures. Check this option to fail the task if test failures are detected in the result files.", + "loc.input.label.failTaskOnFailureToPublishResults": "Fail if there is failure in publishing test results", + "loc.input.help.failTaskOnFailureToPublishResults": "Fail if there is failure in publishing test results. Check this option to fail the task if publishing test results is failed partially.", + "loc.input.label.failTaskOnMissingResultsFile": "Fail if no result files are found", + "loc.input.help.failTaskOnMissingResultsFile": "Fail the task if no result files are found.", + "loc.input.label.testRunTitle": "Test run title", + "loc.input.help.testRunTitle": "Provide a name for the Test Run.", + "loc.input.label.platform": "Build Platform", + "loc.input.help.platform": "Platform for which the tests were run.", + "loc.input.label.configuration": "Build Configuration", + "loc.input.help.configuration": "Configuration for which the tests were run.", + "loc.input.label.publishRunAttachments": "Upload test results files", + "loc.input.help.publishRunAttachments": "Upload logs and other files containing diagnostic information collected when the tests were run.", + "loc.messages.NoMatchingFilesFound": "No test result files matching '%s' were found.", + "loc.messages.ErrorTestResultsPublisher": "Error while executing TestResultsPublisher: %s.", + "loc.messages.ErrorFailTaskOnFailedTests": "There are one or more test failures detected in result files. Detailed summary of published test results can be viewed in the Tests tab." +} \ No newline at end of file diff --git a/_generated/PublishTestResultsV2/Strings/resources.resjson/es-ES/resources.resjson b/_generated/PublishTestResultsV2/Strings/resources.resjson/es-ES/resources.resjson new file mode 100644 index 000000000000..fe3d084a77ac --- /dev/null +++ b/_generated/PublishTestResultsV2/Strings/resources.resjson/es-ES/resources.resjson @@ -0,0 +1,33 @@ +{ + "loc.friendlyName": "Publicar resultados de la prueba", + "loc.helpMarkDown": "[Obtener más información acerca de esta tarea](https://go.microsoft.com/fwlink/?LinkID=613742)", + "loc.description": "Publicar resultados de pruebas en Azure Pipelines", + "loc.instanceNameFormat": "Publicar resultados de pruebas $(testResultsFiles)", + "loc.releaseNotes": "", + "loc.group.displayName.advanced": "Avanzado", + "loc.input.label.testRunner": "Formato del resultado de las pruebas", + "loc.input.help.testRunner": "Formato de los archivos de resultados de pruebas generados por el ejecutor de pruebas de su elección; por ejemplo, JUnit, VSTest, XUnit V2, NUnit y CTest.", + "loc.input.label.testResultsFiles": "Archivos de resultados de pruebas", + "loc.input.help.testResultsFiles": "Ruta de acceso de los archivos de resultados de pruebas. Admite varias líneas de patrones de minimatch. [Más información](https://go.microsoft.com/fwlink/?LinkId=835764)", + "loc.input.label.searchFolder": "Carpeta de búsqueda", + "loc.input.help.searchFolder": "Carpeta para buscar los archivos de resultados de pruebas. El valor predeterminado es $(System.DefaultWorkingDirectory).", + "loc.input.label.mergeTestResults": "Fusionar mediante combinación los resultados de las pruebas", + "loc.input.help.mergeTestResults": "Se crea una serie de pruebas para cada archivo de resultados. Active esta opción para fusionar los resultados en una sola serie de pruebas. Para optimizar el rendimiento, los resultados se fusionarán en una sola serie si hay más de 100 archivos de resultados, independientemente de esta opción.", + "loc.input.label.failTaskOnFailedTests": "Interrumpir si hay errores en las pruebas", + "loc.input.help.failTaskOnFailedTests": "Interrumpa la tarea si hay errores en las pruebas. Seleccione esta opción para interrumpir la tarea si se detectan errores de las pruebas en los archivos de resultados.", + "loc.input.label.failTaskOnFailureToPublishResults": "Se produce un error si no se ha podido publicar los resultados de las pruebas", + "loc.input.help.failTaskOnFailureToPublishResults": "Se produce un error si no se ha podido publicar los resultados de las pruebas. Active esta opción para generar un error en la tarea si se produce un error parcial en la publicación de los resultados de pruebas.", + "loc.input.label.failTaskOnMissingResultsFile": "Error si no se encuentra ningún archivo de resultados", + "loc.input.help.failTaskOnMissingResultsFile": "No se puede realizar la tarea si no se encuentra ningún archivo de resultados.", + "loc.input.label.testRunTitle": "Título de la serie de pruebas", + "loc.input.help.testRunTitle": "Proporcione un nombre para la serie de pruebas.", + "loc.input.label.platform": "Plataforma de compilación", + "loc.input.help.platform": "Plataforma para la que se ejecutaron las pruebas.", + "loc.input.label.configuration": "Configuración de compilación", + "loc.input.help.configuration": "Configuración para la que se ejecutan las pruebas.", + "loc.input.label.publishRunAttachments": "Cargar archivos de resultados de pruebas", + "loc.input.help.publishRunAttachments": "Cargue los registros y otros archivos que contienen información de diagnóstico recopilada cuando se ejecutaron las pruebas.", + "loc.messages.NoMatchingFilesFound": "No se encontró ningún archivo de resultados de pruebas que coincida con \"%s\".", + "loc.messages.ErrorTestResultsPublisher": "Error al ejecutar TestResultsPublisher: %s.", + "loc.messages.ErrorFailTaskOnFailedTests": "Se han detectado uno o varios errores de prueba en los archivos de resultados. En la pestaña Pruebas puede ver un resumen detallado de los resultados de pruebas publicados." +} \ No newline at end of file diff --git a/_generated/PublishTestResultsV2/Strings/resources.resjson/fr-FR/resources.resjson b/_generated/PublishTestResultsV2/Strings/resources.resjson/fr-FR/resources.resjson new file mode 100644 index 000000000000..44865a2487c0 --- /dev/null +++ b/_generated/PublishTestResultsV2/Strings/resources.resjson/fr-FR/resources.resjson @@ -0,0 +1,33 @@ +{ + "loc.friendlyName": "Publier les résultats des tests", + "loc.helpMarkDown": "[En savoir plus sur cette tâche](https://go.microsoft.com/fwlink/?LinkID=613742)", + "loc.description": "Publier les résultats des tests sur Azure Pipelines", + "loc.instanceNameFormat": "Publier les résultats de test $(testResultsFiles)", + "loc.releaseNotes": "", + "loc.group.displayName.advanced": "Avancé", + "loc.input.label.testRunner": "Format de résultat de test", + "loc.input.help.testRunner": "Format des fichiers de résultats des tests générés par le Test Runner de votre choix, par exemple JUnit, VSTest, XUnit, V2, NUnit et CTest.", + "loc.input.label.testResultsFiles": "Fichiers de résultats des tests", + "loc.input.help.testResultsFiles": "Chemin des fichiers de résultats des tests. Prend en charge plusieurs lignes de modèles minimatch. [Plus d'informations](https://go.microsoft.com/fwlink/?LinkId=835764)", + "loc.input.label.searchFolder": "Dossier de recherche", + "loc.input.help.searchFolder": "Dossier de recherche des fichiers de résultats des tests. Valeur par défaut : $(System.DefaultWorkingDirectory).", + "loc.input.label.mergeTestResults": "Fusionner les résultats des tests", + "loc.input.help.mergeTestResults": "Une série de tests est créée pour chaque fichier de résultats. Cochez cette option pour fusionner les résultats dans une seule série de tests. Pour optimiser le niveau de performance, les résultats sont fusionnés en une seule série de tests, s'il existe plus de 100 fichiers de résultats, indépendamment de cette option.", + "loc.input.label.failTaskOnFailedTests": "Cesser toute exécution en cas d'échecs de tests", + "loc.input.help.failTaskOnFailedTests": "Faire cesser la tâche en cas d'échecs liés à des tests. Cochez cette option pour faire cesser la tâche si des échecs de tests sont détectés dans les fichiers de résultats.", + "loc.input.label.failTaskOnFailureToPublishResults": "Échouer en cas d'échec dans la publication des résultats des tests", + "loc.input.help.failTaskOnFailureToPublishResults": "Échouer s’il y a un échec dans la publication des résultats du test. Cochez cette option pour faire échouer la tâche si la publication des résultats du test échoue partiellement.", + "loc.input.label.failTaskOnMissingResultsFile": "Échec si aucun fichier de résultats n’est trouvé", + "loc.input.help.failTaskOnMissingResultsFile": "Échec de la tâche si aucun fichier de résultats n’est trouvé.", + "loc.input.label.testRunTitle": "Titre de la série de tests", + "loc.input.help.testRunTitle": "Indiquez le nom de la série de tests.", + "loc.input.label.platform": "Plateforme de build", + "loc.input.help.platform": "Plateforme pour laquelle les tests ont été exécutés.", + "loc.input.label.configuration": "Configuration de build", + "loc.input.help.configuration": "Configuration pour laquelle les tests ont été exécutés.", + "loc.input.label.publishRunAttachments": "Charger les fichiers de résultats des tests", + "loc.input.help.publishRunAttachments": "Chargez les journaux et autres fichiers contenant les informations de diagnostic collectées durant l'exécution des tests.", + "loc.messages.NoMatchingFilesFound": "Il n'existe aucun fichier de résultat de test correspondant à '%s'.", + "loc.messages.ErrorTestResultsPublisher": "Erreur durant l'exécution de TestResultsPublisher : %s.", + "loc.messages.ErrorFailTaskOnFailedTests": "Un ou plusieurs échecs de tests ont été détectés dans les fichiers de résultats. Vous pouvez consulter un récapitulatif détaillé de la publication des résultats des tests sous l'onglet Tests." +} \ No newline at end of file diff --git a/_generated/PublishTestResultsV2/Strings/resources.resjson/it-IT/resources.resjson b/_generated/PublishTestResultsV2/Strings/resources.resjson/it-IT/resources.resjson new file mode 100644 index 000000000000..428a50c18495 --- /dev/null +++ b/_generated/PublishTestResultsV2/Strings/resources.resjson/it-IT/resources.resjson @@ -0,0 +1,33 @@ +{ + "loc.friendlyName": "Pubblica risultati del test", + "loc.helpMarkDown": "[Altre informazioni su questa attività](https://go.microsoft.com/fwlink/?LinkID=613742)", + "loc.description": "Pubblica i risultati dei test in Azure Pipelines", + "loc.instanceNameFormat": "Pubblica risultati del test $(testResultsFiles)", + "loc.releaseNotes": "", + "loc.group.displayName.advanced": "Avanzate", + "loc.input.label.testRunner": "Formato dei risultati del test", + "loc.input.help.testRunner": "Formato dei file dei risultati del test generati con lo strumento di esecuzione test scelto, ad esempio JUnit, VSTest, XUnit V2, NUnit e CTest.", + "loc.input.label.testResultsFiles": "File dei risultati del test", + "loc.input.help.testResultsFiles": "Percorso dei file dei risultati del test. Sono supportate più righe di criteri di corrispondenza minima. [Altre informazioni](https://go.microsoft.com/fwlink/?LinkId=835764)", + "loc.input.label.searchFolder": "Cartella di ricerca", + "loc.input.help.searchFolder": "Cartella in cui cercare i file dei risultati del test. L'impostazione predefinita è $(System.DefaultWorkingDirectory).", + "loc.input.label.mergeTestResults": "Unisci risultati del test", + "loc.input.help.mergeTestResults": "Viene creata un'esecuzione dei test per ogni file di risultati. Selezionare questa opzione per unire i risultati in un'unica esecuzione dei test. Per ottimizzare l'operazione e garantire migliori prestazioni, i risultati verranno uniti in un'unica esecuzione se sono presenti più di 100 file di risultati, indipendentemente da questa opzione.", + "loc.input.label.failTaskOnFailedTests": "Non eseguire in caso di errori di test", + "loc.input.help.failTaskOnFailedTests": "Non esegue l'attività in caso di errori di test. Selezionare questa opzione per non eseguire l'attività se vengono rilevati errori di test nei file di risultati.", + "loc.input.label.failTaskOnFailureToPublishResults": "Esito negativo in caso di errore durante la pubblicazione dei risultati dei test", + "loc.input.help.failTaskOnFailureToPublishResults": "Esito negativo in caso di errore durante la pubblicazione dei risultati dei test. Selezionare questa opzione per non eseguire l'attività se la pubblicazione dei risultati del test non è riuscita parzialmente.", + "loc.input.label.failTaskOnMissingResultsFile": "Esito negativo se non vengono trovati file di risultati", + "loc.input.help.failTaskOnMissingResultsFile": "Se non vengono trovati file di risultati, l'attività ha esito negativo.", + "loc.input.label.testRunTitle": "Titolo dell'esecuzione dei test", + "loc.input.help.testRunTitle": "Consente di specificare un nome per l'esecuzione dei test.", + "loc.input.label.platform": "Piattaforma di compilazione", + "loc.input.help.platform": "Piattaforma per cui sono stati eseguiti i test.", + "loc.input.label.configuration": "Configurazione della build", + "loc.input.help.configuration": "Configurazione per cui sono stati eseguiti i test.", + "loc.input.label.publishRunAttachments": "Carica file dei risultati del test", + "loc.input.help.publishRunAttachments": "Carica i log e altri file contenenti informazioni diagnostiche raccolte durante l'esecuzione dei test.", + "loc.messages.NoMatchingFilesFound": "Non è stato trovato alcun file dei risultati del test corrispondente a %s.", + "loc.messages.ErrorTestResultsPublisher": "Si è verificato un errore durante l'esecuzione di TestResultsPublisher: %s.", + "loc.messages.ErrorFailTaskOnFailedTests": "Sono stati rilevati uno o più errori di test nei file dei risultati. Il riepilogo dettagliato dei risultati del test pubblicati può essere visualizzato nella scheda Test." +} \ No newline at end of file diff --git a/_generated/PublishTestResultsV2/Strings/resources.resjson/ja-JP/resources.resjson b/_generated/PublishTestResultsV2/Strings/resources.resjson/ja-JP/resources.resjson new file mode 100644 index 000000000000..e6a525568946 --- /dev/null +++ b/_generated/PublishTestResultsV2/Strings/resources.resjson/ja-JP/resources.resjson @@ -0,0 +1,33 @@ +{ + "loc.friendlyName": "テスト結果の発行", + "loc.helpMarkDown": "[このタスクの詳細を表示](https://go.microsoft.com/fwlink/?LinkID=613742)", + "loc.description": "テスト結果を Azure Pipelines に公開する", + "loc.instanceNameFormat": "テスト結果の発行 $(testResultsFiles)", + "loc.releaseNotes": "", + "loc.group.displayName.advanced": "詳細設定", + "loc.input.label.testRunner": "テスト結果の形式", + "loc.input.help.testRunner": "選んだテスト ランナーによって生成されるテスト結果ファイルの形式。たとえば、JUnit、VSTest、XUnit V2、NUnit、CTest など。", + "loc.input.label.testResultsFiles": "テスト結果ファイル", + "loc.input.help.testResultsFiles": "テスト結果ファイルのパス。minimatch パターンで複数行をサポートしています。[追加情報](https://go.microsoft.com/fwlink/?LinkId=835764)", + "loc.input.label.searchFolder": "検索フォルダー", + "loc.input.help.searchFolder": "テスト結果ファイルを検索するフォルダー。既定で $(System.DefaultWorkingDirectory) に設定されます。", + "loc.input.label.mergeTestResults": "テスト結果のマージ", + "loc.input.help.mergeTestResults": "結果ファイルごとにテストの実行が作成されます。結果を 1 つのテストの実行にマージする場合、このオプションを有効にします。最適化してパフォーマンスを向上させるため、結果ファイルが 100 個を超えたら、このオプションに関係なく、結果は 1 つの実行にマージされます。", + "loc.input.label.failTaskOnFailedTests": "テスト エラーがある場合に失敗する", + "loc.input.help.failTaskOnFailedTests": "テストが失敗した場合にタスクを失敗させます。結果ファイルでテスト エラーが検出された場合にタスクを中止するには、このオプションをオンにします。", + "loc.input.label.failTaskOnFailureToPublishResults": "テスト結果の公開に失敗した場合は失敗します", + "loc.input.help.failTaskOnFailureToPublishResults": "テスト結果の公開に失敗した場合は失敗します。テスト結果の公開が部分的に失敗した場合にタスクを失敗させるには、このオプションをオンにします。", + "loc.input.label.failTaskOnMissingResultsFile": "結果ファイルが見つからない場合は失敗します", + "loc.input.help.failTaskOnMissingResultsFile": "結果ファイルが見つからない場合はタスクを失敗します。", + "loc.input.label.testRunTitle": "テストの実行のタイトル", + "loc.input.help.testRunTitle": "テスト実行の名前を指定します。", + "loc.input.label.platform": "ビルド プラットフォーム", + "loc.input.help.platform": "テストの実行対象となったプラットフォーム。", + "loc.input.label.configuration": "ビルド構成", + "loc.input.help.configuration": "テストの実行対象となった構成。", + "loc.input.label.publishRunAttachments": "テスト結果ファイルのアップロード", + "loc.input.help.publishRunAttachments": "テストが実行された際に収集された診断情報を含むログとその他のファイルをアップロードします。", + "loc.messages.NoMatchingFilesFound": "'%s' と一致するテスト結果ファイルが見つかりませんでした。", + "loc.messages.ErrorTestResultsPublisher": "TestResultsPublisher の実行中にエラーが発生しました: %s。", + "loc.messages.ErrorFailTaskOnFailedTests": "結果ファイルで 1 つ以上のテスト エラーが検出されました。公開されたテスト結果の詳細な概要は、[テスト] タブで確認できます。" +} \ No newline at end of file diff --git a/_generated/PublishTestResultsV2/Strings/resources.resjson/ko-KR/resources.resjson b/_generated/PublishTestResultsV2/Strings/resources.resjson/ko-KR/resources.resjson new file mode 100644 index 000000000000..664ae46bb519 --- /dev/null +++ b/_generated/PublishTestResultsV2/Strings/resources.resjson/ko-KR/resources.resjson @@ -0,0 +1,33 @@ +{ + "loc.friendlyName": "테스트 결과 게시", + "loc.helpMarkDown": "[이 작업에 대한 자세한 정보](https://go.microsoft.com/fwlink/?LinkID=613742)", + "loc.description": "테스트 결과를 Azure Pipelines에 게시합니다.", + "loc.instanceNameFormat": "테스트 결과 $(testResultsFiles) 게시", + "loc.releaseNotes": "", + "loc.group.displayName.advanced": "고급", + "loc.input.label.testRunner": "테스트 결과 형식", + "loc.input.help.testRunner": "JUnit, VSTest, XUnit V2, NUnit, CTest 등의 선택한 테스트 실행기에서 생성되는 테스트 결과 파일의 형식입니다.", + "loc.input.label.testResultsFiles": "테스트 결과 파일", + "loc.input.help.testResultsFiles": "테스트 결과 파일 경로입니다. minimatch 패턴을 여러 줄 지원합니다. [자세한 정보](https://go.microsoft.com/fwlink/?LinkId=835764)", + "loc.input.label.searchFolder": "검색 폴더", + "loc.input.help.searchFolder": "테스트 결과 파일을 검색할 폴더입니다. 기본값은 $(System.DefaultWorkingDirectory)입니다.", + "loc.input.label.mergeTestResults": "테스트 결과 병합", + "loc.input.help.mergeTestResults": "각 결과 파일에 대해 테스트 실행이 생성됩니다. 결과를 단일 테스트 실행에 병합하려면 이 옵션을 선택하세요. 성능 향상에 최적화하기 위해, 이 옵션에 관계없이 결과 파일이 100개를 넘을 경우 결과가 단일 실행에 병합됩니다.", + "loc.input.label.failTaskOnFailedTests": "테스트 오류가 있을 경우 실패", + "loc.input.help.failTaskOnFailedTests": "테스트 오류가 있을 경우 작업에 실패합니다. 결과 파일에서 테스트 오류가 검색될 경우 작업에 실패하도록 하려면 이 옵션을 선택합니다.", + "loc.input.label.failTaskOnFailureToPublishResults": "테스트 결과를 게시하는 동안 오류가 발생하면 실패합니다.", + "loc.input.help.failTaskOnFailureToPublishResults": "테스트 결과를 게시하는 동안 오류가 발생하면 실패합니다. 테스트 결과의 일부가 게시되지 못한 경우 작업을 실패하려면 이 옵션을 선택하세요.", + "loc.input.label.failTaskOnMissingResultsFile": "결과 파일을 찾을 수 없는 경우 실패", + "loc.input.help.failTaskOnMissingResultsFile": "결과 파일을 찾을 수 없으면 작업에 실패합니다.", + "loc.input.label.testRunTitle": "테스트 실행 제목", + "loc.input.help.testRunTitle": "테스트 실행의 이름을 제공하세요.", + "loc.input.label.platform": "빌드 플랫폼", + "loc.input.help.platform": "테스트를 실행한 플랫폼.", + "loc.input.label.configuration": "빌드 구성", + "loc.input.help.configuration": "테스트를 실행한 구성입니다.", + "loc.input.label.publishRunAttachments": "테스트 결과 파일 업로드", + "loc.input.help.publishRunAttachments": "로그 및 테스트 실행 시 수집된 진단 정보를 포함하는 기타 파일을 업로드합니다.", + "loc.messages.NoMatchingFilesFound": "'%s'과(와) 일치하는 테스트 결과 파일이 없습니다.", + "loc.messages.ErrorTestResultsPublisher": "TestResultsPublisher를 실행하는 중 오류 발생: %s.", + "loc.messages.ErrorFailTaskOnFailedTests": "결과 파일에서 테스트 오류가 하나 이상 검색되었습니다. [테스트] 탭에서 게시된 테스트 결과의 자세한 요약을 볼 수 있습니다." +} \ No newline at end of file diff --git a/_generated/PublishTestResultsV2/Strings/resources.resjson/ru-RU/resources.resjson b/_generated/PublishTestResultsV2/Strings/resources.resjson/ru-RU/resources.resjson new file mode 100644 index 000000000000..059a5437da74 --- /dev/null +++ b/_generated/PublishTestResultsV2/Strings/resources.resjson/ru-RU/resources.resjson @@ -0,0 +1,33 @@ +{ + "loc.friendlyName": "Публикация результатов теста", + "loc.helpMarkDown": "[См. дополнительные сведения об этой задаче](https://go.microsoft.com/fwlink/?LinkID=613742)", + "loc.description": "Опубликовать результаты тестов в Azure Pipelines", + "loc.instanceNameFormat": "Опубликовать результаты тестов $(testResultsFiles)", + "loc.releaseNotes": "", + "loc.group.displayName.advanced": "Дополнительно", + "loc.input.label.testRunner": "Формат результатов теста", + "loc.input.help.testRunner": "Формат файлов результатов тестирования, создаваемых выбранным вами средством выполнения тестов, например JUnit, VSTest, XUnit V2, NUnit и CTest.", + "loc.input.label.testResultsFiles": "Файлы результатов теста", + "loc.input.help.testResultsFiles": "Путь к файлам результатов теста. Поддерживается несколько строк шаблонов minimatch. [Подробнее](https://go.microsoft.com/fwlink/?LinkId=835764).", + "loc.input.label.searchFolder": "Папка поиска", + "loc.input.help.searchFolder": "Папка для поиска файлов результатов теста. По умолчанию используется папка $(System.DefaultWorkingDirectory).", + "loc.input.label.mergeTestResults": "Объединить результаты теста", + "loc.input.help.mergeTestResults": "Тестовый запуск создается для каждого файла результатов. Установите этот флажок, чтобы объединить результаты в один тестовый запуск. Для повышения производительности при наличии более 100 файлов результатов они будут объединены в один тестовый запуск независимо от значения этого параметра.", + "loc.input.label.failTaskOnFailedTests": "Ошибка при наличии сбоев тестов", + "loc.input.help.failTaskOnFailedTests": "Ошибка выполнения задачи при наличии любых сбоев тестов. Установите этот флажок, чтобы задача завершилась ошибкой при обнаружении сбоев тестов в файлах результатов.", + "loc.input.label.failTaskOnFailureToPublishResults": "Завершать сбоем, если не удалось опубликовать результаты тестирования", + "loc.input.help.failTaskOnFailureToPublishResults": "Завершать сбоем, если не удалось опубликовать результаты тестирования. Установите этот флажок, чтобы не выполнять задачу, если частично не удалось опубликовать результаты тестирования.", + "loc.input.label.failTaskOnMissingResultsFile": "Сбой, если файлы результатов не найдены", + "loc.input.help.failTaskOnMissingResultsFile": "Сбой задачи, если файлы результатов не найдены.", + "loc.input.label.testRunTitle": "Название тестового запуска", + "loc.input.help.testRunTitle": "Укажите имя для тестового запуска.", + "loc.input.label.platform": "Платформа сборки", + "loc.input.help.platform": "Платформа, для которой выполнялись тесты.", + "loc.input.label.configuration": "Конфигурация сборки", + "loc.input.help.configuration": "Конфигурация, для которой выполнялись тесты.", + "loc.input.label.publishRunAttachments": "Отправить файлы результатов теста", + "loc.input.help.publishRunAttachments": "Отправьте журналы и другие файлы с диагностическими сведениями, собранными во время выполнения тестов.", + "loc.messages.NoMatchingFilesFound": "Найдены файлы результатов теста, соответствующие \"%s\".", + "loc.messages.ErrorTestResultsPublisher": "Ошибка при выполнении TestResultsPublisher: %s.", + "loc.messages.ErrorFailTaskOnFailedTests": "В файлах результатов обнаружен один или несколько сбоев тестов. Подробные сведения об опубликованных результатах тестов можно просмотреть на вкладке \"Тесты\"." +} \ No newline at end of file diff --git a/_generated/PublishTestResultsV2/Strings/resources.resjson/zh-CN/resources.resjson b/_generated/PublishTestResultsV2/Strings/resources.resjson/zh-CN/resources.resjson new file mode 100644 index 000000000000..a2fd67f28bb7 --- /dev/null +++ b/_generated/PublishTestResultsV2/Strings/resources.resjson/zh-CN/resources.resjson @@ -0,0 +1,33 @@ +{ + "loc.friendlyName": "发布测试结果", + "loc.helpMarkDown": "[详细了解此任务](https://go.microsoft.com/fwlink/?LinkID=613742)", + "loc.description": "将测试结果发布到 Azure Pipelines", + "loc.instanceNameFormat": "发布测试结果 $(testResultsFiles)", + "loc.releaseNotes": "", + "loc.group.displayName.advanced": "高级", + "loc.input.label.testRunner": "测试结果格式", + "loc.input.help.testRunner": "所选测试运行程序(例如 JUnit、VSTest、XUnit V2、NUnit 和 CTest)生成的测试结果文件的格式。", + "loc.input.label.testResultsFiles": "测试结果文件", + "loc.input.help.testResultsFiles": "测试结果文件路径。支持多行 minimatch 模式。[详细信息](https://go.microsoft.com/fwlink/?LinkId=835764)", + "loc.input.label.searchFolder": "搜索文件夹", + "loc.input.help.searchFolder": "在其中搜索测试结果文件的文件夹。默认为 $(System.DefaultWorkingDirectory)。", + "loc.input.label.mergeTestResults": "合并测试结果", + "loc.input.help.mergeTestResults": "为每个结果文件创建测试运行。选中此选项可将结果合并到单个测试运行中。为了进行优化以提高性能,如果存在超过 100 个结果文件,结果将合并到单个运行中,而不无论此选项如何。", + "loc.input.label.failTaskOnFailedTests": "如果存在测试问题,则会失败", + "loc.input.help.failTaskOnFailedTests": "如果存在任何测试问题,任务将失败。如果在结果文件中检测到测试问题,请选中此选项以使任务失败。", + "loc.input.label.failTaskOnFailureToPublishResults": "如果发布测试结果失败,则失败", + "loc.input.help.failTaskOnFailureToPublishResults": "如果发布测试结果失败,则失败。如果发布测试结果部分失败,请选中此选项以使任务失败。", + "loc.input.label.failTaskOnMissingResultsFile": "如果找不到结果文件,则失败", + "loc.input.help.failTaskOnMissingResultsFile": "如果找不到结果文件,任务将失败。", + "loc.input.label.testRunTitle": "测试运行标题", + "loc.input.help.testRunTitle": "提供测试运行的名称。", + "loc.input.label.platform": "生成平台", + "loc.input.help.platform": "对其运行了测试的平台。", + "loc.input.label.configuration": "生成配置", + "loc.input.help.configuration": "对其运行了测试的配置。", + "loc.input.label.publishRunAttachments": "上传测试结果文件", + "loc.input.help.publishRunAttachments": "运行测试时,上传日志和包含收集的诊断信息的其他文件。", + "loc.messages.NoMatchingFilesFound": "未找到与“%s”匹配的测试结果文件。", + "loc.messages.ErrorTestResultsPublisher": "执行 TestResultsPublisher 时出错: %s。", + "loc.messages.ErrorFailTaskOnFailedTests": "在结果文件中检测到一个或多个测试失败。可以在“测试”选项卡中查看已发布测试结果的详细摘要。" +} \ No newline at end of file diff --git a/_generated/PublishTestResultsV2/Strings/resources.resjson/zh-TW/resources.resjson b/_generated/PublishTestResultsV2/Strings/resources.resjson/zh-TW/resources.resjson new file mode 100644 index 000000000000..5a8f584bd173 --- /dev/null +++ b/_generated/PublishTestResultsV2/Strings/resources.resjson/zh-TW/resources.resjson @@ -0,0 +1,33 @@ +{ + "loc.friendlyName": "發行測試結果", + "loc.helpMarkDown": "[深入了解此工作](https://go.microsoft.com/fwlink/?LinkID=613742)", + "loc.description": "將測試結果發佈至 Azure Pipelines", + "loc.instanceNameFormat": "發行測試結果 $(testResultsFiles)", + "loc.releaseNotes": "", + "loc.group.displayName.advanced": "進階", + "loc.input.label.testRunner": "測試結果格式", + "loc.input.help.testRunner": "測試結果檔案的格式由您所選的測試執行器 (例如 JUnit、VSTest、XUnit V2、NUnit 和 CTest) 產生。", + "loc.input.label.testResultsFiles": "測試結果檔案", + "loc.input.help.testResultsFiles": "測試結果檔案路徑。支援多行的 minimatch 模式。[更多資訊](https://go.microsoft.com/fwlink/?LinkId=835764)", + "loc.input.label.searchFolder": "搜尋資料夾", + "loc.input.help.searchFolder": "搜尋測試結果檔案所在的資料夾。預設值為 $(System.DefaultWorkingDirectory)。", + "loc.input.label.mergeTestResults": "合併測試結果", + "loc.input.help.mergeTestResults": "為每個結果檔案建立一個測試回合。請檢查此選項,以將結果合併成單一測試回合。若結果檔案超過 100 個,為盡可能達到最佳效能,則不論此選項設定為何,都會將結果合併成單一回合。", + "loc.input.label.failTaskOnFailedTests": "如果有測試失敗,即失敗", + "loc.input.help.failTaskOnFailedTests": "如果沒有任何測試失敗,就使工作失敗。請於在結果檔案中偵測到測試失敗時,選取此選項來讓工作失敗。", + "loc.input.label.failTaskOnFailureToPublishResults": "如果發佈測試結果失敗,則失敗", + "loc.input.help.failTaskOnFailureToPublishResults": "如果發佈測試結果失敗,則失敗。如果發佈測試結果部分失敗,請選取此選項以使工作失敗。", + "loc.input.label.failTaskOnMissingResultsFile": "找不到結果檔案時失敗", + "loc.input.help.failTaskOnMissingResultsFile": "如果找不到結果檔案,則工作失敗。", + "loc.input.label.testRunTitle": "測試回合標題", + "loc.input.help.testRunTitle": "提供測試回合的名稱。", + "loc.input.label.platform": "組建平台", + "loc.input.help.platform": "已執行測試的平台。", + "loc.input.label.configuration": "組建組態", + "loc.input.help.configuration": "已執行測試的組態。", + "loc.input.label.publishRunAttachments": "上傳測試結果檔案", + "loc.input.help.publishRunAttachments": "上傳包含於測試執行期間所收集診斷資訊的記錄和其他檔案。", + "loc.messages.NoMatchingFilesFound": "找不到任何與 '%s' 相符的測試結果。", + "loc.messages.ErrorTestResultsPublisher": "執行 TestResultsPublisher 時發生錯誤: %s。", + "loc.messages.ErrorFailTaskOnFailedTests": "在測試檔案中偵測到一或多個測試失敗。您可於 [測試] 索引標籤檢視已發佈測試結果的詳細摘要。" +} \ No newline at end of file diff --git a/_generated/PublishTestResultsV2/Tests/Constants.ts b/_generated/PublishTestResultsV2/Tests/Constants.ts new file mode 100644 index 000000000000..a9c3abe0b563 --- /dev/null +++ b/_generated/PublishTestResultsV2/Tests/Constants.ts @@ -0,0 +1,17 @@ +export const testRunner = 'testRunner'; +export const testResultsFiles = 'testResultsFiles'; +export const mergeTestResults = 'mergeTestResults'; +export const platform = 'platform'; +export const configuration = 'configuration'; +export const testRunTitle = 'testRunTitle'; +export const publishRunAttachments = 'publishRunAttachments'; +export const searchFolder = 'searchFolder'; +export const listPackagesReturnCode = 'listPackagesReturnCode'; +export const osType = 'osType'; +export const agentTempDirectory = 'Agent.TempDirectory'; +export const failTaskOnFailedTests = 'failTaskOnFailedTests'; +export const proxyUrl = 'agent.proxyurl'; +export const proxyUserName = 'agent.proxyusername'; +export const proxyPassword = 'agent.proxypassword'; +export const proxyByPassHosts = 'agent.proxybypasslist'; +export const failTaskOnFailureToPublishResults = 'failTaskOnFailureToPublishResults'; \ No newline at end of file diff --git a/_generated/PublishTestResultsV2/Tests/L0.ts b/_generated/PublishTestResultsV2/Tests/L0.ts new file mode 100644 index 000000000000..acff3d352e20 --- /dev/null +++ b/_generated/PublishTestResultsV2/Tests/L0.ts @@ -0,0 +1,195 @@ +import * as path from 'path'; +import * as assert from 'assert'; +import * as ttm from 'azure-pipelines-task-lib/mock-test'; +import * as constants from './Constants'; +import * as tl from 'azure-pipelines-task-lib'; + +import * as mt from 'azure-pipelines-task-lib/mock-task'; +import * as mtm from 'azure-pipelines-task-lib/mock-test'; +import * as mtr from 'azure-pipelines-task-lib/mock-toolrunner'; +import * as ma from 'azure-pipelines-task-lib/mock-answer'; + +describe('PublishTestResults Suite', function() { + this.timeout(10000); + + before((done) => { + done(); + }); + + beforeEach((done) => { + // Clear all inputs and other environment variables + delete process.env[constants.testRunner]; + delete process.env[constants.testResultsFiles]; + delete process.env[constants.mergeTestResults]; + delete process.env[constants.platform]; + delete process.env[constants.configuration]; + delete process.env[constants.testRunTitle]; + delete process.env[constants.publishRunAttachments]; + delete process.env[constants.searchFolder]; + delete process.env[constants.listPackagesReturnCode]; + delete process.env[constants.osType]; + delete process.env[constants.failTaskOnFailedTests]; + delete process.env[constants.failTaskOnFailureToPublishResults]; + + done(); + }); + + after(function () { + }); + + it('TestResultsPublisher.exe is called on Windows OS', (done: Mocha.Done) => { + console.log('TestCaseName: TestResultsPublisher.exe is called on Windows OS'); + + // Setup the mock runner + const tp = path.join(__dirname, 'TestSetup.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + // Set the inputs + process.env[constants.osType] = 'Windows_NT'; + process.env[constants.testRunner] = 'VSTest'; + process.env[constants.testResultsFiles] = '"n-files0.xml"'; + process.env[constants.mergeTestResults] = 'false'; + process.env[constants.failTaskOnFailedTests] = 'false'; + process.env[constants.platform] = ''; + process.env[constants.configuration] = ''; + process.env[constants.testRunTitle] = ''; + process.env[constants.publishRunAttachments] = 'false'; + process.env[constants.searchFolder] = ''; + process.env[constants.listPackagesReturnCode] = '20000'; + process.env[constants.agentTempDirectory] = __dirname; + process.env[constants.proxyUrl] = "http://example.org"; + process.env[constants.proxyUserName] = "1"; + process.env[constants.proxyPassword] = "1"; + process.env[constants.proxyByPassHosts] = undefined; + process.env[constants.failTaskOnFailureToPublishResults] = 'false'; + + // Start the run + tr.run(); + + // Asserts + assert(tr.stdOutContained(`TestResultsPublisher.exe`), + `TestResultsPublisher.exe should have been called on Windows OS`); + assert.equal(tr.invokedToolCount, 1, `invoked tool count should be 1`); + + done(); + }); + + it('TestResultsPublisher.exe is not called on non-Windows OS', (done: Mocha.Done) => { + console.log('TestCaseName: TestResultsPublisher.exe is not called on non-Windows OS'); + + // Setup the mock runner + const tp = path.join(__dirname, 'TestSetup.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + // Set the inputs + process.env[constants.osType] = 'Ubuntu'; + process.env[constants.testRunner] = 'VSTest'; + process.env[constants.testResultsFiles] = '"n-files0.xml"'; + process.env[constants.mergeTestResults] = 'false'; + process.env[constants.failTaskOnFailedTests] = 'false'; + process.env[constants.platform] = ''; + process.env[constants.configuration] = ''; + process.env[constants.testRunTitle] = ''; + process.env[constants.publishRunAttachments] = 'false'; + process.env[constants.searchFolder] = ''; + process.env[constants.listPackagesReturnCode] = '20000'; + process.env[constants.agentTempDirectory] = __dirname; + process.env[constants.proxyUrl] = "http://example.org"; + process.env[constants.proxyUserName] = "1"; + process.env[constants.proxyPassword] = "1"; + process.env[constants.proxyByPassHosts] = undefined; + process.env[constants.failTaskOnFailureToPublishResults] = 'false'; + + // Start the run + tr.run(); + + // Asserts + assert(tr.stdout.indexOf(`TestResultsPublisher.exe`) < 0, + `TestResultsPublisher.exe should not have been called on non-windows OS`); + assert.equal(tr.invokedToolCount, 0, `invoked tool count should be 0`); + + done(); + }); + + it('Command should be called when exe returns with exit code for feature flag off', (done: Mocha.Done) => { + console.log('TestCaseName: Command should be called when exe returns with exit code for feature flag off'); + + // Setup the mock runner + const tp = path.join(__dirname, 'TestSetup.js'); + const tr : ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + // Set the inputs + process.env[constants.osType] = 'Windows_NT'; + process.env[constants.testRunner] = 'VSTest'; + process.env[constants.testResultsFiles] = '"n-files0.xml"'; + process.env[constants.mergeTestResults] = 'false'; + process.env[constants.failTaskOnFailedTests] = 'false'; + process.env[constants.platform] = ''; + process.env[constants.configuration] = ''; + process.env[constants.testRunTitle] = ''; + process.env[constants.publishRunAttachments] = 'false'; + process.env[constants.searchFolder] = ''; + process.env[constants.listPackagesReturnCode] = '20000'; + process.env[constants.agentTempDirectory] = __dirname; + process.env[constants.proxyUrl] = "http://example.org"; + process.env[constants.proxyUserName] = "1"; + process.env[constants.proxyPassword] = "1"; + process.env[constants.proxyByPassHosts] = undefined; + process.env[constants.failTaskOnFailureToPublishResults] = 'false'; + + // Start the run + tr.run(); + + // Asserts + assert(tr.stderr.length === 0 || tr.errorIssues.length, 'should not have written to stderr'); + assert(tr.succeeded, `Task should have succeeded`); + assert.equal(tr.invokedToolCount, 1, `invoked tool count should be 1`); + assert(tr.stdOutContained(`TestResultsPublisher.exe`), + `Should have called TestResultsPublisher.exe first`); + assert(tr.stdOutContained(`vso[results.publish type=VSTest;mergeResults=false;publishRunAttachments=false;resultFiles=n-files0.xml;failTaskOnFailedTests=false;failTaskOnFailureToPublishResults=false;testRunSystem=VSTS - PTR;]`), + `Should have published results through Command when feature flag is off`); + + done(); + }); + + it('Command should not be called when exe returns with exit code for feature flag on', (done: Mocha.Done) => { + console.log('TestCaseName: Command should not be called when exe returns with exit code for feature flag on'); + + // Setup the mock runner + const tp = path.join(__dirname, 'TestSetup.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + // Set the inputs + process.env[constants.osType] = 'Windows_NT'; + process.env[constants.testRunner] = 'VSTest'; + process.env[constants.testResultsFiles] = '"n-files0.xml"'; + process.env[constants.mergeTestResults] = 'false'; + process.env[constants.failTaskOnFailedTests] = 'false'; + process.env[constants.platform] = ''; + process.env[constants.configuration] = ''; + process.env[constants.testRunTitle] = ''; + process.env[constants.publishRunAttachments] = 'false'; + process.env[constants.searchFolder] = ''; + process.env[constants.listPackagesReturnCode] = '0'; + process.env[constants.agentTempDirectory] = __dirname; + process.env[constants.proxyUrl] = "http://example.org"; + process.env[constants.proxyUserName] = "1"; + process.env[constants.proxyPassword] = "1"; + process.env[constants.proxyByPassHosts] = undefined; + process.env[constants.failTaskOnFailureToPublishResults] = 'false'; + + // Start the run + tr.run(); + + // Asserts + assert(tr.stderr.length === 0 || tr.errorIssues.length, 'should not have written to stderr'); + assert(tr.succeeded, `Task should have succeeded`); + assert.equal(tr.invokedToolCount, 1, `invoked tool count should be 1`); + assert(tr.stdOutContained(`TestResultsPublisher.exe`), + `Should have called TestResultsPublisher.exe first`); + assert(tr.stdout.indexOf(`vso[results.publish type=VSTest;mergeResults=false;publishRunAttachments=false;resultFiles=n-files0.xml;failTaskOnFailedTests=false;failTaskOnFailureToPublishResults=false;testRunSystem=VSTS - PTR;]`) < 0, + `Command should not have been called when exe returns with exit code suggesting feature flag is on`); + + done(); + }); +}); \ No newline at end of file diff --git a/_generated/PublishTestResultsV2/Tests/TestSetup.ts b/_generated/PublishTestResultsV2/Tests/TestSetup.ts new file mode 100644 index 000000000000..c3509109b18c --- /dev/null +++ b/_generated/PublishTestResultsV2/Tests/TestSetup.ts @@ -0,0 +1,78 @@ +import * as ma from 'azure-pipelines-task-lib/mock-answer'; +import * as tmrm from 'azure-pipelines-task-lib/mock-run'; +import * as tmt from 'azure-pipelines-task-lib/mock-task'; +import * as constants from './Constants'; +import * as path from 'path'; + +// Get the task path +const taskPath = path.join(__dirname, '..', 'publishtestresults.js'); +const tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +// Set inputs +tr.setInput('testRunner', process.env[constants.testRunner]); +tr.setInput('testResultsFiles', process.env[constants.testResultsFiles]); +tr.setInput('mergeTestResults', process.env[constants.mergeTestResults]); +tr.setInput('platform', process.env[constants.platform]); +tr.setInput('configuration', process.env[constants.configuration]); +tr.setInput('testRunTitle', process.env[constants.testRunTitle]); +tr.setInput('publishRunAttachments', process.env[constants.publishRunAttachments]); +tr.setInput('searchFolder', process.env[constants.searchFolder]); +tr.setInput('failTaskOnFailedTests', process.env[constants.failTaskOnFailedTests]); +tr.setInput('failTaskOnFailureToPublishResults', process.env[constants.failTaskOnFailureToPublishResults]); + +const PublishExeToolPath = path.join(__dirname, '../modules', 'TestResultsPublisher.exe'); +const newUuid = "1e1faf9e-d9e5-4054-b351-398ac75b62f5"; +const PublishExeArgs = ['@' + path.join(__dirname, newUuid + '.txt')]; + +// Construct the answers object +const a: ma.TaskLibAnswers = { + 'which': { + }, + 'checkPath': { + }, + 'exec': { + } +}; + +a.exec[`${PublishExeToolPath} ${PublishExeArgs[0]}`] = { + 'code': +process.env[constants.listPackagesReturnCode], + 'stdout': 'tool output', + 'stderr': '' +}; + +tr.setAnswers(a); + +// Mock toolrunner +tr.registerMock('azure-pipelines-task-lib/toolrunner', require('azure-pipelines-task-lib/mock-toolrunner')); + +// Mock guid generator +tr.registerMock('uuid', { + v1: function () { + return newUuid; + } +}); + +// Create mock for getVariable +const tl = require('azure-pipelines-task-lib/mock-task'); +const tlClone = Object.assign({}, tl); + +tlClone.getVariable = function (variable: string) { + return process.env[variable]; +}; + +tlClone.osType = function () { + return process.env[constants.osType]; +} + +tlClone.findMatch = function () { + let matchingFiles: string[] = ["n-files0.xml"]; + return matchingFiles; +} + +tlClone.getEndpointAuthorizationParameter = function () { + return 'ad4sldkajdsf4ksa5randomaccesstoken7lf9adsnfandfjlsdf'; +} +tr.registerMock('azure-pipelines-task-lib/mock-task', tlClone); + +// Start the run +tr.run(); \ No newline at end of file diff --git a/_generated/PublishTestResultsV2/Tests/package-lock.json b/_generated/PublishTestResultsV2/Tests/package-lock.json new file mode 100644 index 000000000000..79ce3da15a1d --- /dev/null +++ b/_generated/PublishTestResultsV2/Tests/package-lock.json @@ -0,0 +1,14 @@ +{ + "name": "vsts-tasks-publishtestresults", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/mocha": { + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz", + "integrity": "sha512-lAVp+Kj54ui/vLUFxsJTMtWvZraZxum3w3Nwkble2dNuV5VnPA+Mi2oGX9XYJAaIvZi3tn3cbjS/qcJXRb6Bww==", + "dev": true + } + } +} diff --git a/_generated/PublishTestResultsV2/Tests/package.json b/_generated/PublishTestResultsV2/Tests/package.json new file mode 100644 index 000000000000..7417b8e78d2b --- /dev/null +++ b/_generated/PublishTestResultsV2/Tests/package.json @@ -0,0 +1,22 @@ +{ + "name": "vsts-tasks-publishtestresults", + "version": "1.0.0", + "description": "Azure Pipelines Publish Test Results Task", + "main": "publishtestresults.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Microsoft/azure-pipelines-tasks.git" + }, + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Microsoft/azure-pipelines-tasks/issues" + }, + "homepage": "https://github.com/Microsoft/azure-pipelines-tasks#readme", + "devDependencies": { + "@types/mocha": "^5.2.0" + } +} diff --git a/_generated/PublishTestResultsV2/cieventlogger.ts b/_generated/PublishTestResultsV2/cieventlogger.ts new file mode 100644 index 000000000000..5d77ee165d3c --- /dev/null +++ b/_generated/PublishTestResultsV2/cieventlogger.ts @@ -0,0 +1,51 @@ +import * as tl from 'azure-pipelines-task-lib/task'; + +const area: string = 'TestExecution'; +const feature: string = 'PublishTestResultsTask'; +const consolidatedCiData: { [key: string]: any; } = <{ [key: string]: any; }>{}; + +function getDefaultProps() { + return { + releaseuri: tl.getVariable('Release.ReleaseUri'), + releaseid: tl.getVariable('Release.ReleaseId'), + builduri: tl.getVariable('Build.BuildUri'), + buildid: tl.getVariable('Build.Buildid'), + osType: tl.osType() + }; +} + +export function addToConsolidatedCi(key: string, value: any) { + consolidatedCiData[key] = value; +} + +export function fireConsolidatedCi() { + publishEvent('publishTestResultsTaskConsolidatedCiEvent', consolidatedCiData); +} + +export function publishEvent(subFeature: string, properties: { [key: string]: any }): void { + try { + properties.subFeature = subFeature; + _writeTelemetry(area, feature, Object.assign(getDefaultProps(), properties)); + } catch (err) { + tl.debug('Unable to publish telemetry due to lower agent version.'); + } +} + + +function _writeTelemetry(area, feature, properties) { + // The telemetry command was added in agent version 2.120.0. + try { + var splitVersion = (process.env.AGENT_VERSION || '').split('.'); + var major = parseInt(splitVersion[0] || '0'); + var minor = parseInt(splitVersion[1] || '0'); + if (major > 2 || (major == 2 && minor >= 120)) { + console.log(`##vso[telemetry.publish area=${area};feature=${feature}]${JSON.stringify(properties)}`); + } + else { + tl.debug(`cannot write telemetry in agent ${process.env.AGENT_VERSION}`); + } + } + catch (err) { + tl.debug(`Error in writing telemetry : ${err}`); + } +} diff --git a/_generated/PublishTestResultsV2/icon.png b/_generated/PublishTestResultsV2/icon.png new file mode 100644 index 000000000000..daf9bc579632 Binary files /dev/null and b/_generated/PublishTestResultsV2/icon.png differ diff --git a/_generated/PublishTestResultsV2/icon.svg b/_generated/PublishTestResultsV2/icon.svg new file mode 100644 index 000000000000..a28a126c7106 --- /dev/null +++ b/_generated/PublishTestResultsV2/icon.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/_generated/PublishTestResultsV2/make.json b/_generated/PublishTestResultsV2/make.json new file mode 100644 index 000000000000..8d4f6517cd31 --- /dev/null +++ b/_generated/PublishTestResultsV2/make.json @@ -0,0 +1,10 @@ +{ + "externals": { + "archivePackages": [ + { + "url": "https://publishtestresult.blob.core.windows.net/publishtestresult/25028726/PublishTestResults.zip", + "dest": "./" + } + ] + } +} diff --git a/_generated/PublishTestResultsV2/package-lock.json b/_generated/PublishTestResultsV2/package-lock.json new file mode 100644 index 000000000000..5688dbddaeb1 --- /dev/null +++ b/_generated/PublishTestResultsV2/package-lock.json @@ -0,0 +1,495 @@ +{ + "name": "vsts-tasks-publishtestresults", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/concat-stream": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.1.tgz", + "integrity": "sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==", + "requires": { + "@types/node": "*" + } + }, + "@types/form-data": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", + "integrity": "sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==", + "requires": { + "@types/node": "*" + } + }, + "@types/mocha": { + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", + "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==" + }, + "@types/node": { + "version": "16.18.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.6.tgz", + "integrity": "sha512-vmYJF0REqDyyU0gviezF/KHq/fYaUbFhkcNbQCuPGFQj6VTbXuHZoxs/Y7mutWe73C8AC6l9fFu8mSYiBAqkGA==" + }, + "@types/q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.1.tgz", + "integrity": "sha512-eqz8c/0kwNi/OEHQfvIuJVLTst3in0e7uTKeuY+WL/zfKn0xVujOTp42bS/vUUokhK5P2BppLd9JXMOMHcgbjA==" + }, + "@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "azure-pipelines-task-lib": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.1.0.tgz", + "integrity": "sha512-8CNC9PcP+4eS76QcIDmPmBfrrao9xpy/M0Uts4TWk3chfr3uOXFGf0DYHVTJGF9180g51kyVXYTObicouq0KZQ==", + "requires": { + "minimatch": "3.0.5", + "mockery": "^2.1.0", + "q": "^1.5.1", + "semver": "^5.1.0", + "shelljs": "^0.8.5", + "sync-request": "6.1.0", + "uuid": "^3.0.1" + }, + "dependencies": { + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + } + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" + }, + "form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-intrinsic": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", + "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + } + }, + "get-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==" + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "dependencies": { + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "http-basic": { + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-8.1.3.tgz", + "integrity": "sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==", + "requires": { + "caseless": "^0.12.0", + "concat-stream": "^1.6.2", + "http-response-object": "^3.0.1", + "parse-cache-control": "^1.0.1" + } + }, + "http-response-object": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz", + "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", + "requires": { + "@types/node": "^10.0.3" + }, + "dependencies": { + "@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + } + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" + }, + "is-core-module": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "requires": { + "has": "^1.0.3" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, + "minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "mockery": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mockery/-/mockery-2.1.0.tgz", + "integrity": "sha512-9VkOmxKlWXoDO/h1jDZaS4lH33aWfRiJiNT/tKj+8OGzrcFDLo8d0syGdbsc3Bc4GvRXPb+NMMvojotmuGJTvA==" + }, + "object-inspect": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "requires": { + "wrappy": "1" + } + }, + "parse-cache-control": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", + "integrity": "sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "promise": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", + "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", + "requires": { + "asap": "~2.0.6" + } + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==" + }, + "qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "requires": { + "side-channel": "^1.0.4" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "requires": { + "resolve": "^1.1.6" + } + }, + "resolve": { + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "requires": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "shelljs": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + }, + "sync-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.1.0.tgz", + "integrity": "sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw==", + "requires": { + "http-response-object": "^3.0.1", + "sync-rpc": "^1.2.1", + "then-request": "^6.0.0" + } + }, + "sync-rpc": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/sync-rpc/-/sync-rpc-1.3.6.tgz", + "integrity": "sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw==", + "requires": { + "get-port": "^3.1.0" + } + }, + "then-request": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/then-request/-/then-request-6.0.2.tgz", + "integrity": "sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA==", + "requires": { + "@types/concat-stream": "^1.6.0", + "@types/form-data": "0.0.33", + "@types/node": "^8.0.0", + "@types/qs": "^6.2.31", + "caseless": "~0.12.0", + "concat-stream": "^1.6.0", + "form-data": "^2.2.0", + "http-basic": "^8.1.1", + "http-response-object": "^3.0.1", + "promise": "^8.0.0", + "qs": "^6.4.0" + }, + "dependencies": { + "@types/node": { + "version": "8.10.66", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz", + "integrity": "sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==" + } + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + }, + "typescript": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", + "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + } + } +} diff --git a/_generated/PublishTestResultsV2/package.json b/_generated/PublishTestResultsV2/package.json new file mode 100644 index 000000000000..2803623310b1 --- /dev/null +++ b/_generated/PublishTestResultsV2/package.json @@ -0,0 +1,29 @@ +{ + "name": "vsts-tasks-publishtestresults", + "version": "1.0.0", + "description": "Azure Pipelines Publish Test Results Task", + "main": "publishtestresults.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Microsoft/azure-pipelines-tasks.git" + }, + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Microsoft/azure-pipelines-tasks/issues" + }, + "homepage": "https://github.com/Microsoft/azure-pipelines-tasks#readme", + "dependencies": { + "@types/mocha": "^5.2.7", + "@types/node": "^16.11.39", + "@types/q": "^1.5.0", + "azure-pipelines-task-lib": "^4.1.0", + "uuid": "^8.3.0" + }, + "devDependencies": { + "typescript": "4.0.2" + } +} diff --git a/_generated/PublishTestResultsV2/publishtestresults.ts b/_generated/PublishTestResultsV2/publishtestresults.ts new file mode 100644 index 000000000000..5e8de343c63b --- /dev/null +++ b/_generated/PublishTestResultsV2/publishtestresults.ts @@ -0,0 +1,228 @@ +import * as path from 'path'; +import * as fs from 'fs'; +import * as semver from "semver" +import * as publishTestResultsTool from './publishtestresultstool'; +import * as tl from 'azure-pipelines-task-lib/task'; +import * as tr from 'azure-pipelines-task-lib/toolrunner'; +import * as ci from './cieventlogger'; + +const MERGE_THRESHOLD = 100; +const TESTRUN_SYSTEM = 'VSTS - PTR'; + +function isNullOrWhitespace(input: any) { + if (typeof input === 'undefined' || input === null) { + return true; + } + return input.replace(/\s/g, '').length < 1; +} + +function publish(testRunner, resultFiles, mergeResults, failTaskOnFailedTests, platform, config, runTitle, publishRunAttachments, testRunSystem , failTaskOnFailureToPublishResults) { + var properties = <{ [key: string]: string }>{}; + properties['type'] = testRunner; + + if (mergeResults) { + properties['mergeResults'] = mergeResults; + } + if (platform) { + properties['platform'] = platform; + } + if (config) { + properties['config'] = config; + } + if (runTitle) { + properties['runTitle'] = runTitle; + } + if (publishRunAttachments) { + properties['publishRunAttachments'] = publishRunAttachments; + } + if (resultFiles) { + properties['resultFiles'] = resultFiles; + } + if(failTaskOnFailedTests){ + properties['failTaskOnFailedTests'] = failTaskOnFailedTests; + } + if(failTaskOnFailureToPublishResults){ + properties['failTaskOnFailureToPublishResults'] = failTaskOnFailureToPublishResults; + } + properties['testRunSystem'] = testRunSystem; + + tl.command('results.publish', properties, ''); +} + +function getDotNetVersion() { + let dotnet: tr.ToolRunner; + const dotnetPath = tl.which('dotnet', false); + + if (dotnetPath){ + try { + dotnet = tl.tool(dotnetPath); + dotnet.arg('--version'); + return dotnet.execSync().stdout.trim(); + } catch (err) {} + } + return ''; +} + +async function run() { + try { + tl.setResourcePath(path.join(__dirname, 'task.json')); + + const testRunner = tl.getInput('testRunner', true); + const testResultsFiles: string[] = tl.getDelimitedInput('testResultsFiles', '\n', true); + const mergeResults = tl.getInput('mergeTestResults'); + const platform = tl.getInput('platform'); + const config = tl.getInput('configuration'); + const testRunTitle = tl.getInput('testRunTitle'); + const publishRunAttachments = tl.getInput('publishRunAttachments'); + const failTaskOnFailedTests = tl.getInput('failTaskOnFailedTests'); + const failTaskOnMissingResultsFile: boolean = tl.getBoolInput('failTaskOnMissingResultsFile'); + const failTaskOnFailureToPublishResults = tl.getInput('failTaskOnFailureToPublishResults'); + let searchFolder = tl.getInput('searchFolder'); + + tl.debug('testRunner: ' + testRunner); + tl.debug('testResultsFiles: ' + testResultsFiles); + tl.debug('mergeResults: ' + mergeResults); + tl.debug('platform: ' + platform); + tl.debug('config: ' + config); + tl.debug('testRunTitle: ' + testRunTitle); + tl.debug('publishRunAttachments: ' + publishRunAttachments); + tl.debug('failTaskOnFailedTests: ' + failTaskOnFailedTests); + tl.debug('failTaskOnMissingResultsFile: ' + failTaskOnMissingResultsFile); + tl.debug('failTaskOnFailureToPublishResults: ' + failTaskOnFailureToPublishResults); + + if (isNullOrWhitespace(searchFolder)) { + searchFolder = tl.getVariable('System.DefaultWorkingDirectory'); + } + + if(tl.getVariable('System.DefaultWorkingDirectory') && (!path.isAbsolute(searchFolder))) + { + searchFolder = path.join(tl.getVariable('System.DefaultWorkingDirectory'),searchFolder); + } + // Sending allowBrokenSymbolicLinks as true, so we don't want to throw error when symlinks are broken. + // And can continue with other files if there are any. + const findOptions = { + allowBrokenSymbolicLinks: true, + followSpecifiedSymbolicLink: true, + followSymbolicLinks: true + }; + + const matchingTestResultsFiles = tl.findMatch(searchFolder, testResultsFiles, findOptions); + + const testResultsFilesCount = matchingTestResultsFiles ? matchingTestResultsFiles.length : 0; + + tl.debug(`Detected ${testResultsFilesCount} test result files`); + + ci.addToConsolidatedCi('testRunner', testRunner); + ci.addToConsolidatedCi('failTaskOnFailedTests', failTaskOnFailedTests); + ci.addToConsolidatedCi('mergeResultsUserPreference', mergeResults); + ci.addToConsolidatedCi('config', config); + ci.addToConsolidatedCi('platform', platform); + ci.addToConsolidatedCi('testResultsFilesCount', testResultsFilesCount); + ci.addToConsolidatedCi('failTaskOnMissingResultsFile', failTaskOnMissingResultsFile); + ci.addToConsolidatedCi('failTaskOnFailureToPublishResults', failTaskOnFailureToPublishResults); + + const dotnetVersion = getDotNetVersion(); + ci.addToConsolidatedCi('dotnetVersion', dotnetVersion); + + const forceMerge = testResultsFilesCount > MERGE_THRESHOLD; + if (forceMerge) { + tl.debug('Detected large number of test result files. Merged all of them into a single file and published a single test run to optimize for test result publish performance instead of publishing hundreds of test runs'); + } + + if (testResultsFilesCount === 0) { + if (failTaskOnMissingResultsFile) { + tl.setResult(tl.TaskResult.Failed, tl.loc('NoMatchingFilesFound', testResultsFiles)); + } else { + tl.warning(tl.loc('NoMatchingFilesFound', testResultsFiles)); + } + ci.addToConsolidatedCi('noResultsFileFound', true); + } else { + const osType = tl.osType(); + // This variable can be set as build variable to force the task to use command flow + const isExeFlowOverridden = tl.getVariable('PublishTestResults.OverrideExeFlow'); + + tl.debug('OS type: ' + osType); + + if (osType === 'Windows_NT' && isExeFlowOverridden != 'true') { + const testResultsPublisher = new publishTestResultsTool.TestResultsPublisher(matchingTestResultsFiles, + forceMerge ? true.toString() : mergeResults, + failTaskOnFailedTests, + platform, + config, + testRunTitle, + publishRunAttachments, + testRunner, + TESTRUN_SYSTEM, + failTaskOnFailureToPublishResults); + const exitCode = await testResultsPublisher.publishResultsThroughExe(); + tl.debug("Exit code of TestResultsPublisher: " + exitCode); + + if (exitCode === 20000) { + // The exe returns with exit code: 20000 if the Feature flag is off or if it fails to fetch the Feature flag value + publish(testRunner, matchingTestResultsFiles, + forceMerge ? true.toString() : mergeResults, + failTaskOnFailedTests, + platform, + config, + testRunTitle, + publishRunAttachments, + TESTRUN_SYSTEM, + failTaskOnFailureToPublishResults); + } else if (exitCode === 40000) { + // The exe returns with exit code: 40000 if there are test failures found and failTaskOnFailedTests is true + ci.addToConsolidatedCi('failedTestsInRun', true); + tl.setResult(tl.TaskResult.Failed, tl.loc('ErrorFailTaskOnFailedTests')); + } + + if (exitCode !== 20000) { + // Doing it only for test results published using TestResultPublisher tool. + // For other publishes, publishing to evidence store happens as part of results.publish command itself. + readAndPublishTestRunSummaryToEvidenceStore(testRunner); + } + } else { + publish(testRunner, matchingTestResultsFiles, + forceMerge ? true.toString() : mergeResults, + failTaskOnFailedTests, + platform, + config, + testRunTitle, + publishRunAttachments, + TESTRUN_SYSTEM, + failTaskOnFailureToPublishResults); + } + } + tl.setResult(tl.TaskResult.Succeeded, ''); + } catch (err) { + tl.setResult(tl.TaskResult.Failed, err); + } finally { + ci.fireConsolidatedCi(); + } +} + +function readAndPublishTestRunSummaryToEvidenceStore(testRunner: string) { + try { + const agentVersion = tl.getVariable('Agent.Version'); + if (semver.lt(agentVersion, "2.164.0")) { + throw "Required agent version greater than or equal to 2.164.0"; + } + + var tempPath = tl.getVariable('Agent.TempDirectory'); + var testRunSummaryPath = path.join(tempPath, "PTR_TEST_RUNSUMMARY.json"); + + var testRunSummary = fs.readFileSync(testRunSummaryPath, 'utf-8'); + + var properties = <{ [key: string]: string }>{}; + + properties['name'] = "PublishTestResults"; + properties['testrunner'] = testRunner; + properties['testrunsummary'] = testRunSummary; + properties['description'] = "Test Results published from Publish Test Results tool"; + + tl.command('results.publishtoevidencestore', properties, ''); + } catch (error) { + tl.debug(`Unable to publish the test run summary to evidencestore, error details:${error}`); + } + +} + +run(); diff --git a/_generated/PublishTestResultsV2/publishtestresultstool.ts b/_generated/PublishTestResultsV2/publishtestresultstool.ts new file mode 100644 index 000000000000..6f99637eb814 --- /dev/null +++ b/_generated/PublishTestResultsV2/publishtestresultstool.ts @@ -0,0 +1,157 @@ +import * as fs from 'fs'; +import * as os from 'os'; +import * as path from 'path'; +import * as tl from 'azure-pipelines-task-lib/task'; +import * as tr from 'azure-pipelines-task-lib/toolrunner'; +import { publishEvent } from './cieventlogger'; +import * as ci from './cieventlogger'; +let uuid = require('uuid'); + +export class TestResultsPublisher { + constructor(matchingTestResultsFiles: string[], mergeResults: string, failTaskOnFailedTests: string, platform: string, config: string, + testRunTitle: string, publishRunAttachments: string, testRunner: string, testRunSystem: string + ,failTaskOnFailureToPublishResults: string) { + + this.matchingTestResultsFiles = matchingTestResultsFiles.slice(0); + this.mergeResults = mergeResults; + this.failTaskOnFailedTests = failTaskOnFailedTests; + this.platform = platform; + this.config = config; + this.testRunTitle = testRunTitle; + this.publishRunAttachments = publishRunAttachments; + this.testRunner = testRunner; + this.testRunSystem = testRunSystem; + this.failTaskOnFailureToPublishResults = failTaskOnFailureToPublishResults; + } + + public async publishResultsThroughExe(): Promise { + const testResultsPublisherTool: tr.ToolRunner = tl.tool(this.getTestResultsPublisherLocation()); + const envVars: { [key: string]: string; } = this.getEnvironmentVariables(); + const args: string[] = this.getArguments(this.matchingTestResultsFiles); + if (testResultsPublisherTool == null || args == null) { + return 20000; + } + testResultsPublisherTool.arg(args); + + const exitCode: number = await testResultsPublisherTool.exec({ env: envVars, ignoreReturnCode: true }); + + return exitCode; + } + + private getTestResultsPublisherLocation(): string { + return path.join(__dirname, 'modules/TestResultsPublisher.exe'); + } + + private getArguments(matchingTestResultsFiles: string[]): string[] { + const responseFilePath = this.createResponseFile(matchingTestResultsFiles); + if (responseFilePath == null) { + return null; + } + + // Adding '@' because this is a response file argument + const args = ['@' + responseFilePath]; + + return args; + } + + private createResponseFile(matchingTestResultsFiles: string[]): string { + let responseFilePath: string = null; + try { + const agentTempDirectory = tl.getVariable('Agent.TempDirectory'); + // The response file is being created in agent temp directory so that it is automatically deleted after. + responseFilePath = path.join(agentTempDirectory, uuid.v1() + '.txt'); + + // Adding quotes around matching file names + matchingTestResultsFiles = this.modifyMatchingFileName(matchingTestResultsFiles); + + // Preparing File content + const fileContent: string = os.EOL + matchingTestResultsFiles.join(os.EOL); + + // Writing matching file names in the response file + fs.writeFileSync(responseFilePath, fileContent); + } catch (ex) { + // Log telemetry and return null path + ci.addToConsolidatedCi('exception', ex); + + tl.warning("Exception while writing to response file: " + ex); + return null; + } + + return responseFilePath; + } + + private modifyMatchingFileName(matchingTestResultsFiles: string[]): string[] { + for (let i = 0; i < this.matchingTestResultsFiles.length; i++) { + // We need to add quotes around the file name because the file name can contain spaces. + // The quotes will be handled by response file reader. + matchingTestResultsFiles[i] = '\"' + matchingTestResultsFiles[i] + '\"'; + } + + return matchingTestResultsFiles; + } + + private getEnvironmentVariables(): { [key: string]: string; } { + let envVars: { [key: string]: string; } = {}; + + envVars = this.addToProcessEnvVars(envVars, + 'collectionurl', + tl.getVariable('System.TeamFoundationCollectionUri')); + envVars = this.addToProcessEnvVars(envVars, + 'accesstoken', + tl.getEndpointAuthorizationParameter('SystemVssConnection', 'AccessToken', false)); + envVars = this.addToProcessEnvVars(envVars, 'testrunner', this.testRunner); + envVars = this.addToProcessEnvVars(envVars, 'mergeresults', this.mergeResults); + envVars = this.addToProcessEnvVars(envVars, 'failtaskonfailedtests', this.failTaskOnFailedTests); + envVars = this.addToProcessEnvVars(envVars, 'platform', this.platform); + envVars = this.addToProcessEnvVars(envVars, 'config', this.config); + envVars = this.addToProcessEnvVars(envVars, 'publishrunattachments', this.publishRunAttachments); + envVars = this.addToProcessEnvVars(envVars, 'testruntitle', this.testRunTitle); + envVars = this.addToProcessEnvVars(envVars, 'testrunsystem', this.testRunSystem); + envVars = this.addToProcessEnvVars(envVars, 'projectname', tl.getVariable('System.TeamProject')); + envVars = this.addToProcessEnvVars(envVars, 'pullrequesttargetbranch', tl.getVariable('System.PullRequest.TargetBranch')); + envVars = this.addToProcessEnvVars(envVars, 'owner', tl.getVariable('Build.RequestedFor')); + envVars = this.addToProcessEnvVars(envVars, 'buildid', tl.getVariable('Build.BuildId')); + envVars = this.addToProcessEnvVars(envVars, 'builduri', tl.getVariable('Build.BuildUri')); + envVars = this.addToProcessEnvVars(envVars, 'releaseuri', tl.getVariable('Release.ReleaseUri')); + envVars = this.addToProcessEnvVars(envVars, 'releaseenvironmenturi', tl.getVariable('Release.EnvironmentUri')); + envVars = this.addToProcessEnvVars(envVars, 'phasename', tl.getVariable('System.PhaseName')); + envVars = this.addToProcessEnvVars(envVars, 'phaseattempt', tl.getVariable('System.PhaseAttempt')); + envVars = this.addToProcessEnvVars(envVars, 'stagename', tl.getVariable('System.StageName')); + envVars = this.addToProcessEnvVars(envVars, 'stageattempt', tl.getVariable('System.StageAttempt')); + envVars = this.addToProcessEnvVars(envVars, 'jobname', tl.getVariable('System.JobName')); + envVars = this.addToProcessEnvVars(envVars, 'jobattempt', tl.getVariable('System.JobAttempt')); + envVars = this.addToProcessEnvVars(envVars, 'jobidentifier', tl.getVariable('System.JobIdentifier')); + envVars = this.addToProcessEnvVars(envVars, 'agenttempdirectory', tl.getVariable('Agent.TempDirectory')); + envVars = this.addToProcessEnvVars(envVars, 'failtaskonfailuretopublishresults', this.failTaskOnFailureToPublishResults); + // Setting proxy details + envVars = this.addToProcessEnvVars(envVars, "proxyurl", tl.getVariable('agent.proxyurl')); + envVars = this.addToProcessEnvVars(envVars, "proxyusername", tl.getVariable('agent.proxyusername')); + envVars = this.addToProcessEnvVars(envVars, "proxypassword", tl.getVariable('agent.proxypassword')); + envVars = this.addToProcessEnvVars(envVars, "proxybypasslist", tl.getVariable('agent.proxybypasslist')); + + return envVars; + } + + private addToProcessEnvVars(envVars: { [key: string]: string; }, name: string, value: string): { [key: string]: string; } { + if (!this.isNullEmptyOrUndefined(value)) { + envVars[name] = value; + } + + return envVars; + } + + private isNullEmptyOrUndefined(obj): boolean { + return obj === null || obj === '' || obj === undefined; + } + + private matchingTestResultsFiles: string[]; + private mergeResults: string; + private failTaskOnFailedTests: string; + private platform: string; + private config: string; + private testRunTitle: string; + private publishRunAttachments: string; + private testRunner: string; + private testRunSystem: string; + private failTaskOnFailureToPublishResults: string; +} diff --git a/_generated/PublishTestResultsV2/task.json b/_generated/PublishTestResultsV2/task.json new file mode 100644 index 000000000000..01325ac6838c --- /dev/null +++ b/_generated/PublishTestResultsV2/task.json @@ -0,0 +1,162 @@ +{ + "id": "0B0F01ED-7DDE-43FF-9CBB-E48954DAF9B1", + "name": "PublishTestResults", + "friendlyName": "Publish Test Results", + "description": "Publish test results to Azure Pipelines", + "helpUrl": "https://docs.microsoft.com/azure/devops/pipelines/tasks/test/publish-test-results", + "helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=613742)", + "category": "Test", + "visibility": [ + "Build", + "Release" + ], + "author": "Microsoft Corporation", + "version": { + "Major": 2, + "Minor": 233, + "Patch": 1 + }, + "demands": [], + "releaseNotes": "
  • NUnit3 support
  • Support for Minimatch files pattern
", + "minimumAgentVersion": "2.0.0", + "groups": [ + { + "name": "advanced", + "displayName": "Advanced", + "isExpanded": false + } + ], + "inputs": [ + { + "name": "testRunner", + "aliases": [ + "testResultsFormat" + ], + "type": "pickList", + "label": "Test result format", + "defaultValue": "JUnit", + "required": true, + "helpMarkDown": "Format of test result files generated by your choice of test runner e.g. JUnit, VSTest, XUnit V2, NUnit and CTest.", + "options": { + "JUnit": "JUnit", + "NUnit": "NUnit", + "VSTest": "VSTest", + "XUnit": "XUnit", + "CTest": "CTest" + } + }, + { + "name": "testResultsFiles", + "type": "multiLine", + "label": "Test results files", + "defaultValue": "**/TEST-*.xml", + "required": true, + "helpMarkDown": "Test results files path. Supports multiple lines of minimatch patterns. [More Information](https://go.microsoft.com/fwlink/?LinkId=835764)", + "properties": { + "rows": "3", + "resizable": "true" + } + }, + { + "name": "searchFolder", + "type": "string", + "label": "Search folder", + "defaultValue": "$(System.DefaultWorkingDirectory)", + "required": false, + "helpMarkDown": "Folder to search for the test result files. Defaults to $(System.DefaultWorkingDirectory)." + }, + { + "name": "mergeTestResults", + "type": "boolean", + "label": "Merge test results", + "defaultValue": "false", + "required": false, + "helpMarkDown": "A test run is created for each results file. Check this option to merge results into a single test run. To optimize for better performance, results will be merged into a single run if there are more than 100 result files, irrespective of this option." + }, + { + "name": "failTaskOnFailedTests", + "type": "boolean", + "label": "Fail if there are test failures", + "defaultValue": "false", + "required": false, + "helpMarkDown": "Fail the task if there are any test failures. Check this option to fail the task if test failures are detected in the result files." + }, + { + "name": "failTaskOnFailureToPublishResults", + "type": "boolean", + "label": "Fail if there is failure in publishing test results", + "defaultValue": false, + "required": false, + "helpMarkDown": "Fail if there is failure in publishing test results. Check this option to fail the task if publishing test results is failed partially." + }, + { + "name": "failTaskOnMissingResultsFile", + "type": "boolean", + "label": "Fail if no result files are found", + "defaultValue": false, + "required": false, + "helpMarkDown": "Fail the task if no result files are found." + }, + { + "name": "testRunTitle", + "type": "string", + "label": "Test run title", + "defaultValue": "", + "required": false, + "helpMarkDown": "Provide a name for the Test Run." + }, + { + "name": "platform", + "aliases": [ + "buildPlatform" + ], + "type": "string", + "label": "Build Platform", + "defaultValue": "", + "required": false, + "groupName": "advanced", + "helpMarkDown": "Platform for which the tests were run." + }, + { + "name": "configuration", + "aliases": [ + "buildConfiguration" + ], + "type": "string", + "label": "Build Configuration", + "defaultValue": "", + "required": false, + "groupName": "advanced", + "helpMarkDown": "Configuration for which the tests were run." + }, + { + "name": "publishRunAttachments", + "type": "boolean", + "label": "Upload test results files", + "defaultValue": "true", + "required": false, + "helpMarkDown": "Upload logs and other files containing diagnostic information collected when the tests were run.", + "groupName": "advanced" + } + ], + "instanceNameFormat": "Publish Test Results $(testResultsFiles)", + "execution": { + "Node10": { + "target": "publishtestresults.js", + "argumentFormat": "" + }, + "Node16": { + "target": "publishtestresults.js", + "argumentFormat": "" + } + }, + "messages": { + "NoMatchingFilesFound": "No test result files matching '%s' were found.", + "ErrorTestResultsPublisher": "Error while executing TestResultsPublisher: %s.", + "ErrorFailTaskOnFailedTests": "There are one or more test failures detected in result files. Detailed summary of published test results can be viewed in the Tests tab." + }, + "_buildConfigMapping": { + "Default": "2.233.1", + "Node20_229_13": "2.233.2" + } +} \ No newline at end of file diff --git a/_generated/PublishTestResultsV2/task.loc.json b/_generated/PublishTestResultsV2/task.loc.json new file mode 100644 index 000000000000..b780cb85be8e --- /dev/null +++ b/_generated/PublishTestResultsV2/task.loc.json @@ -0,0 +1,162 @@ +{ + "id": "0B0F01ED-7DDE-43FF-9CBB-E48954DAF9B1", + "name": "PublishTestResults", + "friendlyName": "ms-resource:loc.friendlyName", + "description": "ms-resource:loc.description", + "helpUrl": "https://docs.microsoft.com/azure/devops/pipelines/tasks/test/publish-test-results", + "helpMarkDown": "ms-resource:loc.helpMarkDown", + "category": "Test", + "visibility": [ + "Build", + "Release" + ], + "author": "Microsoft Corporation", + "version": { + "Major": 2, + "Minor": 233, + "Patch": 1 + }, + "demands": [], + "releaseNotes": "ms-resource:loc.releaseNotes", + "minimumAgentVersion": "2.0.0", + "groups": [ + { + "name": "advanced", + "displayName": "ms-resource:loc.group.displayName.advanced", + "isExpanded": false + } + ], + "inputs": [ + { + "name": "testRunner", + "aliases": [ + "testResultsFormat" + ], + "type": "pickList", + "label": "ms-resource:loc.input.label.testRunner", + "defaultValue": "JUnit", + "required": true, + "helpMarkDown": "ms-resource:loc.input.help.testRunner", + "options": { + "JUnit": "JUnit", + "NUnit": "NUnit", + "VSTest": "VSTest", + "XUnit": "XUnit", + "CTest": "CTest" + } + }, + { + "name": "testResultsFiles", + "type": "multiLine", + "label": "ms-resource:loc.input.label.testResultsFiles", + "defaultValue": "**/TEST-*.xml", + "required": true, + "helpMarkDown": "ms-resource:loc.input.help.testResultsFiles", + "properties": { + "rows": "3", + "resizable": "true" + } + }, + { + "name": "searchFolder", + "type": "string", + "label": "ms-resource:loc.input.label.searchFolder", + "defaultValue": "$(System.DefaultWorkingDirectory)", + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.searchFolder" + }, + { + "name": "mergeTestResults", + "type": "boolean", + "label": "ms-resource:loc.input.label.mergeTestResults", + "defaultValue": "false", + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.mergeTestResults" + }, + { + "name": "failTaskOnFailedTests", + "type": "boolean", + "label": "ms-resource:loc.input.label.failTaskOnFailedTests", + "defaultValue": "false", + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.failTaskOnFailedTests" + }, + { + "name": "failTaskOnFailureToPublishResults", + "type": "boolean", + "label": "ms-resource:loc.input.label.failTaskOnFailureToPublishResults", + "defaultValue": false, + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.failTaskOnFailureToPublishResults" + }, + { + "name": "failTaskOnMissingResultsFile", + "type": "boolean", + "label": "ms-resource:loc.input.label.failTaskOnMissingResultsFile", + "defaultValue": false, + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.failTaskOnMissingResultsFile" + }, + { + "name": "testRunTitle", + "type": "string", + "label": "ms-resource:loc.input.label.testRunTitle", + "defaultValue": "", + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.testRunTitle" + }, + { + "name": "platform", + "aliases": [ + "buildPlatform" + ], + "type": "string", + "label": "ms-resource:loc.input.label.platform", + "defaultValue": "", + "required": false, + "groupName": "advanced", + "helpMarkDown": "ms-resource:loc.input.help.platform" + }, + { + "name": "configuration", + "aliases": [ + "buildConfiguration" + ], + "type": "string", + "label": "ms-resource:loc.input.label.configuration", + "defaultValue": "", + "required": false, + "groupName": "advanced", + "helpMarkDown": "ms-resource:loc.input.help.configuration" + }, + { + "name": "publishRunAttachments", + "type": "boolean", + "label": "ms-resource:loc.input.label.publishRunAttachments", + "defaultValue": "true", + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.publishRunAttachments", + "groupName": "advanced" + } + ], + "instanceNameFormat": "ms-resource:loc.instanceNameFormat", + "execution": { + "Node10": { + "target": "publishtestresults.js", + "argumentFormat": "" + }, + "Node16": { + "target": "publishtestresults.js", + "argumentFormat": "" + } + }, + "messages": { + "NoMatchingFilesFound": "ms-resource:loc.messages.NoMatchingFilesFound", + "ErrorTestResultsPublisher": "ms-resource:loc.messages.ErrorTestResultsPublisher", + "ErrorFailTaskOnFailedTests": "ms-resource:loc.messages.ErrorFailTaskOnFailedTests" + }, + "_buildConfigMapping": { + "Default": "2.233.1", + "Node20_229_13": "2.233.2" + } +} \ No newline at end of file diff --git a/_generated/PublishTestResultsV2/tsconfig.json b/_generated/PublishTestResultsV2/tsconfig.json new file mode 100644 index 000000000000..0438b79f69ac --- /dev/null +++ b/_generated/PublishTestResultsV2/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "target": "ES6", + "module": "commonjs" + } +} \ No newline at end of file diff --git a/_generated/PublishTestResultsV2_Node20/make.json b/_generated/PublishTestResultsV2_Node20/make.json index 67c28fd1e3c3..8d4f6517cd31 100644 --- a/_generated/PublishTestResultsV2_Node20/make.json +++ b/_generated/PublishTestResultsV2_Node20/make.json @@ -2,7 +2,7 @@ "externals": { "archivePackages": [ { - "url": "https://publishtestresult.blob.core.windows.net/publishtestresult/22540424/PublishTestResults.zip", + "url": "https://publishtestresult.blob.core.windows.net/publishtestresult/25028726/PublishTestResults.zip", "dest": "./" } ] diff --git a/_generated/PublishTestResultsV2_Node20/task.json b/_generated/PublishTestResultsV2_Node20/task.json index 23fa4e4ea80c..31b720f3ad8a 100644 --- a/_generated/PublishTestResultsV2_Node20/task.json +++ b/_generated/PublishTestResultsV2_Node20/task.json @@ -14,7 +14,7 @@ "version": { "Major": 2, "Minor": 233, - "Patch": 1 + "Patch": 2 }, "demands": [], "releaseNotes": "
  • NUnit3 support
  • Support for Minimatch files pattern
", @@ -160,7 +160,7 @@ "ErrorFailTaskOnFailedTests": "There are one or more test failures detected in result files. Detailed summary of published test results can be viewed in the Tests tab." }, "_buildConfigMapping": { - "Default": "2.233.0", - "Node20_229_13": "2.233.1" + "Default": "2.233.1", + "Node20_229_13": "2.233.2" } } \ No newline at end of file diff --git a/_generated/PublishTestResultsV2_Node20/task.loc.json b/_generated/PublishTestResultsV2_Node20/task.loc.json index 54aa81446edd..4349d92aebc3 100644 --- a/_generated/PublishTestResultsV2_Node20/task.loc.json +++ b/_generated/PublishTestResultsV2_Node20/task.loc.json @@ -14,7 +14,7 @@ "version": { "Major": 2, "Minor": 233, - "Patch": 1 + "Patch": 2 }, "demands": [], "releaseNotes": "ms-resource:loc.releaseNotes", @@ -160,7 +160,7 @@ "ErrorFailTaskOnFailedTests": "ms-resource:loc.messages.ErrorFailTaskOnFailedTests" }, "_buildConfigMapping": { - "Default": "2.233.0", - "Node20_229_13": "2.233.1" + "Default": "2.233.1", + "Node20_229_13": "2.233.2" } } \ No newline at end of file