Skip to content

Test fixes to prepare for the reftable backend#7113

Open
pks-gitlab wants to merge 4 commits intolibgit2:mainfrom
pks-gitlab:pks-test-fixes-for-reftables
Open

Test fixes to prepare for the reftable backend#7113
pks-gitlab wants to merge 4 commits intolibgit2:mainfrom
pks-gitlab:pks-test-fixes-for-reftables

Conversation

@pks-gitlab
Copy link

This pull request includes a couple of test fixes required for reftables. I've split them out so that the final PR for reftable support becomes smaller.

@pks-gitlab pks-gitlab force-pushed the pks-test-fixes-for-reftables branch from 754ca11 to 60e21fb Compare August 1, 2025 06:25
@pks-t pks-t mentioned this pull request Aug 1, 2025
@pks-gitlab pks-gitlab mentioned this pull request Aug 4, 2025
@pks-gitlab pks-gitlab force-pushed the pks-test-fixes-for-reftables branch from 60e21fb to f1321c9 Compare August 4, 2025 14:33
pks-t added 4 commits December 8, 2025 07:31
Introduce a function that reads the "refStorage" extension so that we
can easily figure out whether a specific repository uses the "files" or
any other reference format. While we don't support other formats yet, we
are about to add support for the "reftable" format.
There are a bunch of tests where we read or write references via the
filesystem directly. This only works with the "files" backend, but
naturally breaks if we supported any other reference format.

Refactor these tests to instead use the refdb to access those.
When testing conditional includes we overwrite the repository's config
file with the relevant conditions. This causes us to fully overwrite all
repository configuration, including the repository format version and
any extensions. While the test repository used in this test does not
have any extensions, we will add a reftable-enabled repository that does
rely on the "refStorage" extension eventually.

Fix this by only modifying the relevant config keys.
We have a bunch of checks for properties of the "files" reference
backend:

  - Whether a specific reference has been packed or whether it still
    exists as a loose reference.

  - Whether empty ref directories get pruned.

  - Whether we properly fsync data to disk.

These checks continue to be sensible for that backend, but for any other
backend they plain don't work. Adapt the tests so that we only run them
in case the repository uses the "files" backend.
@pks-gitlab pks-gitlab force-pushed the pks-test-fixes-for-reftables branch from f1321c9 to 9e3b60a Compare December 8, 2025 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants