Xunit dotnet测试并行线程量

发布于 2025-02-06 10:34:02 字数 232 浏览 3 评论 0原文

时,如何指定线程数量

在使用dotnet test xunit 2.4.1 Xunit.runner.VisualStudio 2.4.5 NetCoreApp 3.1

问题:我有一个使用DotNet测试运行测试的作业,并且我的性能能力不同。例如,一台计算机可以处理10个线程,而另一个只能处理6个。现在,Xunit.runner.json文件中指定的线程量。我可以从控制台指定线程数量吗?还是可以指定要使用的配置文件?

How can I specify amount of threads while using dotnet test

Xunit 2.4.1
Xunit.runner.visualstudio 2.4.5
netcoreapp 3.1

The issue: I have a Job that is running tests using dotnet test and I have different agent with different performance capacity. For example One machine can handle 10 threads and the other only 6. Now the amount of threads specified in xunit.runner.json file. Could I specify amount of threads from the console? or can I specify the config file to use?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独行侠 2025-02-13 10:34:02

根据 xunit docs ,您应该参考xunit.runner.json.json.json /code>在您的csproj文件中:

<ItemGroup>
  <Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

这样做的情况应在所有情况下(CLI,UI等)拾取配置文件。

According to the xUnit docs, you should reference xunit.runner.json within your csproj file like this:

<ItemGroup>
  <Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

Doing so should pick up the config file in all cases (CLI, UI, etc.).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文