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

email-ext regression trigger not firing when it should

    XMLWordPrintable

Details

    Description

      I apologize in advance, because I can't imagine this isn't my problem.

      I have a simple project, the builds triggered successfully by a subversion callback. When an additional JUnit test fails, the "regression" trigger isn't fired.

      I attach screenshots of my email-ext config, the build info screen showing that the number of fails is "+1", and a screenshot of the console output from the build, showing that there was a fail, but "No emails were triggered."

      i'm sure i'm missing something very simple, but i've been staring at this for a while. i'd appreciate any help. thanks!

      Attachments

        1. ScreenShot011.png
          ScreenShot011.png
          48 kB
        2. ScreenShot012.png
          ScreenShot012.png
          5 kB
        3. ScreenShot013.png
          ScreenShot013.png
          54 kB

        Activity

          lcgerke lcgerke gerke created issue -
          slide_o_mix Alex Earl added a comment -

          Are you using a Maven job, or a Free Style Job?

          slide_o_mix Alex Earl added a comment - Are you using a Maven job, or a Free Style Job?
          lcgerke lcgerke gerke added a comment -

          Sorry, should have said: maven job. Thanks!

          lcgerke lcgerke gerke added a comment - Sorry, should have said: maven job. Thanks!
          slide_o_mix Alex Earl added a comment -

          Ok, I'll see what I can do. I don't currently have any Maven stuff to test with.

          slide_o_mix Alex Earl added a comment - Ok, I'll see what I can do. I don't currently have any Maven stuff to test with.
          slide_o_mix Alex Earl added a comment -

          Here is the code for Regression Trigger. I'll have to try and setup something with Maven to test out your issue.

          public boolean trigger(AbstractBuild<?, ?> build) {
              if (build.getPreviousBuild() == null)
                  return build.getResult() == Result.FAILURE;
              if (build.getTestResultAction() == null) return false;
              if (build.getPreviousBuild().getTestResultAction() == null)
                  return build.getTestResultAction().getFailCount() > 0;
              return getNumFailures(build) > 
                      getNumFailures(build.getPreviousBuild());
          }
          
          slide_o_mix Alex Earl added a comment - Here is the code for Regression Trigger. I'll have to try and setup something with Maven to test out your issue. public boolean trigger(AbstractBuild<?, ?> build) { if (build.getPreviousBuild() == null ) return build.getResult() == Result.FAILURE; if (build.getTestResultAction() == null ) return false ; if (build.getPreviousBuild().getTestResultAction() == null ) return build.getTestResultAction().getFailCount() > 0; return getNumFailures(build) > getNumFailures(build.getPreviousBuild()); }
          slide_o_mix Alex Earl added a comment -

          I'm trying to figure out the history behind the getNumFailures method, it was implemented before I started working on the plugin.

          slide_o_mix Alex Earl added a comment - I'm trying to figure out the history behind the getNumFailures method, it was implemented before I started working on the plugin.

          I'm seeing something similar in email-ext 2.24.1 and Jenkins 1.480.1.

          My failed and unstable triggers work ok, but it doesn't seem to catch regressions.
          The logs does not contain anything useful either...

          Could you post any workarounds if you find any?

          fanhaf Michał Guminiak added a comment - I'm seeing something similar in email-ext 2.24.1 and Jenkins 1.480.1. My failed and unstable triggers work ok, but it doesn't seem to catch regressions. The logs does not contain anything useful either... Could you post any workarounds if you find any?
          slide_o_mix Alex Earl added a comment -

          There wouldn't be any workarounds...there seems to be a code issue.

          slide_o_mix Alex Earl added a comment - There wouldn't be any workarounds...there seems to be a code issue.

          I would also like to suggest that if one test is fixed and another is broken between builds it should still count as a regression I guess...

          Maybe we could check if there is a failing test with age 1 and then trigger the regression email?

          fanhaf Michał Guminiak added a comment - I would also like to suggest that if one test is fixed and another is broken between builds it should still count as a regression I guess... Maybe we could check if there is a failing test with age 1 and then trigger the regression email?
          slide_o_mix Alex Earl added a comment -

          If you are familiar with Java, you could fork the plugin on GitHub, make and test the changes and issue a pull request. It may get done sooner that way

          slide_o_mix Alex Earl added a comment - If you are familiar with Java, you could fork the plugin on GitHub, make and test the changes and issue a pull request. It may get done sooner that way

          Code changed in jenkins
          User: Alex Earl
          Path:
          src/main/java/hudson/plugins/emailext/plugins/EmailTrigger.java
          http://jenkins-ci.org/commit/email-ext-plugin/52dae3a93c5acb1a8e0a8f3149c49a5a2c4abc2e
          Log:
          Fix JENKINS-16404

          Added a check for the value of getFailCount if the child
          reports did not have any fails.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alex Earl Path: src/main/java/hudson/plugins/emailext/plugins/EmailTrigger.java http://jenkins-ci.org/commit/email-ext-plugin/52dae3a93c5acb1a8e0a8f3149c49a5a2c4abc2e Log: Fix JENKINS-16404 Added a check for the value of getFailCount if the child reports did not have any fails. –
          slide_o_mix Alex Earl added a comment -

          Added check of getFailCount if the child reports don't have fails

          slide_o_mix Alex Earl added a comment - Added check of getFailCount if the child reports don't have fails
          slide_o_mix Alex Earl made changes -
          Field Original Value New Value
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 147222 ] JNJira + In-Review [ 192289 ]

          People

            slide_o_mix Alex Earl
            lcgerke lcgerke gerke
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: