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

Tests fails when git config is not set

    Details

    • Similar Issues:

      Description

      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)
      

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Francisco Javier Fernandez Gonzalez
            Path:
            src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java
            http://jenkins-ci.org/commit/git-client-plugin/5eb1bf13207daaebfe12992dd5d8363a2b5e9aff
            Log:
            JENKINS-47373 Set git configuration to avoid test failures.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Francisco Javier Fernandez Gonzalez Path: src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java http://jenkins-ci.org/commit/git-client-plugin/5eb1bf13207daaebfe12992dd5d8363a2b5e9aff Log: JENKINS-47373 Set git configuration to avoid test failures.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark Waite
            Path:
            src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java
            http://jenkins-ci.org/commit/git-client-plugin/5c9f28d127aaadad3229c150678653b41b3ccda6
            Log:
            Merge pull request #276 from fcojfernandez/JENKINS-47373

            JENKINS-47373 Set git configuration to avoid test failures.

            Compare: https://github.com/jenkinsci/git-client-plugin/compare/ca41f1228b2f...5c9f28d127aa

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java http://jenkins-ci.org/commit/git-client-plugin/5c9f28d127aaadad3229c150678653b41b3ccda6 Log: Merge pull request #276 from fcojfernandez/ JENKINS-47373 JENKINS-47373 Set git configuration to avoid test failures. Compare: https://github.com/jenkinsci/git-client-plugin/compare/ca41f1228b2f...5c9f28d127aa
            Hide
            markewaite Mark Waite added a comment -

            Will be fixed with release of git client plugin 2.6.0

            Show
            markewaite Mark Waite added a comment - Will be fixed with release of git client plugin 2.6.0
            Hide
            markewaite Mark Waite added a comment -

            Included in git client plugin 2.6.0, released 27 Oct 2017

            Show
            markewaite Mark Waite added a comment - Included in git client plugin 2.6.0, released 27 Oct 2017

              People

              • Assignee:
                fcojfernandez Francisco Fernández
                Reporter:
                fcojfernandez Francisco Fernández
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: