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

email-ext regression trigger not firing when it should

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • email-ext-plugin
    • linux
      jenkins 1.480.2
      email-ext 2.25

      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!

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

          [JENKINS-16404] email-ext regression trigger not firing when it should

          lcgerke gerke added a comment -

          Sorry, should have said: maven job. Thanks!

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

          Alex Earl added a comment -

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

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

          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());
          }
          

          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()); }

          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.

          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?

          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?

          Alex Earl added a comment -

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

          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?

          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?

          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

          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/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. –

          Alex Earl added a comment -

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

          Alex Earl added a comment - Added check of getFailCount if the child reports don't have fails

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

              Created:
              Updated:
              Resolved: