Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jenkins 从詹金斯的另一份工作中获得测试结果_Jenkins_Jenkins Pipeline - Fatal编程技术网

Jenkins 从詹金斯的另一份工作中获得测试结果

Jenkins 从詹金斯的另一份工作中获得测试结果,jenkins,jenkins-pipeline,Jenkins,Jenkins Pipeline,我有一个詹金斯管道a,看起来像这样 运行预构建测试 建设项目 运行生成后测试 使用从当前生成中提取的参数运行另一个管道B 我想知道是否有一种方法可以从管道B获得测试结果,并将它们与管道a的测试结果聚合在一起。 目前,我必须打开控制台输出并打开外部构建的Url 如果以上不可能,是否可以在控制台以外的其他地方显示此Url(例如,作为工件)。我相信您正在寻找的是“隐藏”。下面是直接从 概要 这是一个简单的演示,演示了如何取消到与根目录不同的目录,以便确保不覆盖目录或文件等 基本上,您可以将您的工件

我有一个詹金斯管道a,看起来像这样

  • 运行预构建测试
  • 建设项目
  • 运行生成后测试
  • 使用从当前生成中提取的参数运行另一个管道B
我想知道是否有一种方法可以从管道B获得测试结果,并将它们与管道a的测试结果聚合在一起。 目前,我必须打开控制台输出并打开外部构建的Url


如果以上不可能,是否可以在控制台以外的其他地方显示此Url(例如,作为工件)。

我相信您正在寻找的是“隐藏”。下面是直接从

概要 这是一个简单的演示,演示了如何取消到与根目录不同的目录,以便确保不覆盖目录或文件等


基本上,您可以将您的工件(例如,运行单元测试产生的.xml文件)从第一个作业复制到运行第二个作业的节点。然后让单元测试处理器在第一个和第二个作业的结果上运行。

您可以将输出写入文件,否则您的结果可能会被覆盖
// First we'll generate a text file in a subdirectory on one node and stash it.
stage "first step on first node"

// Run on a node with the "first-node" label.
node('first-node') {
    // Make the output directory.
    sh "mkdir -p output"

    // Write a text file there.
    writeFile file: "output/somefile", text: "Hey look, some text."

    // Stash that directory and file.
    // Note that the includes could be "output/", "output/*" as below, or even
    // "output/**/*" - it all works out basically the same.
    stash name: "first-stash", includes: "output/*"
}

// Next, we'll make a new directory on a second node, and unstash the original
// into that new directory, rather than into the root of the build.
stage "second step on second node"

// Run on a node with the "second-node" label.
node('second-node') {
    // Run the unstash from within that directory!
    dir("first-stash") {
        unstash "first-stash"
    }

    // Look, no output directory under the root!
    // pwd() outputs the current directory Pipeline is running in.
    sh "ls -la ${pwd()}"

    // And look, output directory is there under first-stash!
    sh "ls -la ${pwd()}/first-stash"
}