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

Make Git deterministic in UnitTests.Distribution.Client.VCS #10585

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

9999years
Copy link
Collaborator

@9999years 9999years commented Nov 22, 2024

Please review with whitespace changes hidden, this PR required reindenting blocks of code.

Add the following environment variables to git invocations in tests:

export HOME="$TMPDIR/home"
# > Whether to skip reading settings from the system-wide $(prefix)/etc/gitconfig file.
export GIT_CONFIG_NOSYSTEM=1
export GIT_CONFIG_GLOBAL="$HOME/.gitconfig"
# Setting the author and committer dates makes commit hashes deterministic between test runs.
export GIT_AUTHOR_DATE=1998-04-30T18:25:03-0400
export GIT_COMMITTER_DATE=1998-04-30T18:25:00-0400

Write the following .gitconfig:

[protocol.file]
allow = always

[user]
name = Puppy Doggy
email = [email protected]
  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

@9999years 9999years added the type: testing Issues about project test suites label Nov 22, 2024
@9999years 9999years marked this pull request as ready for review November 22, 2024 21:07
@9999years 9999years added the merge me Tell Mergify Bot to merge label Nov 25, 2024
@mergify mergify bot added ready and waiting Mergify is waiting out the cooldown period merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days labels Nov 25, 2024
Also use a record for constructing the `VCSTestDriver`s; There's three
`FilePath` arguments in a row now and that's just too many for zero type
safety.
Don't read configuration files, set a consistent date for commits, and
pass a tempdir as the home directory.

This will prevent the test suite from attempting to GPG-sign commits in
the tests!
@mergify mergify bot merged commit 7386b00 into haskell:master Nov 27, 2024
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge ready and waiting Mergify is waiting out the cooldown period type: testing Issues about project test suites
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants