]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gitlab-ci: enable "GIT_TEST_LONG"
authorPatrick Steinhardt <ps@pks.im>
Mon, 6 Jul 2026 06:24:04 +0000 (08:24 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Jul 2026 14:21:57 +0000 (07:21 -0700)
Starting with 7a094d68a2 (ci: run expensive tests on push builds to
integration branches, 2026-05-08) we run expensive tests in our CI for
certain events. So far, this has only been wired up for GitHub Workflows
though, which creates a test gap for GitLab CI.

Plug this gap by also making this work for the latter.

Note that these tests cannot be run on the Windows runners, as they only
have 7.5GB of RAM. This is insufficient for some of the EXPENSIVE tests,
so we explicitly disable "GIT_TEST_LONG" on these jobs.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.gitlab-ci.yml
ci/lib.sh

index a4aebe8b719ca8e1b84c8dffeea578df9d0a54b4..1c4d04da9dcd4c1d44aaa026b1258d68d1220db9 100644 (file)
@@ -147,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'
@@ -195,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") {
index 01a0bc6b7557e5ca81c8e4f4428bb734154763e4..6c52154eac11e90980bbe5cff5d4af10ab44c6a8 100755 (executable)
--- 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=true
+       export GIT_TEST_LONG=${GIT_TEST_LONG:-true}
        ;;
 esac