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

ParserRegistryTest fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Component/s: warnings-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      Tests in ParserRegistryTest.java fail,
      see maven-surefire report below:

      -------------------------------------------------------------------------------
      Test set: hudson.plugins.warnings.parser.ParserRegistryTest
      -------------------------------------------------------------------------------
      Tests run: 3, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 5.109 sec <<<
      FAILURE!
      issue2359(hudson.plugins.warnings.parser.ParserRegistryTest) Time elapsed:
      1.781 sec <<< FAILURE!
      junit.framework.AssertionFailedError: Wrong number of annotations parsed
      expected:<140> but was:<148>
      at junit.framework.Assert.fail(Assert.java:47)
      at junit.framework.Assert.failNotEquals(Assert.java:277)
      at junit.framework.Assert.assertEquals(Assert.java:64)
      at junit.framework.Assert.assertEquals(Assert.java:195)
      at
      hudson.plugins.warnings.parser.ParserRegistryTest.issue2359(ParserRegistryTest.java:60)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at
      org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
      at
      org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
      at
      org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
      at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
      at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
      at
      org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
      at
      org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
      at
      org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
      at
      org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
      at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
      at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
      at
      org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
      at
      org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
      at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at
      org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
      at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)

      multiplePatternsIssue2359(hudson.plugins.warnings.parser.ParserRegistryTest)
      Time elapsed: 1.781 sec <<< FAILURE!
      junit.framework.AssertionFailedError: Wrong number of annotations parsed
      expected:<133> but was:<148>
      at junit.framework.Assert.fail(Assert.java:47)
      at junit.framework.Assert.failNotEquals(Assert.java:277)
      at junit.framework.Assert.assertEquals(Assert.java:64)
      at junit.framework.Assert.assertEquals(Assert.java:195)
      at
      hudson.plugins.warnings.parser.ParserRegistryTest.multiplePatternsIssue2359(ParserRegistryTest.java:76)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at
      org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
      at
      org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
      at
      org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
      at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
      at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
      at
      org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
      at
      org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
      at
      org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
      at
      org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
      at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
      at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
      at
      org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
      at
      org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
      at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at
      org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
      at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)

        Attachments

          Issue Links

            Activity

            Hide
            drulli Ulli Hafner added a comment -

            Could you please investigate any further (or add some more details)? Did you
            update all folders? I didn't change code since the last release (which could
            only be done if there are no failures and the Hudsons CI shows no failures, too:

            http://hudson.ramfelt.se/job/Hudson%20plugin%20Warnings/

            Which JDK are you using? On which system?

            Show
            drulli Ulli Hafner added a comment - Could you please investigate any further (or add some more details)? Did you update all folders? I didn't change code since the last release (which could only be done if there are no failures and the Hudsons CI shows no failures, too: http://hudson.ramfelt.se/job/Hudson%20plugin%20Warnings/ Which JDK are you using? On which system?
            Hide
            sjancke sjancke added a comment -

            I think I have identified the cause of the test-failures. The reason are my
            local changes to the MSBuildParser.

            The ParserRegistriyTest uses input from all.txt, which contains warnings from an
            cpp-compiler in the form (*: Warning *), that are now parsed by my modified
            MSBuildParser (correctly). See here:

            >>
            "usi_plugin.cpp", line 212: Warning, badargtypel2w: String literal converted to
            char* in formal argument 1 in call to userlog(char*, ...).
            "usi_plugin.cpp", line 224: Warning, badargtypel2w: String literal converted to
            char* in formal argument msg in call to except(char*).

            "ServerList.cpp", line 8: Warning, badargtypel2w: String literal converted to
            char* in formal argument 1 in call to userlog(char*, ...).
            "ServerList.cpp", line 44: Warning, badargtypel2w: String literal converted to
            char* in formal argument 1 in call to userlog(char*, ...).
            "ServerList.cpp", line 50: Warning, badargtypel2w: String literal converted to
            char* in formal argument 1 in call to userlog(char*, ...).
            <<

            Show
            sjancke sjancke added a comment - I think I have identified the cause of the test-failures. The reason are my local changes to the MSBuildParser. The ParserRegistriyTest uses input from all.txt, which contains warnings from an cpp-compiler in the form (*: Warning *), that are now parsed by my modified MSBuildParser (correctly). See here: >> "usi_plugin.cpp", line 212: Warning, badargtypel2w: String literal converted to char* in formal argument 1 in call to userlog(char*, ...). "usi_plugin.cpp", line 224: Warning, badargtypel2w: String literal converted to char* in formal argument msg in call to except(char*). "ServerList.cpp", line 8: Warning, badargtypel2w: String literal converted to char* in formal argument 1 in call to userlog(char*, ...). "ServerList.cpp", line 44: Warning, badargtypel2w: String literal converted to char* in formal argument 1 in call to userlog(char*, ...). "ServerList.cpp", line 50: Warning, badargtypel2w: String literal converted to char* in formal argument 1 in call to userlog(char*, ...). <<
            Hide
            drulli Ulli Hafner added a comment -

            Are you interested in providing a patch (regexp change) so that both parsers
            work as expected on the all.txt file?

            Show
            drulli Ulli Hafner added a comment - Are you interested in providing a patch (regexp change) so that both parsers work as expected on the all.txt file?
            Hide
            sjancke sjancke added a comment -

            This issue is connected to issue 2383, as the ParserRegistryTest has wrong
            assumptions on the input-data. It does not expect to get warnings parsed with
            'Warnings'-keyword (upper first letter, as in c#/c++ compilers from microsoft)

            Show
            sjancke sjancke added a comment - This issue is connected to issue 2383, as the ParserRegistryTest has wrong assumptions on the input-data. It does not expect to get warnings parsed with 'Warnings'-keyword (upper first letter, as in c#/c++ compilers from microsoft)
            Hide
            sjancke sjancke added a comment -

            I did that for Issue 2383 (see attachement in tracker). However,
            ParserRegistryTest still needs to be fixed / all.txt should be inspected once
            again manually to clarify the counts.

            So I'm also oing to do that, and provide also a fix for the ParserRegistryTest.

            Show
            sjancke sjancke added a comment - I did that for Issue 2383 (see attachement in tracker). However, ParserRegistryTest still needs to be fixed / all.txt should be inspected once again manually to clarify the counts. So I'm also oing to do that, and provide also a fix for the ParserRegistryTest.
            Hide
            sjancke sjancke added a comment -

            Startet investigating expected results from all.txt, especially in connection to
            MSBuildParser. ParserRegistryTest looks like it needs to be fixed, as it doesn't
            expect the corrected results of MSBuildParser.

            Show
            sjancke sjancke added a comment - Startet investigating expected results from all.txt, especially in connection to MSBuildParser. ParserRegistryTest looks like it needs to be fixed, as it doesn't expect the corrected results of MSBuildParser.
            Hide
            drulli Ulli Hafner added a comment -

            Even after applying your patch the test case is ok. Maybe due to my improved
            regexp of the ant parser.

            Show
            drulli Ulli Hafner added a comment - Even after applying your patch the test case is ok. Maybe due to my improved regexp of the ant parser.

              People

              Assignee:
              sjancke sjancke
              Reporter:
              sjancke sjancke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: