Thread View: linux.kernel.git
2 messages
2 total messages
Started by Karthik Nayak
Thu, 12 Nov 2026 17:34
[PATCH v2 09/20] t9300: make the big blob tests self-contained
Author: Karthik Nayak
Date: Thu, 12 Nov 2026 17:34
Date: Thu, 12 Nov 2026 17:34
115 lines
15162 bytes
15162 bytes
Similar to the previous commits, modify the big blob tests in 'series R' to make them independent of state from previous tests. 'R: blob bigger than threshold' imports the blobs, and the tests after it inspect the result. Fold them into a single test, which does the import and checks the pack, the blob contents and that the blob is stored only once. Set 'fastimport.unpackLimit' to 0 for the import so that a pack is written, and verify it with an inline loop in place of 'verify_packs()', which won't be available once the test is moved to another file. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> --- t/t9300-fast-import.sh | 79 ++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index e0b9663452..2231e1bdab 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -3198,51 +3198,48 @@ test_expect_success 'R: corrupt lines do not mess marks file' ' ## R: very large blobs ## test_expect_success 'R: blob bigger than threshold' ' - blobsize=$((2*1024*1024 + 53)) && - test-tool genrandom bar $blobsize >expect && - cat >input <<-INPUT_END && - commit refs/heads/big-file - committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE - data <<COMMIT - R - big file - COMMIT - - M 644 inline big1 - data $blobsize - INPUT_END - cat expect >>input && - cat >>input <<-INPUT_END && - M 644 inline big2 - data $blobsize - INPUT_END - cat expect >>input && - echo >>input && - - test_create_repo R && - git --git-dir=R/.git config fastimport.unpackLimit 0 && - git --git-dir=R/.git fast-import --big-file-threshold=1 <input -' - -test_expect_success 'R: verify created pack' ' + test_when_finished "rm -rf repo" && + git init repo && ( - cd R && - verify_packs -v > ../verify + cd repo && + + blobsize=$((2*1024*1024 + 53)) && + test-tool genrandom bar $blobsize >expect && + cat >input <<-INPUT_END && + commit refs/heads/big-file + committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE + data <<COMMIT + R - big file + COMMIT + + M 644 inline big1 + data $blobsize + INPUT_END + cat expect >>input && + cat >>input <<-INPUT_END && + M 644 inline big2 + data $blobsize + INPUT_END + cat expect >>input && + echo >>input && + + git -c fastimport.unpackLimit=0 fast-import --big-file-threshold=1 <input && + + for p in .git/objects/pack/*.pack + do + git verify-pack -v "$p" || return 1 + done >verify && + + git cat-file blob big-file:big1 >actual && + test_cmp_bin expect actual && + a=$(git rev-parse big-file:big1) && + b=$(git rev-parse big-file:big2) && + test $a = $b && + n=$(grep $a verify | wc -l) && + test 1 = $n ) ' -test_expect_success 'R: verify written objects' ' - git --git-dir=R/.git cat-file blob big-file:big1 >actual && - test_cmp_bin expect actual && - a=$(git --git-dir=R/.git rev-parse big-file:big1) && - b=$(git --git-dir=R/.git rev-parse big-file:big2) && - test $a = $b -' - -test_expect_success 'R: blob appears only once' ' - n=$(grep $a verify | wc -l) && - test 1 = $n -' - test_expect_success 'R: --git-completion-helper does not read from stdin' ' find .git/objects/pack -name "tmp_pack_*" >before && echo garbage | git fast-import --git-completion-helper >out && -- 2.56.GIT
Re: [PATCH v2 09/20] t9300: make the big blob tests self-contained
Author: Tanga Joris
Date: Wed, 25 Nov 2026 02:08
Date: Wed, 25 Nov 2026 02:08
12 lines
11975 bytes
11975 bytes
On Thu, 12 Nov 2026 at 21:51, Karthik Nayak <karthik.188@gmail.com> wrote: > Set 'fastimport.unpackLimit' to 0 for the import so that a pack is > written, and verify it with an inline loop in place of 'verify_packs()', > which won't be available once the test is moved to another file. The same loop ends up in four places, in t9307, t9308 and t9311. Maybe verify_packs() could move into a small shared file instead, if more tests leave t9300 later. Thanks, Tanga
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads