Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-7976

Aggregate downstream test results does not work for Matrix projects

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core, matrix-project-plugin
    • None
    • Windows 7, Java 1.6.0_22, Hudson 1.383, xunit 1.11, copyartifact 1.10

      • create matrix projectA
      • add axis named x, values: a b
      • add build step that touches a file file.txt
      • archive file.txt as artifact, and fingerprint it
      • select to aggregate downstream test results
      • duplicate projectA, name it projectB
      • add build step to copy artifact file.txt from projectA/x=$x
      • fingerprint file.txt
      • seletc to publish testing tools report, do not fail build if tests not updated
      • build projectB once to create workspace, put a testresult xml in each
      • add post-build step to projectA 'build other projects' and select projectB
      • build projectA

      Test results from B do no make it into A:

      • status page of projectA, configuration a shows 'Latest Test Result (no tests)'
      • latest build page of projectA, configuration a shows 'Aggregated Test Result (no tests)'

      Following the same procedure, but for a normal project gives all the exepcted results though.

      (attached a zip with project config/workspaces that should be ready to try)

          [JENKINS-7976] Aggregate downstream test results does not work for Matrix projects

          apostasia created issue -

          apostasia added a comment -

          also, don't know if this is related: when viewing a build for projectA (with normal projects setup as above), there is an item 'Downstream Builds' which shows the corresponding build in projectB. As far as I know this this is based on fingerprinting (it's not there if no valid fingerprints available, in which case aggregated test results are absent as well)
          However when viewing the a build for projectA/x=a there is no such item, wouldn't one expect this? Hudson knows B is a downstream project of A, and it has fingerprints to track the relation between builds. Or is does B being downstream of A not create any relationship between projectA/x=a and projectB/x=a? Is this not yet implemented, never to be implemented or a bug?

          apostasia added a comment - also, don't know if this is related: when viewing a build for projectA (with normal projects setup as above), there is an item 'Downstream Builds' which shows the corresponding build in projectB. As far as I know this this is based on fingerprinting (it's not there if no valid fingerprints available, in which case aggregated test results are absent as well) However when viewing the a build for projectA/x=a there is no such item, wouldn't one expect this? Hudson knows B is a downstream project of A, and it has fingerprints to track the relation between builds. Or is does B being downstream of A not create any relationship between projectA/x=a and projectB/x=a? Is this not yet implemented, never to be implemented or a bug?
          kutzi made changes -
          Link New: This issue is duplicated by JENKINS-5847 [ JENKINS-5847 ]
          Andrew Bayer made changes -
          Assignee New: Andrew Bayer [ abayer ]

          Andrew Bayer added a comment -

          I'm still digging at this, but the core problem is that the logic in the upstream build that looks for possible downstream builds will see that Matrix Job A is downstream of the upstream project, but won't know anything about the matrix runs underneath Matrix Job A, which is where the actual fingerprinting would be. So as a result, the upstream build doesn't have anything to add.

          You can workaround this by explicitly specifying the jobs to aggregate, rather than relying on the downstream builds logic, and specifying the matrix axes (in quotes) explicitly - i.e., NonMatrixJob,"MatrixJob/label=l_centos5_x86" - the quotes in case of commas in your axis.

          Andrew Bayer added a comment - I'm still digging at this, but the core problem is that the logic in the upstream build that looks for possible downstream builds will see that Matrix Job A is downstream of the upstream project, but won't know anything about the matrix runs underneath Matrix Job A, which is where the actual fingerprinting would be. So as a result, the upstream build doesn't have anything to add. You can workaround this by explicitly specifying the jobs to aggregate, rather than relying on the downstream builds logic, and specifying the matrix axes (in quotes) explicitly - i.e., NonMatrixJob,"MatrixJob/label=l_centos5_x86" - the quotes in case of commas in your axis.

          Frode Carlsen added a comment -

          Any update on when this will be fixed?
          Also, will the solution work for matrix builds that run across multiple slaves?

          Frode Carlsen added a comment - Any update on when this will be fixed? Also, will the solution work for matrix builds that run across multiple slaves?

          nick tulett added a comment -

          I need to be able to report totals for run/failed tests in a matrix with multiple slaves and use the following URL:

          http://<JENKINS_HOST>/job/<JOB_NAME>/api/json?depth=2&tree=downstreamProjects[builds[actions[causes[upstreamBuild],failCount,totalCount]]]

          I then loop over the JSON and aggregate by upstreamBuild. It's not ideal but at least gives me some numbers to play with.

          nick tulett added a comment - I need to be able to report totals for run/failed tests in a matrix with multiple slaves and use the following URL: http://<JENKINS_HOST>/job/<JOB_NAME>/api/json?depth=2&tree=downstreamProjects[builds[actions[causes [upstreamBuild] ,failCount,totalCount]]] I then loop over the JSON and aggregate by upstreamBuild. It's not ideal but at least gives me some numbers to play with.

          It seems that matrix job don't aggregate test results at all from each axis. There is an issue with getting test results from axis? Could you please look into this deeper? The best example here are tests executed as one of axis and dasboard-view-plugin with Test Results Grid always displays 0 for matrix builds with tests.

          Ireneusz Makowski added a comment - It seems that matrix job don't aggregate test results at all from each axis. There is an issue with getting test results from axis? Could you please look into this deeper? The best example here are tests executed as one of axis and dasboard-view-plugin with Test Results Grid always displays 0 for matrix builds with tests.

          evernat added a comment -

          Is this highly voted issue reproduced with a recent Jenkins version?
          If yes, is someone wanting to care about it?

          evernat added a comment - Is this highly voted issue reproduced with a recent Jenkins version? If yes, is someone wanting to care about it?

          I still have it. +1 for the fix

          Ireneusz Makowski added a comment - I still have it. +1 for the fix

            Unassigned Unassigned
            apostasia apostasia
            Votes:
            48 Vote for this issue
            Watchers:
            48 Start watching this issue

              Created:
              Updated: