From db7c04dfb22f1c218fa8c35835d63811907d9467 Mon Sep 17 00:00:00 2001 From: Eisuke Kawashima <15070-e-kwsm@users.noreply.gitlab.kitware.com> Date: Sun, 22 Jun 2025 01:31:07 +0900 Subject: [PATCH] Test(git): set commit.gpgsign to false If a user has run `git config --global commit.gpgsign true`, git-related tests fail since the test users do not exist and gpg cannot sign. --- Tests/CTestUpdateGIT.cmake.in | 2 ++ Tests/ExternalProjectUpdate/CMakeLists.txt | 1 + Tests/RunCMake/CMP0150/CMakeLists.txt | 1 + Tests/RunCMake/ExternalProject/FetchGitRefs.cmake | 1 + 4 files changed, 5 insertions(+) diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in index 5e3448b86a..49213046b6 100644 --- a/Tests/CTestUpdateGIT.cmake.in +++ b/Tests/CTestUpdateGIT.cmake.in @@ -19,6 +19,8 @@ message(" git = ${GIT}") set(AUTHOR_CONFIG "[user] \tname = Test Author \temail = testauthor@cmake.org +[commit] +\tgpgsign = false ") #----------------------------------------------------------------------------- diff --git a/Tests/ExternalProjectUpdate/CMakeLists.txt b/Tests/ExternalProjectUpdate/CMakeLists.txt index cbddd2f965..2339d301ca 100644 --- a/Tests/ExternalProjectUpdate/CMakeLists.txt +++ b/Tests/ExternalProjectUpdate/CMakeLists.txt @@ -95,6 +95,7 @@ if(do_git_tests) GIT_TAG ${TEST_GIT_TAG} GIT_CONFIG "user.email=testauthor@cmake.org" "user.name=testauthor" + "commit.gpgsign=false" CMAKE_GENERATOR "${CMAKE_GENERATOR}" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= INSTALL_COMMAND "" diff --git a/Tests/RunCMake/CMP0150/CMakeLists.txt b/Tests/RunCMake/CMP0150/CMakeLists.txt index 371dccc7b2..29a2e0416e 100644 --- a/Tests/RunCMake/CMP0150/CMakeLists.txt +++ b/Tests/RunCMake/CMP0150/CMakeLists.txt @@ -20,6 +20,7 @@ function(initGitRepo workDir) execGitCommand("${workDir}" config user.email "testauthor@cmake.org") execGitCommand("${workDir}" config user.name testauthor) execGitCommand("${workDir}" config core.autocrlf false) + execGitCommand("${workDir}" config commit.gpgsign false) execGitCommand("${workDir}" add CMakeLists.txt) execGitCommand("${workDir}" commit -m "Initial commit") endfunction() diff --git a/Tests/RunCMake/ExternalProject/FetchGitRefs.cmake b/Tests/RunCMake/ExternalProject/FetchGitRefs.cmake index a00908b39d..6f3db4d717 100644 --- a/Tests/RunCMake/ExternalProject/FetchGitRefs.cmake +++ b/Tests/RunCMake/ExternalProject/FetchGitRefs.cmake @@ -47,6 +47,7 @@ endfunction() execGitCommand(-c init.defaultBranch=master init) execGitCommand(config --add user.email "testauthor@cmake.org") execGitCommand(config --add user.name testauthor) +execGitCommand(config commit.gpgsign "false") # Create the initial repo structure execGitCommand(add firstFile.txt)