本文介绍了使用Visual Studio测试任务并行运行测试失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正尝试使用Visual Studio测试任务基于以下链接并行运行测试,但由于未找到软件包目录,我们注意到运行单元测试"步骤失败.尝试联系Azure DevOps团队以在此处获得一些帮助.

We are trying to Run tests in parallel using the Visual Studio Test task based on below link but we noticed "Run Unit tests" step failing due to packages directory was not found. Trying to contact Azure DevOps team to get some help here.

https://docs.microsoft.com/zh-CN/azure/devops/pipelines/test/parallel-testing-vstest?view = azure-devops

推荐答案

我们试图将测试文件作为第一份工作中的工件发布.并将测试工件下载到第二份工作.但是我们发现测试文件是分开放置的,也有很多测试数据文件也需要发布.很难将所有测试文件发布到天蓝色的devops服务器.vstest任务失败,可能是未找到程序集错误或某些测试用例都失败了.

We tried to publish the test files as artifacts from the first job. And download the test artifacts to the second job. But we found the test files were located separately and there were many test data files needed to be published too. It was hard to publish all the test files to azure devops sever. And the vstest task failed with either assemblies not found error or some testcases just failed.

我们还尝试配置与构建任务和vstest任务并行运行的单个作业.事实证明,发布构建工件任务在并行作业中无法正常工作.

We also tried configuring a single job running in parallel with both build tasks and vstest task. It turned out the publish build artifacts task didnot work properly in parallel jobs.

许多次后,尝试与@NAGAJU一起工作.我们发现的解决方法是配置两个代理作业,以将发布工件任务和Vstest任务分开.

After many times try and working together with @NAGAJU. The workaround we found is to configure two agent jobs to separate the publish artifacts task and Vstest task.

具有构建任务和发布工件任务的第一个代理作业在单个代理中运行.第二项工作是构建任务和Vstest任务,以在多个代理中并行运行测试.

The first agent job with build tasks and publish artifacts tasks runs in an single agent. The second job with build tasks and Vstest task to run the tests in multiple agents in parallel.

这篇关于使用Visual Studio测试任务并行运行测试失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 07:26