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

ProjectActions (and trend graphs) do not appear for failed projects

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • Jenkins LTS 1.596.2 / Linux

      Since junit-1.2, neither the "Latest Test Result" information nor the "Test Result Trend" plot appear on the project page _if there is not at least one build in non-failed state.

      See screenshots below for an example: after deleting unstable build #11, the abovementioned items disappear.

      The problem did not exist when the plugin was still included in Jenkins (1.576), nor does it exist in versions 1.0 and 1.1 of the plugin. I suspect that this behaviour was introduced with commit 4ba5a49 ("JENKINS-23713 Compatibility with SimpleBuildStep."), but unfortunately I cannot find the exact root cause within that commit.

      This problem is not only related to the JUnit plug-in. In general, every plug-in that has been migrated its actions to a SimpleBuildStep has this problem. The affected source code is in SimpleBuildStep.

      A test case that exposes this bug is WarningsPluginTest#should_not_skip_failed_builds_with_option_run_always

      See also the corresponding mailing list discussion.

        1. patch.txt
          3 kB
        2. withOutTrend.png
          withOutTrend.png
          60 kB
        3. withTrend.png
          withTrend.png
          81 kB

          [JENKINS-28479] ProjectActions (and trend graphs) do not appear for failed projects

          Alexander Ost created issue -

          Alexander Ost added a comment -

          patch for junit-1.6 that works around the issue

          Alexander Ost added a comment - patch for junit-1.6 that works around the issue
          Alexander Ost made changes -
          Attachment New: patch.txt [ 29837 ]

          Alexander Ost added a comment -

          The issue is really caused by the SimpleBuildStep migration. The description of the "SimpleBuildStep.LastBuildAction" interface states

          Marker for explicitly added build actions (as Run.addAction(hudson.model.Action)) which should imply a transient project action (Actionable.getActions()) when present on the Job.getLastSuccessfulBuild().

          As getProjectActions() was moved from class JUnitResultArchiver to that interface, the project actions will never become active for jobs that do not contain at least one successful build.

          The attached patch.txt (for junit-1.6) moves getProjectActions() back to class JUnitResultArchiver, and this fixes the issue. I am not aware of the side-effects of this change, though. Plugin tests are passing as before, but we're not using all features of the plugin.

          Please, kindly review.

          Alexander Ost added a comment - The issue is really caused by the SimpleBuildStep migration. The description of the "SimpleBuildStep.LastBuildAction" interface states Marker for explicitly added build actions (as Run.addAction(hudson.model.Action)) which should imply a transient project action (Actionable.getActions()) when present on the Job.getLastSuccessfulBuild (). As getProjectActions() was moved from class JUnitResultArchiver to that interface, the project actions will never become active for jobs that do not contain at least one successful build. The attached patch.txt (for junit-1.6) moves getProjectActions() back to class JUnitResultArchiver, and this fixes the issue. I am not aware of the side-effects of this change, though. Plugin tests are passing as before, but we're not using all features of the plugin. Please, kindly review.

          Daniel Beck added a comment -

          arost Please consider submitting the patch as pull request on Gtihub. This is the usual way to suggest specific code changes in Jenkins or plugins.

          Daniel Beck added a comment - arost Please consider submitting the patch as pull request on Gtihub. This is the usual way to suggest specific code changes in Jenkins or plugins.

          Jesse Glick added a comment -

          I am not sure offhand what the problem is—would need a real diagnosis. The attached patch is certainly incorrect.

          Jesse Glick added a comment - I am not sure offhand what the problem is—would need a real diagnosis. The attached patch is certainly incorrect.
          Jesse Glick made changes -
          Link New: This issue is blocking JENKINS-23713 [ JENKINS-23713 ]
          Jesse Glick made changes -
          Labels New: regression

          Jesse Glick added a comment -

          Suspect there is nothing to be done here—behaving as designed. If there are no successful builds, there are no test results, and so nothing to display (beyond a big red rectangle).

          Jesse Glick added a comment - Suspect there is nothing to be done here—behaving as designed. If there are no successful builds, there are no test results, and so nothing to display (beyond a big red rectangle).

          Alexander Ost added a comment -

          If there's no successful builds yet, then in all builds at least one test case has failed.

          In those situations, the trend information is especially useful, since it gives a good indication of how many tests still have to be fixed in order to reach a successful build.

          Also the "latest test result" link is useful for projects that never passed all tests yet. Typically, you're interested in test logs no matter whether all tests ever passed or not.

          Both data was available (and appreciated by users : ) before junit-1.2.

          Alexander Ost added a comment - If there's no successful builds yet, then in all builds at least one test case has failed. In those situations, the trend information is especially useful, since it gives a good indication of how many tests still have to be fixed in order to reach a successful build. Also the "latest test result" link is useful for projects that never passed all tests yet. Typically, you're interested in test logs no matter whether all tests ever passed or not. Both data was available (and appreciated by users : ) before junit-1.2.

            Unassigned Unassigned
            arost Alexander Ost
            Votes:
            7 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated: