Merge branch 'ps/t-fixes-for-git-test-long'
Various test scripts have been updated to clean up large temporary files and repositories, reducing peak disk usage during testing. Also, expensive tests have been disabled on platforms that lack sufficient resources (like 32-bit platforms and Windows CI runners), and the long test suite has been enabled in GitLab CI. * ps/t-fixes-for-git-test-long: gitlab-ci: enable "GIT_TEST_LONG" gitlab-ci: disable RAM disk on macOS jobs t: use `test_bool_env` to parse GIT_TEST_LONG t7900: clean up large EXPENSIVE repository t7508: skip EXPENSIVE test that is broken without SIZE_T_IS_64BIT t5608: reduce maximum disk usage t4141: fix inefficient use of dd(1) t0021: skip EXPENSIVE test that is broken without SIZE_T_IS_64BIT README: add GitLab CI badge to make it more discoverablemain
commit
88775e3e96
|
|
@ -88,13 +88,8 @@ test:osx:
|
|||
tags:
|
||||
- saas-macos-large-m2pro
|
||||
variables:
|
||||
TEST_OUTPUT_DIRECTORY: "/Volumes/RAMDisk"
|
||||
TEST_OUTPUT_DIRECTORY: "/tmp/test-output"
|
||||
before_script:
|
||||
# Create a 4GB RAM disk that we use to store test output on. This small hack
|
||||
# significantly speeds up tests by more than a factor of 2 because the
|
||||
# macOS runners use network-attached storage as disks, which is _really_
|
||||
# slow with the many small writes that our tests do.
|
||||
- sudo diskutil apfs create $(hdiutil attach -nomount ram://8192000) RAMDisk
|
||||
- ./ci/install-dependencies.sh
|
||||
script:
|
||||
- ./ci/run-build-and-tests.sh
|
||||
|
|
@ -152,6 +147,9 @@ test:mingw64:
|
|||
needs:
|
||||
- job: "build:mingw64"
|
||||
artifacts: true
|
||||
variables:
|
||||
# Windows runners don't have enough RAM to run EXPENSIVE tests.
|
||||
GIT_TEST_LONG: false
|
||||
before_script:
|
||||
- *windows_before_script
|
||||
- git-sdk/usr/bin/bash.exe -l -c 'tar xf artifacts/artifacts.tar.gz'
|
||||
|
|
@ -200,6 +198,9 @@ test:msvc-meson:
|
|||
script:
|
||||
- |
|
||||
& "C:/Program Files/Git/usr/bin/bash.exe" -l -c 'ci/run-test-slice-meson.sh build $CI_NODE_INDEX $CI_NODE_TOTAL'
|
||||
variables:
|
||||
# Windows runners don't have enough RAM to run EXPENSIVE tests.
|
||||
GIT_TEST_LONG: false
|
||||
after_script:
|
||||
- |
|
||||
if ($env:CI_JOB_STATUS -ne "success") {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
[](https://github.com/git/git/actions?query=branch%3Amaster+event%3Apush)
|
||||
[](https://github.com/git/git/actions?query=branch%3Amaster+event%3Apush)
|
||||
[](https://gitlab.com/git-scm/git/-/pipelines?ref=master)
|
||||
|
||||
Git - fast, scalable, distributed revision control system
|
||||
=========================================================
|
||||
|
|
|
|||
12
ci/lib.sh
12
ci/lib.sh
|
|
@ -215,6 +215,7 @@ then
|
|||
test macos != "$CI_OS_NAME" || CI_OS_NAME=osx
|
||||
CI_REPO_SLUG="$GITHUB_REPOSITORY"
|
||||
CI_JOB_ID="$GITHUB_RUN_ID"
|
||||
CI_EVENT="$GITHUB_EVENT_NAME"
|
||||
CC="${CC_PACKAGE:-${CC:-gcc}}"
|
||||
DONT_SKIP_TAGS=t
|
||||
handle_failed_tests () {
|
||||
|
|
@ -239,6 +240,13 @@ then
|
|||
CI_BRANCH="$CI_COMMIT_REF_NAME"
|
||||
CI_COMMIT="$CI_COMMIT_SHA"
|
||||
|
||||
case "$CI_PIPELINE_SOURCE" in
|
||||
merge_request_event)
|
||||
CI_EVENT=pull_request;;
|
||||
*)
|
||||
CI_EVENT="$CI_PIPELINE_SOURCE";;
|
||||
esac
|
||||
|
||||
case "$OS,$CI_JOB_IMAGE" in
|
||||
Windows_NT,*)
|
||||
CI_OS_NAME=windows
|
||||
|
|
@ -319,9 +327,9 @@ export SKIP_DASHED_BUILT_INS=YesPlease
|
|||
# enable "expensive" tests for PR events.
|
||||
# In order to catch bugs introduced at integration time by mismerges,
|
||||
# enable the long tests for pushes to the integration branches as well.
|
||||
case "$GITHUB_EVENT_NAME,$CI_BRANCH" in
|
||||
case "$CI_EVENT,$CI_BRANCH" in
|
||||
pull_request,*|push,*next*|push,*master*|push,*main*|push,*maint*)
|
||||
export GIT_TEST_LONG=YesPlease
|
||||
export GIT_TEST_LONG=${GIT_TEST_LONG:-true}
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ test_expect_success 'filter that does not read is fine' '
|
|||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success EXPENSIVE 'filter large file' '
|
||||
test_expect_success EXPENSIVE,SIZE_T_IS_64BIT 'filter large file' '
|
||||
test_config filter.largefile.smudge cat &&
|
||||
test_config filter.largefile.clean cat &&
|
||||
test_seq -f "%1048576d" 1 2048 >2GB &&
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ test_description='git apply with too-large patch'
|
|||
. ./test-lib.sh
|
||||
|
||||
test_expect_success EXPENSIVE 'git apply rejects patches that are too large' '
|
||||
sz=$((1024 * 1024 * 1023)) &&
|
||||
{
|
||||
cat <<-\EOF &&
|
||||
diff --git a/file b/file
|
||||
|
|
@ -14,8 +13,8 @@ test_expect_success EXPENSIVE 'git apply rejects patches that are too large' '
|
|||
+++ b/file
|
||||
@@ -0,0 +1 @@
|
||||
EOF
|
||||
test-tool genzeros
|
||||
} | test_copy_bytes $sz | test_must_fail git apply 2>err &&
|
||||
test-tool genzeros $((1024 * 1024 * 1023))
|
||||
} | test_must_fail git apply 2>err &&
|
||||
grep "patch too large" err
|
||||
'
|
||||
|
||||
|
|
|
|||
|
|
@ -10,45 +10,47 @@ then
|
|||
fi
|
||||
|
||||
test_expect_success 'setup' '
|
||||
|
||||
git config pack.compression 0 &&
|
||||
git config pack.depth 0 &&
|
||||
blobsize=$((100*1024*1024)) &&
|
||||
blobcount=$((2*1024*1024*1024/$blobsize+1)) &&
|
||||
i=1 &&
|
||||
(while test $i -le $blobcount
|
||||
do
|
||||
printf "Generating blob $i/$blobcount\r" >&2 &&
|
||||
printf "blob\nmark :$i\ndata $blobsize\n" &&
|
||||
#test-tool genrandom $i $blobsize &&
|
||||
printf "%-${blobsize}s" $i &&
|
||||
echo "M 100644 :$i $i" >> commit &&
|
||||
i=$(($i+1)) ||
|
||||
echo $? > exit-status
|
||||
done &&
|
||||
echo "commit refs/heads/main" &&
|
||||
echo "author A U Thor <author@email.com> 123456789 +0000" &&
|
||||
echo "committer C O Mitter <committer@email.com> 123456789 +0000" &&
|
||||
echo "data 5" &&
|
||||
echo ">2gb" &&
|
||||
cat commit) |
|
||||
git fast-import --big-file-threshold=2 &&
|
||||
test ! -f exit-status
|
||||
|
||||
git init 2gb-repo &&
|
||||
(
|
||||
cd 2gb-repo &&
|
||||
git config pack.compression 0 &&
|
||||
git config pack.depth 0 &&
|
||||
blobsize=$((100*1024*1024)) &&
|
||||
blobcount=$((2*1024*1024*1024/$blobsize+1)) &&
|
||||
i=1 &&
|
||||
(while test $i -le $blobcount
|
||||
do
|
||||
printf "Generating blob $i/$blobcount\r" >&2 &&
|
||||
printf "blob\nmark :$i\ndata $blobsize\n" &&
|
||||
#test-tool genrandom $i $blobsize &&
|
||||
printf "%-${blobsize}s" $i &&
|
||||
echo "M 100644 :$i $i" >> commit &&
|
||||
i=$(($i+1)) ||
|
||||
echo $? > exit-status
|
||||
done &&
|
||||
echo "commit refs/heads/main" &&
|
||||
echo "author A U Thor <author@email.com> 123456789 +0000" &&
|
||||
echo "committer C O Mitter <committer@email.com> 123456789 +0000" &&
|
||||
echo "data 5" &&
|
||||
echo ">2gb" &&
|
||||
cat commit) |
|
||||
git fast-import --big-file-threshold=2 &&
|
||||
test ! -f exit-status
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'clone - bare' '
|
||||
|
||||
git clone --bare --no-hardlinks . clone-bare
|
||||
|
||||
test_when_finished rm -rf clone-bare &&
|
||||
git clone --bare --no-hardlinks 2gb-repo clone-bare
|
||||
'
|
||||
|
||||
test_expect_success 'clone - with worktree, file:// protocol' '
|
||||
|
||||
git clone "file://$(pwd)" clone-wt
|
||||
|
||||
test_when_finished rm -rf clone-wt &&
|
||||
git clone "file://$(pwd)/2gb-repo" clone-wt
|
||||
'
|
||||
|
||||
rm -rf 2gb-repo 2>/dev/null
|
||||
|
||||
test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'set up repo with >4GB object' '
|
||||
large_blob_size=$((4*1024*1024*1024+1)) &&
|
||||
git init --bare 4gb-repo &&
|
||||
|
|
@ -61,6 +63,7 @@ test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'set up repo with >4GB object' '
|
|||
'
|
||||
|
||||
test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'clone >4GB object via unpack-objects' '
|
||||
test_when_finished rm -rf 4gb-clone-unpack &&
|
||||
# The synthesized pack has five objects, so a large unpack limit keeps
|
||||
# fetch-pack on the unpack-objects path.
|
||||
git -c fetch.unpackLimit=100 clone --bare \
|
||||
|
|
@ -77,6 +80,7 @@ test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'clone >4GB object via unpack-obje
|
|||
'
|
||||
|
||||
test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'clone with >4GB object via index-pack' '
|
||||
test_when_finished rm -rf 4gb-clone-index &&
|
||||
# Force fetch-pack to hand the pack to index-pack instead.
|
||||
git -c fetch.unpackLimit=1 clone --bare \
|
||||
"file://$(pwd)/4gb-repo" 4gb-clone-index &&
|
||||
|
|
|
|||
|
|
@ -1773,7 +1773,7 @@ test_expect_success 'slow status advice when core.untrackedCache true, and fsmon
|
|||
)
|
||||
'
|
||||
|
||||
test_expect_success EXPENSIVE 'status does not re-read unchanged 4 or 8 GiB file' '
|
||||
test_expect_success EXPENSIVE,SIZE_T_IS_64BIT 'status does not re-read unchanged 4 or 8 GiB file' '
|
||||
(
|
||||
mkdir large-file &&
|
||||
cd large-file &&
|
||||
|
|
|
|||
|
|
@ -461,36 +461,42 @@ test_expect_success 'incremental-repack task' '
|
|||
'
|
||||
|
||||
test_expect_success EXPENSIVE 'incremental-repack 2g limit' '
|
||||
test_config core.compression 0 &&
|
||||
test_when_finished rm -rf expensive-repo &&
|
||||
git init expensive-repo &&
|
||||
(
|
||||
cd expensive-repo &&
|
||||
git config set core.compression 0 &&
|
||||
git config set maintenance.auto false &&
|
||||
|
||||
for i in $(test_seq 1 5)
|
||||
do
|
||||
test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big ||
|
||||
return 1
|
||||
done &&
|
||||
git add big &&
|
||||
git commit -qm "Add big file (1)" &&
|
||||
for i in $(test_seq 1 5)
|
||||
do
|
||||
test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big ||
|
||||
return 1
|
||||
done &&
|
||||
git add big &&
|
||||
git commit -qm "Add big file (1)" &&
|
||||
|
||||
# ensure any possible loose objects are in a pack-file
|
||||
git maintenance run --task=loose-objects &&
|
||||
# ensure any possible loose objects are in a pack-file
|
||||
git maintenance run --task=loose-objects &&
|
||||
|
||||
rm big &&
|
||||
for i in $(test_seq 6 10)
|
||||
do
|
||||
test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big ||
|
||||
return 1
|
||||
done &&
|
||||
git add big &&
|
||||
git commit -qm "Add big file (2)" &&
|
||||
rm big &&
|
||||
for i in $(test_seq 6 10)
|
||||
do
|
||||
test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big ||
|
||||
return 1
|
||||
done &&
|
||||
git add big &&
|
||||
git commit -qm "Add big file (2)" &&
|
||||
|
||||
# ensure any possible loose objects are in a pack-file
|
||||
git maintenance run --task=loose-objects &&
|
||||
# ensure any possible loose objects are in a pack-file
|
||||
git maintenance run --task=loose-objects &&
|
||||
|
||||
# Now run the incremental-repack task and check the batch-size
|
||||
GIT_TRACE2_EVENT="$(pwd)/run-2g.txt" git maintenance run \
|
||||
--task=incremental-repack 2>/dev/null &&
|
||||
test_subcommand git multi-pack-index repack \
|
||||
--no-progress --batch-size=2147483647 <run-2g.txt
|
||||
# Now run the incremental-repack task and check the batch-size
|
||||
GIT_TRACE2_EVENT="$(pwd)/run-2g.txt" git maintenance run \
|
||||
--task=incremental-repack 2>/dev/null &&
|
||||
test_subcommand git multi-pack-index repack \
|
||||
--no-progress --batch-size=2147483647 <run-2g.txt
|
||||
)
|
||||
'
|
||||
|
||||
run_incremental_repack_and_verify () {
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ parse_option () {
|
|||
-i|--i|--im|--imm|--imme|--immed|--immedi|--immedia|--immediat|--immediate)
|
||||
immediate=t ;;
|
||||
-l|--l|--lo|--lon|--long|--long-|--long-t|--long-te|--long-tes|--long-test|--long-tests)
|
||||
GIT_TEST_LONG=t; export GIT_TEST_LONG ;;
|
||||
GIT_TEST_LONG=true; export GIT_TEST_LONG ;;
|
||||
-r)
|
||||
mark_option_requires_arg "$opt" run_list
|
||||
;;
|
||||
|
|
@ -1849,7 +1849,7 @@ test_lazy_prereq AUTOIDENT '
|
|||
'
|
||||
|
||||
test_lazy_prereq EXPENSIVE '
|
||||
test -n "$GIT_TEST_LONG"
|
||||
test_bool_env GIT_TEST_LONG false
|
||||
'
|
||||
|
||||
test_lazy_prereq EXPENSIVE_ON_WINDOWS '
|
||||
|
|
|
|||
Loading…
Reference in New Issue