Hi Team,

      I am using BFA in my project to match some errors. After reading the documentation of this plugin, it is supposed to match all the right cases/lines based on the regex. But it does not.

      Please see my attached screenshots, the names of which are in operation order.

      Failure Cause: Jasmine Tests Failure, it is supposed to match two places. But it only matches one. After i added exact the same build log indication to this failure cause again, it matches all places. This does not sound right.  It should match all places at the first place.

       

      Failure Cause: Checkstyle Error, same symptom as above. I added the regex, but it doesn't match all. After i added same indication again in the failure cause, it matches all cases.

       

      How can i make it work properly? eg: .checkstyle error. -> highligh all logs that matches this regex

      Is this the expected behavior? Or Am i using it in a wrong way?

       

      Could you look into it please? Thanks in advance!

       

      Thanks,

      Alice

        1. Checkstyle 1.jpg
          Checkstyle 1.jpg
          199 kB
        2. Checkstyle 2.jpg
          Checkstyle 2.jpg
          158 kB
        3. Checkstyle 3.jpg
          Checkstyle 3.jpg
          230 kB
        4. Checkstyle 4.jpg
          Checkstyle 4.jpg
          147 kB
        5. Jasmine 1.jpg
          Jasmine 1.jpg
          229 kB
        6. Jasmine 2.jpg
          Jasmine 2.jpg
          273 kB
        7. Jasmine 3.jpg
          Jasmine 3.jpg
          224 kB
        8. Jasmine 4.jpg
          Jasmine 4.jpg
          295 kB

          [JENKINS-62600] BFA not matching all the cases

          It would be interesting to debug this, but I tried reproducing this with the latest BFA, 1.26 and Jenkins 2.222.1 without success.
          I made a build which produces the same text on 2 lines and then failed the build.
          I created an indication which hit that line and got 2 lines marked in my log.

          Can you reproduce this error in the simple fashion I described?

          Tomas Westling added a comment - It would be interesting to debug this, but I tried reproducing this with the latest BFA, 1.26 and Jenkins 2.222.1 without success. I made a build which produces the same text on 2 lines and then failed the build. I created an indication which hit that line and got 2 lines marked in my log. Can you reproduce this error in the simple fashion I described?

          Alice Test added a comment - - edited

          Hi t_westling,

          Thanks for your response. 

          I tried the way you said, before creating this ticket. It works to match exact same text.

          However, if texts are not the same but still matching the regular expression in the failure cause, it does not hit all the lines. Per my understanding of BFA doc, the expected behavior is to match all the lines as long as it matches the regular expression. My attached screenshots demonstrate the symptom.

          Could you try in the way listed below? 

          1. In Failure Cause: build log indication:  *.checkstyle errors.*
          2. Then, make a build which produces two texts, one on each line and make the build failed: 

                     There are 7 checkstyle errors.

                     There are 8 checkstyle errors.

                 

          Per my testing result, it will only hit the first line.

          However, i assume the expected behavior should be hitting two lines,  as both lines match the regular expression [*checkstyle errors.*] in the failure cause. Or am i wrong about the functionality of this plugin?

           

          Thanks,

          Alice

           

          Alice Test added a comment - - edited Hi t_westling , Thanks for your response.  I tried the way you said, before creating this ticket. It works to match exact same text. However, if texts are not the same but still matching the regular expression in the failure cause, it does not hit all the lines. Per my understanding of BFA doc, the expected behavior is to match all the lines as long as it matches the regular expression. My attached screenshots demonstrate the symptom. Could you try in the way listed below?  In Failure Cause: build log indication:  *. checkstyle errors. * Then, make a build which produces two texts, one on each line and make the build failed:             There are 7 checkstyle errors.            There are 8 checkstyle errors.         Per my testing result, it will only hit the first line. However, i assume the expected behavior should be hitting two lines,  as both lines match the regular expression [*checkstyle errors.*] in the failure cause. Or am i wrong about the functionality of this plugin?   Thanks, Alice  

          Dylan added a comment - - edited

          I am experiencing the same issue, and looking at the source code, the bug seems to be in the FailureReader.scanSingleLinePatterns method. It iterates through each line of the build log, and tests each cause's indications against that line. However, each indication will only be added to the results once, due to the firstOccurrences map and its contents being tested the way they are. It looks like what should be happening is that each indication is tested regardless of whether or not it was already found in that log, and not disregarded after the first time it's found.

          Dylan added a comment - - edited I am experiencing the same issue, and looking at the source code, the bug seems to be in the FailureReader.scanSingleLinePatterns method. It iterates through each line of the build log, and tests each cause's indications against that line. However, each indication will only be added to the results  once , due to the firstOccurrences map and its contents being tested the way they are. It looks like what should be happening is that each indication is tested  regardless of whether or not it was already found in that log, and not disregarded after the first time it's found.

            t_westling Tomas Westling
            alice123 Alice Test
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: