]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0827: CI: tests can be improved v9.1.0827
authorAliaksei Budavei <0x000c70@gmail.com>
Sat, 2 Nov 2024 14:51:14 +0000 (15:51 +0100)
committerChristian Brabandt <cb@256bit.org>
Sat, 2 Nov 2024 14:51:14 +0000 (15:51 +0100)
Problem:  CI: tests can be improved
Solution: collect failed indent tests, raise timeout for search()
          functions when using ASAN/Valgrind (Aliaksei Budavei)

ASan-instrumented Vim builds tend to run slower (x2) than
non-instrumented Vim builds and occasionally make indent
tests fail when "search*()" functions time out and give up
further execution.

Reference:
https://github.com/google/sanitizers/wiki/AddressSanitizer

closes: #15974

Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
.cirrus.yml
.github/actions/test_artifacts/action.yml [moved from .github/actions/screendump/action.yml with 86% similarity]
.github/workflows/ci.yml
Filelist
src/testdir/runtest.vim
src/testdir/shared.vim
src/version.c

index ec897b809da7e3ef26970cdc85acefbcba3473c7..e81ed84d7561154ab6e4e9e155fee8d16c20dc86 100644 (file)
@@ -22,9 +22,10 @@ freebsd_task:
     - chown -R cirrus:cirrus .
     - sudo -u cirrus make test
   on_failure:
-    screendump_artifacts:
+    test_artifacts:
       name: "Cirrus-CI-freebsd-failed-tests"
       path: |
+        runtime/indent/testdir/*.fail
         runtime/syntax/testdir/failed/*
         src/testdir/failed/*
       type: application/octet-stream
similarity index 86%
rename from .github/actions/screendump/action.yml
rename to .github/actions/test_artifacts/action.yml
index 5cbc8200c0b6bc5bfd0a9926e9a55ced4996a93d..44738c505ed4685eaa75126a2d93e5dd262cd586 100644 (file)
@@ -1,5 +1,5 @@
-name: 'screendump'
-description: "Upload failed screendump tests"
+name: 'test_artifacts'
+description: "Upload failed test artifacts"
 runs:
   using: "composite"
   steps:
@@ -12,6 +12,7 @@ runs:
         # A file, directory or wildcard pattern that describes what
         # to upload.
         path: |
+         ${{ github.workspace }}/runtime/indent/testdir/*.fail
          ${{ github.workspace }}/runtime/syntax/testdir/failed/*
          ${{ github.workspace }}/src/testdir/failed/*
         # The desired behavior if no files are found using the
index df1041851de90a1b5f573eb7d70de56cc7e4a853..19edd13eac50465be13995d0a0a4b1053318ff4e 100644 (file)
@@ -272,7 +272,7 @@ jobs:
           do_test make ${SHADOWOPT} ${TEST}
 
       - if: ${{ !cancelled() }}
-        uses: ./.github/actions/screendump
+        uses: ./.github/actions/test_artifacts
 
       - name: Vim tags
         if: contains(matrix.extra, 'vimtags')
@@ -394,7 +394,7 @@ jobs:
           make ${TEST}
 
       - if: ${{ !cancelled() }}
-        uses: ./.github/actions/screendump
+        uses: ./.github/actions/test_artifacts
 
   windows:
     runs-on: windows-2022
@@ -704,7 +704,7 @@ jobs:
           )
 
       - if: ${{ !cancelled() }}
-        uses: ./.github/actions/screendump
+        uses: ./.github/actions/test_artifacts
 
       - name: Generate gcov files
         if: matrix.coverage
index 803de2ae0ed38a33ba0624db8f1fc20db8fcbce0..9b061738114846f3ba09549238f49af78ef44e35 100644 (file)
--- a/Filelist
+++ b/Filelist
@@ -10,8 +10,8 @@ SRC_ALL =     \
                .github/ISSUE_TEMPLATE/feature_request.md \
                .github/workflows/ci.yml \
                .github/workflows/codeql-analysis.yml \
-               .github/actions/screendump/action.yml \
                .github/workflows/coverity.yml \
+               .github/actions/test_artifacts/action.yml \
                .github/dependabot.yml \
                .gitignore \
                .hgignore \
index ded31975b80ba7a76a0a25bb898d3260cf87384c..9bb500e2657ef24242649c93acd80c8813f65885 100644 (file)
@@ -247,6 +247,11 @@ func RunTheTest(test)
     let g:timeout_start = localtime()
   endif
 
+  if ValgrindOrAsan()
+    let g:vim_indent = {"searchpair_timeout": 1024}
+    let g:python_indent = {"searchpair_timeout": 1024}
+  endif
+
   " Avoid stopping at the "hit enter" prompt
   set nomore
 
index 1edf65ac88b9730051d5af20ae95781e9cfc8944..a9b422c30eaf31ba1c3d9b50d5d26d690903f342 100644 (file)
@@ -318,6 +318,14 @@ func RunningWithValgrind()
   return GetVimCommand() =~ '\<valgrind\>'
 endfunc
 
+func RunningAsan()
+  return exists("$ASAN_OPTIONS")
+endfunc
+
+func ValgrindOrAsan()
+  return RunningWithValgrind() || RunningAsan()
+endfun
+
 " Get the command to run Vim, with --clean instead of "-u NONE".
 func GetVimCommandClean()
   let cmd = GetVimCommand()
index 493de72f683ef483c0faa4cbe7557b525aeae6f3..4aa4ab7ed2e86980fd5151b5dcf3e4fedb4b95c9 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    827,
 /**/
     826,
 /**/