Skip to content

Prevent tests from using the user and system git config#934

Open
Eijebong wants to merge 1 commit intotaskcluster:mainfrom
Eijebong:no-gpgsign-test-commits
Open

Prevent tests from using the user and system git config#934
Eijebong wants to merge 1 commit intotaskcluster:mainfrom
Eijebong:no-gpgsign-test-commits

Conversation

@Eijebong
Copy link
Copy Markdown
Contributor

@Eijebong Eijebong commented Apr 15, 2026

This prevents tests from asking to sign dummy commits on that repo if
there's a global gpgsign config set. This also has the nice side effect
of having the same tests not pollute the user git config with random
safe directories (since run_task calls git config --global which tests
exercise).

@Eijebong Eijebong requested a review from a team as a code owner April 15, 2026 13:11
@Eijebong Eijebong requested a review from jcristau April 15, 2026 13:11
Copy link
Copy Markdown
Contributor

@jcristau jcristau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively should we set GIT_CONFIG_GLOBAL=/dev/null (and possibly GIT_CONFIG_SYSTEM) for the tests?

@Eijebong Eijebong force-pushed the no-gpgsign-test-commits branch from 53319c3 to 7be2a7b Compare April 15, 2026 13:39
@Eijebong Eijebong changed the title Force gpgsign to false in run_task tests Prevent tests from using the user and system git config Apr 15, 2026
@Eijebong Eijebong requested a review from jcristau April 15, 2026 13:40
Comment thread test/conftest.py Outdated
@Eijebong Eijebong force-pushed the no-gpgsign-test-commits branch 5 times, most recently from 45626d3 to 1f6972b Compare April 16, 2026 11:34
This prevents tests from asking to sign dummy commits on that repo if
there's a global gpgsign config set. This also has the nice side effect
of having the same tests not pollute the user git config with random
safe directories (since run_task calls `git config --global` which tests
exercise).

We cannot use a `NamedTemporaryFile` here because windows doesn't like
it when 2 processes have the same file open, and because delete_on_close
is python3.12+
@Eijebong Eijebong force-pushed the no-gpgsign-test-commits branch from 1f6972b to 612cec3 Compare April 16, 2026 11:45
@Eijebong Eijebong enabled auto-merge (squash) April 16, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants