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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Apr 12, 2024 at 06:44 UTC ca13c3e94a737b3dc8624e433ed87fead3a8b974
3 files changed +8 -18
t/t0600-reffiles-backend.sh
+2 -6
@@ -4,16 +4,12 @@ test_description='Test reffiles backend'
4
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7 +GIT_TEST_DEFAULT_REF_FORMAT=files
8 +export GIT_TEST_DEFAULT_REF_FORMAT
9
10 TEST_PASSES_SANITIZE_LEAK=true
11 . ./test-lib.sh
12
11 -if ! test_have_prereq REFFILES
12 -then
13 - skip_all='skipping reffiles specific tests'
14 - test_done
15 -fi
16 -
13 test_expect_success 'setup' '
14 git commit --allow-empty -m Initial &&
15 C=$(git rev-parse HEAD) &&
t/t0601-reffiles-pack-refs.sh
+3 -6
@@ -9,18 +9,15 @@ test_description='git pack-refs should not change the branch semantic
9 This test runs git pack-refs and git show-ref and checks that the branch
10 semantic is still the same.
11 '
12 +
13 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
14 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
15 +GIT_TEST_DEFAULT_REF_FORMAT=files
16 +export GIT_TEST_DEFAULT_REF_FORMAT
17
18 TEST_PASSES_SANITIZE_LEAK=true
19 . ./test-lib.sh
20
18 -if ! test_have_prereq REFFILES
19 -then
20 - skip_all='skipping reffiles specific tests'
21 - test_done
22 -fi
23 -
21 test_expect_success 'enable reflogs' '
22 git config core.logallrefupdates true
23 '
t/t0610-reftable-basics.sh
+3 -6
@@ -4,17 +4,14 @@
4 #
5
6 test_description='reftable basics'
7 +
8 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
9 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
10 +GIT_TEST_DEFAULT_REF_FORMAT=reftable
11 +export GIT_TEST_DEFAULT_REF_FORMAT
12
13 . ./test-lib.sh
14
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 -
15 INVALID_OID=$(test_oid 001)
16
17 test_expect_success 'init: creates basic reftable structures' '