test: disable GPG signing in all test helpers

Prevent GPG signing prompts (including Yubikey activation) during test runs
by explicitly disabling commit.gpgsign and tag.gpgsign in all test repository
creation helpers.

Modified:
- tests/common/purgatory_helpers.rs: create_test_repo_with_commit()
- src/git/mod.rs: create_test_repo_with_commit()
- src/purgatory/helpers.rs: create_test_repo_with_commit()

All test repositories now have GPG signing disabled regardless of global
git configuration.
This commit is contained in:
DanConwayDev
2026-01-08 00:49:57 +00:00
parent 5833c9bdf8
commit 3f14f998d6
3 changed files with 28 additions and 0 deletions
+11
View File
@@ -535,6 +535,17 @@ mod tests {
.current_dir(&work_dir)
.output()
.unwrap();
// Disable GPG signing for tests (prevents yubikey prompts)
Command::new("git")
.args(["config", "commit.gpgsign", "false"])
.current_dir(&work_dir)
.output()
.unwrap();
Command::new("git")
.args(["config", "tag.gpgsign", "false"])
.current_dir(&work_dir)
.output()
.unwrap();
// Create a file and commit
fs::write(work_dir.join("README.md"), "# Test").unwrap();
+13
View File
@@ -534,6 +534,19 @@ mod tests {
.output()
.expect("Failed to set name");
// Disable GPG signing for tests (prevents yubikey prompts)
Command::new("git")
.args(["config", "commit.gpgsign", "false"])
.current_dir(work_dir.path())
.output()
.expect("Failed to disable commit.gpgsign");
Command::new("git")
.args(["config", "tag.gpgsign", "false"])
.current_dir(work_dir.path())
.output()
.expect("Failed to disable tag.gpgsign");
// Create a commit
std::fs::write(work_dir.path().join("file.txt"), "content").unwrap();
Command::new("git")
+4
View File
@@ -51,6 +51,10 @@ pub fn create_test_repo_with_commit(path: &Path, variant: CommitVariant) -> Resu
// Configure git user for commits
run_git(path, &["config", "user.email", "test@example.com"])?;
run_git(path, &["config", "user.name", "Test User"])?;
// Disable GPG signing for tests (prevents yubikey prompts)
run_git(path, &["config", "commit.gpgsign", "false"])?;
run_git(path, &["config", "tag.gpgsign", "false"])?;
// Create a file based on variant
let (filename, content) = match variant {