Skip to content

Commit 9430da0

Browse files
committed
test: Use prereq test for git send-email
Some platforms (e.g. Ubuntu) do not package `git send-email` with the rest of git. And some CI platforms (e.g. GitHub Actions) use a version of git that is incompatible with the distro-provided git-email package. So since we cannot count on the availability of `git send-email` in all environments, add GITSENDEMAIL prereq checks to relevant tests that need `git send-email`.
1 parent 5a3f56b commit 9430da0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

t/t1903-email-send.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Subject: [PATCH 2/4] p2
1717
Subject: [PATCH 3/4] p3
1818
Subject: [PATCH 4/4] p4
1919
EOF
20-
test_expect_success 'Send all applied patches' '
20+
test_expect_success GITSENDEMAIL 'Send all applied patches' '
2121
stg email send --dry-run --to [email protected] --all >out &&
2222
grep "Subject: " out > subjects &&
2323
test_cmp expected subjects
@@ -28,7 +28,7 @@ Subject: [PATCH 1/3] p3
2828
Subject: [PATCH 2/3] p4
2929
Subject: [PATCH 3/3] p5
3030
EOF
31-
test_expect_success 'Send custom patch range' '
31+
test_expect_success GITSENDEMAIL 'Send custom patch range' '
3232
stg email send --dry-run --to [email protected] p3..p5 >out &&
3333
grep "Subject: " out > subjects &&
3434
test_cmp expected subjects
@@ -37,7 +37,7 @@ test_expect_success 'Send custom patch range' '
3737
cat >expected <<EOF
3838
Subject: [PATCH] p7
3939
EOF
40-
test_expect_success 'Send single patch' '
40+
test_expect_success GITSENDEMAIL 'Send single patch' '
4141
stg email send --dry-run --to [email protected] p7 >out &&
4242
grep "Subject: " out > subjects &&
4343
test_cmp expected subjects
@@ -56,7 +56,7 @@ Subject: [PATCH 1/3] other1
5656
Subject: [PATCH 2/3] other2
5757
Subject: [PATCH 3/3] other3
5858
EOF
59-
test_expect_success 'Send patches from other branch' '
59+
test_expect_success GITSENDEMAIL 'Send patches from other branch' '
6060
stg email send --dry-run --to [email protected] --branch other --all >out &&
6161
grep "Subject: " out > subjects &&
6262
test_cmp expected subjects

t/test-lib.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,3 +1329,8 @@ test_lazy_prereq QUILT '
13291329
# test whether quilt is installed
13301330
quilt --version 2>/dev/null >/dev/null
13311331
'
1332+
1333+
test_lazy_prereq GITSENDEMAIL '
1334+
# test whether git send-email is available
1335+
git send-email --help 2>/dev/null >/dev/null
1336+
'

0 commit comments

Comments
 (0)