Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 scalatest maven 插件,我想与单元测试分开运行集成测试。测试路径是 src/it 和 src/test 分别用于集成测试和单元测试。
实现这一目标的最佳方法是什么?
谢谢
一种选择是创建一个对象,然后在每个测试中将其用作标签:
object IntegrationTag extends Tag("Integration-Test") test("Test for correct number of records", IntegrationTag) { // some stuff }
然后,如果您想测试单元测试,只需运行以下命令:
mvn test -DtagsToExclude=Integration-Test
这是一个可能的解决方案……肯定会更多。