diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1a8e90932c..1c4d04da9d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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") { diff --git a/README.md b/README.md index d87bca1b8c..46489b0971 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![Build status](https://github.com/git/git/workflows/CI/badge.svg)](https://github.com/git/git/actions?query=branch%3Amaster+event%3Apush) +[![GitHub build status](https://github.com/git/git/workflows/CI/badge.svg)](https://github.com/git/git/actions?query=branch%3Amaster+event%3Apush) +[![GitLab build status](https://gitlab.com/git-scm/git/badges/master/pipeline.svg)](https://gitlab.com/git-scm/git/-/pipelines?ref=master) Git - fast, scalable, distributed revision control system ========================================================= diff --git a/ci/lib.sh b/ci/lib.sh index b939110a6e..6c52154eac 100755 --- a/ci/lib.sh +++ b/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 diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh index 033b00a364..7b9a0ca877 100755 --- a/t/t0021-conversion.sh +++ b/t/t0021-conversion.sh @@ -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 && diff --git a/t/t4141-apply-too-large.sh b/t/t4141-apply-too-large.sh index eac6f7e151..9dbed940db 100755 --- a/t/t4141-apply-too-large.sh +++ b/t/t4141-apply-too-large.sh @@ -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 ' diff --git a/t/t5608-clone-2gb.sh b/t/t5608-clone-2gb.sh index 4f8a95ddda..5d56debf1c 100755 --- a/t/t5608-clone-2gb.sh +++ b/t/t5608-clone-2gb.sh @@ -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 123456789 +0000" && - echo "committer C O Mitter 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 123456789 +0000" && + echo "committer C O Mitter 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 && diff --git a/t/t7508-status.sh b/t/t7508-status.sh index c2057bc94c..dfdd78b6fe 100755 --- a/t/t7508-status.sh +++ b/t/t7508-status.sh @@ -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 && diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh index d7f82e1bec..8a7e1306d0 100755 --- a/t/t7900-maintenance.sh +++ b/t/t7900-maintenance.sh @@ -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 /dev/null && + test_subcommand git multi-pack-index repack \ + --no-progress --batch-size=2147483647