gpt4 book ai didi

azure - 如何在azure Release管道中使用Linux代理运行vstest?

转载 作者:行者123 更新时间:2023-12-02 23:23:35 26 4
gpt4 key购买 nike

问题陈述:我有用 .NetCore 编写的 Specflow 测试,并用于在基于 Windows 的代理上运行。现在我需要在 Linux 代理中运行这些测试。

我已经使用构建管道和基于 Windows 的代理来构建工件。然后在发布管道中我添加了 vstest 任务和 Ubuntu 代理,如下所示

代理池 Azure Pipelines

代理规范: Ubuntu 20.04

当我运行管道时,vstest 任务给出如下错误

此任务仅在 Windows 代理上受支持,无法在其他平台上使用

如何解决这个问题?

最佳答案

有一种解决方法可以实现这一目标。

添加 dotnet test 任务并将命令更改为“自定义”,而不是将测试和自定义命令更改为“vstest”。配置如下所示

steps:
- task: DotNetCoreCLI@2
displayName: 'dotnet custom'
inputs:
command: custom
projects: '**/Tests.dll'
custom: vstest
arguments: '--logger:trx;logfilename=TEST.xml'
timeoutInMinutes: 120

关于azure - 如何在azure Release管道中使用Linux代理运行vstest?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69316052/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com