Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git_test.go's tests fail if git has no global user.email and user.name config set #8924

Closed
patriziobrunops opened this issue Feb 4, 2022 · 1 comment · Fixed by #8970
Closed
Labels
area/testing kind/engineering Work that is not visible to an external user resolution/fixed This issue was fixed

Comments

@patriziobrunops
Copy link

patriziobrunops commented Feb 4, 2022

Hello!

  • Vote on this issue by adding a 👍 reaction
  • To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already)

Issue details

I'm building pulumi on my Fedora Silverblue laptop in a toolbox container and getting test failures in sdk/go/common/util/gitutil/git_test.go. It would probably make sense to set user.name and user.email locally in the test repo. Something else I've found fixing this, the tests make the assumption that git uses master as default init branch, which with recent git versions is no more the case, in fact the new default is main.
error log:

    environment.go:94: Created new test environment:  /tmp/test-env3127899202
    git_test.go:189: Running command git init
    git_test.go:192: Running command git add *
    git_test.go:193: Running command git commit -m 'Initial commit'
    git_test.go:193: Ran command git args [commit -m 'Initial commit'] and expected success. Instead got failure.
    git_test.go:193: Run Error: exit status 128
    git_test.go:193: STDOUT: 
    git_test.go:193: STDERR: Author identity unknown
        
        *** 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.

Steps to reproduce

  1. Follow instructions at CONTRIBUTING.cmd
  2. run make from the repo root

Expected: successful build
Actual: gitutil/git tests fail because they rely on local configuration that is not available

@patriziobrunops patriziobrunops added the kind/bug Some behavior is incorrect or out of spec label Feb 4, 2022
@mikhailshilkov mikhailshilkov added area/testing kind/engineering Work that is not visible to an external user and removed kind/bug Some behavior is incorrect or out of spec labels Feb 8, 2022
@patriziobruno
Copy link
Contributor

I noticed another problem with this. The tests assume that init.defaultBranch is set to master, but newer git installations have it set to main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/engineering Work that is not visible to an external user resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants