From 3f14f998d64b5fa15bdddd7570b4f72874eb9f29 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 8 Jan 2026 00:49:57 +0000 Subject: 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. --- src/git/mod.rs | 11 +++++++++++ src/purgatory/helpers.rs | 13 +++++++++++++ tests/common/purgatory_helpers.rs | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/src/git/mod.rs b/src/git/mod.rs index 205e3bc..b3fee69 100644 --- a/src/git/mod.rs +++ b/src/git/mod.rs @@ -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(); diff --git a/src/purgatory/helpers.rs b/src/purgatory/helpers.rs index 2e53778..93dc378 100644 --- a/src/purgatory/helpers.rs +++ b/src/purgatory/helpers.rs @@ -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") diff --git a/tests/common/purgatory_helpers.rs b/tests/common/purgatory_helpers.rs index fa1be73..125f485 100644 --- a/tests/common/purgatory_helpers.rs +++ b/tests/common/purgatory_helpers.rs @@ -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 { -- cgit v1.2.3