Skip to content

Commit ca13c3e

Browse files
pks-tgitster
authored andcommitted
t06xx: always execute backend-specific tests
The tests in t06xx exercise specific ref formats. Next to probing some basic functionality, these tests also exercise other low-level details specific to the format. Those tests are only executed though in case `GIT_TEST_DEFAULT_REF_FORMAT` is set to the ref format of the respective backend-under-test. Ideally, we would run the full test matrix for ref formats such that our complete test suite is executed with every supported format on every supported platform. This is quite an expensive undertaking though, and thus we only execute e.g. the "reftable" tests on macOS and Linux. As a result, we basically have no test coverage for the "reftable" format at all on other platforms like Windows. Adapt these tests so that they override `GIT_TEST_DEFAULT_REF_FORMAT`, which means that they'll always execute. This increases test coverage on platforms that don't run the full test matrix, which at least gives us some basic test coverage on those platforms for the "reftable" format. This of course comes at the cost of running those tests multiple times on platforms where we do run the full test matrix. But arguably, this is a good thing because it will also cause us to e.g. run those tests with the address sanitizer and other non-standard parameters. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 04ba2c7 commit ca13c3e

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

t/t0600-reffiles-backend.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@ test_description='Test reffiles backend'
44

55
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
66
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7+
GIT_TEST_DEFAULT_REF_FORMAT=files
8+
export GIT_TEST_DEFAULT_REF_FORMAT
79

810
TEST_PASSES_SANITIZE_LEAK=true
911
. ./test-lib.sh
1012

11-
if ! test_have_prereq REFFILES
12-
then
13-
skip_all='skipping reffiles specific tests'
14-
test_done
15-
fi
16-
1713
test_expect_success 'setup' '
1814
git commit --allow-empty -m Initial &&
1915
C=$(git rev-parse HEAD) &&

t/t0601-reffiles-pack-refs.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,15 @@ test_description='git pack-refs should not change the branch semantic
99
This test runs git pack-refs and git show-ref and checks that the branch
1010
semantic is still the same.
1111
'
12+
1213
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
1314
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
15+
GIT_TEST_DEFAULT_REF_FORMAT=files
16+
export GIT_TEST_DEFAULT_REF_FORMAT
1417

1518
TEST_PASSES_SANITIZE_LEAK=true
1619
. ./test-lib.sh
1720

18-
if ! test_have_prereq REFFILES
19-
then
20-
skip_all='skipping reffiles specific tests'
21-
test_done
22-
fi
23-
2421
test_expect_success 'enable reflogs' '
2522
git config core.logallrefupdates true
2623
'

t/t0610-reftable-basics.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@
44
#
55

66
test_description='reftable basics'
7+
78
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
89
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
10+
GIT_TEST_DEFAULT_REF_FORMAT=reftable
11+
export GIT_TEST_DEFAULT_REF_FORMAT
912

1013
. ./test-lib.sh
1114

12-
if ! test_have_prereq REFTABLE
13-
then
14-
skip_all='skipping reftable tests; set GIT_TEST_DEFAULT_REF_FORMAT=reftable'
15-
test_done
16-
fi
17-
1815
INVALID_OID=$(test_oid 001)
1916

2017
test_expect_success 'init: creates basic reftable structures' '

0 commit comments

Comments
 (0)