Не удалось найти тестовый регистратор с AssemblyQualifiedName, URI или FriendlyName '' trx ' - PullRequest
0 голосов
/ 29 января 2020

У меня проблема с задачей тестирования конвейера DevOps Azure, где я пытаюсь сгенерировать файл. xml из Code Coverage Cobertura с помощью регистратора trx .

Сгенерирована следующая ошибка: Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName ''trx'..

Команда, которую я пытаюсь запустить внутри конвейера Azure DevOps, (скрытие имени проекта по соображениям безопасности заменено на: Мышь): "C:\Program Files\dotnet\dotnet.exe" test d:\a\1\s\src\Mouse.Tests\Mouse.Tests.csproj --logger 'trx;LogFileName=coverage.cobertura.xml' --results-directory d:\a\_temp /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura.

Я занимаюсь загрузкой регистратора xUnit, так как я делал тесты в xUnit Framework.

Однако я не понимаю, почему эта команда не работает в Azure конвейере DevOps ...

Раздел YAML:

- task: DotNetCoreCLI@2
  displayName: Run Tests
  inputs:
    command: custom
    custom: test
    arguments: $(Build.SourcesDirectory)\src\Mouse.Tests\Mouse.Tests.csproj --logger 'trx;LogFileName=coverage.cobertura.xml' --results-directory $(Agent.TempDirectory) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura

Файл необработанного журнала:

2020-01-29T18:26:25.2598092Z ##[section]Starting: Run Tests
2020-01-29T18:26:25.2731938Z ==============================================================================
2020-01-29T18:26:25.2731988Z Task         : .NET Core
2020-01-29T18:26:25.2732016Z Description  : Build, test, package, or publish a dotnet application, or run a custom dotnet command
2020-01-29T18:26:25.2732058Z Version      : 2.164.0
2020-01-29T18:26:25.2732104Z Author       : Microsoft Corporation
2020-01-29T18:26:25.2732132Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
2020-01-29T18:26:25.2732159Z ==============================================================================
2020-01-29T18:26:25.8444463Z [command]C:\windows\system32\chcp.com 65001
2020-01-29T18:26:25.8533851Z Active code page: 65001
2020-01-29T18:26:25.8670597Z [command]"C:\Program Files\dotnet\dotnet.exe" test d:\a\1\s\src\Mouse.Tests\Mouse.Tests.csproj --logger 'trx;LogFileName=coverage.cobertura.xml' --results-directory d:\a\_temp /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
2020-01-29T18:26:31.0179982Z 
2020-01-29T18:26:31.1091798Z Welcome to .NET Core 3.1!
2020-01-29T18:26:31.1092168Z ---------------------
2020-01-29T18:26:31.1092336Z SDK Version: 3.1.101
2020-01-29T18:26:31.1092450Z 
2020-01-29T18:26:31.1092645Z Telemetry
2020-01-29T18:26:31.1092791Z ---------
2020-01-29T18:26:31.1093287Z The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
2020-01-29T18:26:31.1093554Z 
2020-01-29T18:26:31.1093755Z Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
2020-01-29T18:26:31.1093858Z 
2020-01-29T18:26:31.1093970Z ----------------
2020-01-29T18:26:31.1094108Z Explore documentation: https://aka.ms/dotnet-docs
2020-01-29T18:26:31.1094382Z Report issues and find source on GitHub: https://github.com/dotnet/core
2020-01-29T18:26:31.1094484Z Find out what's new: https://aka.ms/dotnet-whats-new
2020-01-29T18:26:31.1094552Z Learn about the installed HTTPS developer cert: https://aka.ms/aspnet-core-https
2020-01-29T18:26:31.1094584Z Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs
2020-01-29T18:26:31.1095022Z Write your first app: https://aka.ms/first-net-core-app
2020-01-29T18:26:31.1095076Z --------------------------------------------------------------------------------------
2020-01-29T18:26:43.0935889Z Test run for d:\a\1\s\src\Mouse.Tests\bin\Debug\netcoreapp3.1\Mouse.Tests.dll(.NETCoreApp,Version=v3.1)
2020-01-29T18:26:43.4592444Z Microsoft (R) Test Execution Command Line Tool Version 16.3.0
2020-01-29T18:26:43.4592843Z Copyright (c) Microsoft Corporation.  All rights reserved.
2020-01-29T18:26:43.4593019Z 
2020-01-29T18:26:43.9392318Z Starting test execution, please wait...
2020-01-29T18:26:44.0028395Z Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName ''trx'.
2020-01-29T18:26:44.0527365Z ##[error]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1
2020-01-29T18:26:44.0539503Z Info: Azure Pipelines hosted agents have been updated to contain .Net Core 3.x SDK/Runtime along with 2.2 & 2.1. Unless you have locked down a SDK version for your project(s), 3.x SDK might be picked up which might have breaking behavior as compared to previous versions. 
2020-01-29T18:26:44.0539612Z Some commonly encountered changes are: 
2020-01-29T18:26:44.0539670Z If you're using `Publish` command with -o or --Output argument, you will see that the output folder is now being created at root directory rather than Project File's directory. To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
2020-01-29T18:26:44.0539944Z ##[error]Dotnet command failed with non-zero exit code on the following projects : 
2020-01-29T18:26:44.0557864Z ##[section]Finishing: Run Tests
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...