Tests fails when git config is not set

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      If tests are executed without setting local/global git configuration (i.e. neither .git/config either ~/.gitconfig correctly set), tests in class org.jenkinsci.plugins.gitclient.JGitApacheAPIImplTest fail. That configuration should be set before executing the test.

       

       Error message:

      junit.framework.AssertionFailedError: 
      
      *** Please tell me who you are.
      
      Run
      
        git config --global user.email "you@example.com"
        git config --global user.name "Your Name"
      
      to set your account's default identity.
      Omit --global to set the identity only in this repository.
      
      fatal: unable to auto-detect email address (got 'root@a8c61dc0865d.(none)')
       expected:<0> but was:<128>
      	at junit.framework.Assert.fail(Assert.java:57)
      	at junit.framework.Assert.failNotEquals(Assert.java:329)
      	at junit.framework.Assert.assertEquals(Assert.java:78)
      	at junit.framework.Assert.assertEquals(Assert.java:234)
      	at junit.framework.TestCase.assertEquals(TestCase.java:401)
      	at org.jenkinsci.plugins.gitclient.GitAPITestCase$WorkingArea.launchCommand(GitAPITestCase.java:237)
      	at org.jenkinsci.plugins.gitclient.GitAPITestCase$WorkingArea.launchCommand(GitAPITestCase.java:225)
      	at org.jenkinsci.plugins.gitclient.GitAPITestCase$WorkingArea.cmd(GitAPITestCase.java:217)
      	at org.jenkinsci.plugins.gitclient.GitAPITestCase$WorkingArea.commitEmpty(GitAPITestCase.java:265)
      	at org.jenkinsci.plugins.gitclient.GitAPITestCase.test_clone_no_checkout(GitAPITestCase.java:2670)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jenkinsci.plugins.gitclient.JGitApacheAPIImplTest.runTest(JGitApacheAPIImplTest.java:48)
      	at junit.framework.TestCase.runBare(TestCase.java:141)
      	at junit.framework.TestResult$1.protect(TestResult.java:122)
      	at junit.framework.TestResult.runProtected(TestResult.java:142)
      	at junit.framework.TestResult.run(TestResult.java:125)
      	at junit.framework.TestCase.run(TestCase.java:129)
      	at junit.framework.TestSuite.runTest(TestSuite.java:252)
      	at junit.framework.TestSuite.run(TestSuite.java:247)
      	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:272)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:236)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:386)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:323)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:143)
      

            Assignee:
            Francisco Fernández
            Reporter:
            Francisco Fernández
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: