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

Test suite appears to have a dependency on the user's global git config #11058

Open
1 task done
pfmoore opened this issue Apr 21, 2022 · 8 comments
Open
1 task done
Labels
C: tests Testing and related things type: bug A confirmed bug or unintended behavior

Comments

@pfmoore
Copy link
Member

pfmoore commented Apr 21, 2022

Description

I have init.defaultbranch=main in my git config, and a bunch of tests are failing with AssertionError: assert 'main' == 'master'.

I haven't looked in detail at these, but it looks like the global config is leaking into the tests.

Expected behavior

Test suite runs the same regardless of the user's configuration.

pip version

main branch

Python version

3.10

OS

Windows 11

How to Reproduce

Run the test suite with init.defaultbranch=main in your global git config. About 13 tests fail.

Output

No response

Code of Conduct

@pfmoore pfmoore added type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Apr 21, 2022
@pfmoore
Copy link
Member Author

pfmoore commented Apr 21, 2022

Mainly recording this for reference. I don't have time to look at fixing it now (or honestly, the motivation).

As a workaround, I can use CI to run the full test suite for me.

@uranusjr
Copy link
Member

uranusjr commented Apr 21, 2022

I took a quick look, those failures are all from relying implicitly that git init creates a branch called master, and we should be able to fix them rather easily by running git init with an explicit --initial-branch.

@uranusjr uranusjr added C: tests Testing and related things and removed S: needs triage Issues/PRs that need to be triaged labels Apr 21, 2022
@pfmoore
Copy link
Member Author

pfmoore commented Apr 21, 2022

Thanks, that's roughly what I thought. I appreciate the confirmation.

@ichard26
Copy link
Member

ichard26 commented Nov 3, 2024

@pfmoore are you still running into this? I don't have a Windows setup to easily test unfortunately...

@pfmoore
Copy link
Member Author

pfmoore commented Nov 3, 2024

I haven’t tried it recently. Isn’t main the default for git these days? I’m not aware that anyone has fixed the tests, though…

@ichard26
Copy link
Member

ichard26 commented Nov 3, 2024

It's not the default for git yet, no. I have it set to that user-wide ("global") on my Ubuntu system, but I strongly suspect whatever isolation issue you're running into is Windows specific...

@pfmoore
Copy link
Member Author

pfmoore commented Nov 3, 2024

I'll try to confirm it's still an issue at some point. It's a long time since I ran the test suite locally, though (it's slow, and flaky, so I mostly rely on CI these days).

@ichard26
Copy link
Member

ichard26 commented Nov 3, 2024

No worries if you don't. At some point, I'll probably set up my Windows install for Python development and get around to investigating Windows specific issues. I have a reasonably fast laptop that run the test suite quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: tests Testing and related things type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants