繁体   English   中英

我可以在詹金斯的并行测试执行器中使用鼻子测试吗?

[英]Can I use nosetests with the Parallel Test Executor in Jenkins?

我试图弄清楚是否有可能在Jenkins中使用鼻子测试使用Parallel Test Executor插件。 我正在使用Jenkins管道,并在演示之后运行此命令:

def splits = splitTests parallelism: [$class: 'CountDrivenParallelism', size: 2], generateInclusions: true
def branches = [:]
for (int i = 0; i < splits.size(); i++) {
    def num = i
    def split = splits[num]
    branches["split${num}"] = {
      stage("Test Section #${num + 1}") {
        node() {
          stage('Preparation') {
            writeFile file: "parallel-test-includes-${i}.txt", text: split.list.join("\n")
          }
        }
      }
    }
}
parallel branches

结果文件包含如下所示的测试:

path/to/file(without .py)/<class name>.java
path/to/file(without .py)/<class name>.class

是否可以使用此输出在鼻子测试中包括/排除测试? 我在nosetests --help中看不到有任何选择可以做到这一点-帮助

您可以使用鼻子排除插件并将文件传递给鼻子。

另外,您还需要split.collect { it.replaceAll(/(.*)\\/(.*).(java|class)/, '$1.$2')} ,并使用Set来避免重复。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM