aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2025-02-07 20:22:37 +0200
committerKaren Arutyunov <karen@codesynthesis.com>2025-02-10 10:40:16 +0200
commit0639cf5212c4214808d98412cfbb8cd9c5091c7c (patch)
treed3157d95e7572bb23d04c8e7d2b26ac42549387b /tests
parente1e2a49cb81479b319e49cb804c4ddfb11383bf7 (diff)
Fix tests which fail when git hooks are brokenHEADmaster
Diffstat (limited to 'tests')
-rw-r--r--tests/ci.testscript4
-rw-r--r--tests/publish.testscript4
-rw-r--r--tests/release.testscript15
3 files changed, 17 insertions, 6 deletions
diff --git a/tests/ci.testscript b/tests/ci.testscript
index b051dfd..69a758c 100644
--- a/tests/ci.testscript
+++ b/tests/ci.testscript
@@ -905,7 +905,7 @@ windows = ($cxx.target.class == 'windows')
$g branch non-standard-version;
$g checkout non-standard-version;
- $g -c core.safecrlf=false commit -a -m 'Change version';
+ $g -c core.safecrlf=false commit -a -m 'Change version' --no-verify;
$g push --set-upstream origin non-standard-version;
$build 'configure:' prj/@prj-cfg/,forward &prj/build/bootstrap/*** 2>!;
@@ -953,7 +953,7 @@ windows = ($cxx.target.class == 'windows')
+$g config user.email 'testscript@example.com'
+$g remote add origin $~/prj.git
+$g add '*'
- +$g commit -m 'Create'
+ +$g commit -m 'Create' --no-verify
+$g push --set-upstream origin master
test.options += --no-progress
diff --git a/tests/publish.testscript b/tests/publish.testscript
index 9c0f7e2..56aa487 100644
--- a/tests/publish.testscript
+++ b/tests/publish.testscript
@@ -431,7 +431,7 @@ g = [cmdline] git -C prj >! 2>!
info: use --force=uncommitted to publish anyway
EOE
- $g commit -a -m 'Version';
+ $g commit -a -m 'Version' --no-verify;
$* 2>>~%EOE%
%package submission is queued(: \.*prj/1.0.16)?%d
@@ -462,7 +462,7 @@ g = [cmdline] git -C prj >! 2>!
#
sleep 1;
- $g commit -a -m 'Version';
+ $g commit -a -m 'Version' --no-verify;
$* 2>>~%EOE% != 0;
synchronizing:
diff --git a/tests/release.testscript b/tests/release.testscript
index 3b9731b..e19ed20 100644
--- a/tests/release.testscript
+++ b/tests/release.testscript
@@ -24,16 +24,26 @@ clone_root_rep = [cmdline] cp --no-cleanup -pr $~/prj.git ./ &prj.git/***
# Prepare the local repository.
#
# Set the origin repository location as a relative path, so we can copy the
-# local/remote repository pair into the testscript scopes.
+# local/remote repository pair into the testscript scopes. Also disable hooks,
+# which can potentially be broken, not to interfere with the git commands
+# (commit, etc) which bdep-release calls internally.
+#
+# Note that it would be cleaner to add support for the --git-option option, so
+# that we wouldn't need to override the hooks and, for example, just pass
+# through the --no-verify option to git-commit. However, since we normally run
+# multiple different git commands during bdep run, we would also need to
+# support the qualified option values (see bpkg's --openssl-option for an
+# example). Feels a bit hairy for now, so maybe later.
#
gp = [cmdline] $g -C prj
log = [cmdline] $gp log '--pretty=format:"%d %s"'
+$gp config user.name 'Test Script'
+$gp config user.email 'testscript@example.com'
++$gp config core.hooksPath ''
+$gp remote add origin ../prj.git
+$gp add '*'
-+$gp commit -m 'Create' --no-verify
++$gp commit -m 'Create'
+$gp push --set-upstream origin master
clone_prj = [cmdline] cp --no-cleanup -pr ../prj ./ &prj/***
@@ -1115,6 +1125,7 @@ new += --vcs git,branch=master 2>-
+$gp config user.name 'Test Script'
+$gp config user.email 'testscript@example.com'
+ +$gp config core.hooksPath ''
+$gp remote add origin ../prj.git
+$gp add '*'
+$gp commit -m 'Create'