如何关闭多项目构建的并行执行测试? [英] How to turn off parallel execution of tests for multi-project builds?

查看:21
本文介绍了如何关闭多项目构建的并行执行测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多项目构建,其中包含子项目和父项目中的测试.构建被聚合,以便父项目运行子项目中的所有测试.

I have a multi-project build with tests in sub-projects and in a parent project. The build is aggregated so that the parent project runs all tests in child projects.

我对其进行了配置,以便在子项目和父项目中都没有并行执行测试,通过

I configured it so that there's no parallel execution of tests in both the sub-projects and the parent project, via

parallelExecution in Test := false

但是,我有一种烦人的感觉,即跨多个项目的测试是并行运行的.对于其中一个子项目,这是一个问题,因为它同时改变了测试数据库中的状态,导致测试失败.

However, I have the nagging feeling that tests that span over multiple projects are ran in parallel. In the case of one of the sub-projects this is a problem because it mutates state in a test database concurrently, leading to the test to fail.

关于如何在项目之间全局切换并行执行测试有什么想法吗?

Any ideas as to how to globally switch of parallel execution of tests, between projects?

推荐答案

我认为您可以使用范围 ThisBuild 跨项目应用设置,例如

I think you can apply a setting across projects using scope ThisBuild, like

parallelExecution in ThisBuild := false

我不知道你是否可以将它与范围 Test 结合,但可能没有必要.

I don't know if you can combine that with scope Test, but it might not be necessary.

这篇关于如何关闭多项目构建的并行执行测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆