mirror of
https://github.com/neovim/neovim.git
synced 2026-02-21 01:40:19 +10:00
test: support running functionaltests in parallel by directory (#37918)
Define a CMake target for every subdirectory of test/functional that contains functional tests, and a functionaltest_parallel target that depends on all those targets, allowing multiple test runners to run in parallel. On CI, use at most 2 parallel test runners, as using more may increase system load and make tests unstable.
This commit is contained in:
25
.github/workflows/test.yml
vendored
25
.github/workflows/test.yml
vendored
@@ -163,16 +163,29 @@ jobs:
|
||||
cmake --preset ci -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX ${{ matrix.build.flags }}
|
||||
cmake --build build
|
||||
|
||||
- if: ${{ matrix.test == 'unittest' }}
|
||||
name: unittest
|
||||
timeout-minutes: 20
|
||||
run: cmake --build build --target unittest
|
||||
|
||||
- if: ${{ matrix.test == 'functionaltest' }}
|
||||
name: functionaltest
|
||||
timeout-minutes: 20
|
||||
env:
|
||||
# With parallel tests, use shorter timeout for a single group.
|
||||
TEST_TIMEOUT: 600
|
||||
run: |
|
||||
set +e
|
||||
cmake --build build --target functionaltest_parallel -j 2 -- -k 0
|
||||
exit_code="$?"
|
||||
cmake --build build --target functionaltest_summary
|
||||
exit "$exit_code"
|
||||
|
||||
- if: ${{ matrix.test == 'oldtest' }}
|
||||
name: ${{ matrix.test }}
|
||||
name: oldtest
|
||||
timeout-minutes: 20
|
||||
run: make -C test/old/testdir NVIM_PRG=$(realpath build)/bin/nvim
|
||||
|
||||
- if: ${{ matrix.test != 'oldtest' }}
|
||||
name: ${{ matrix.test }}
|
||||
timeout-minutes: 20
|
||||
run: cmake --build build --target ${{ matrix.test }}
|
||||
|
||||
- name: Install
|
||||
run: |
|
||||
cmake --install build
|
||||
|
||||
10
.github/workflows/test_windows.yml
vendored
10
.github/workflows/test_windows.yml
vendored
@@ -54,7 +54,15 @@ jobs:
|
||||
- if: ${{ matrix.test == 'functional' }}
|
||||
name: functionaltest
|
||||
timeout-minutes: ${{ inputs.functionaltest_timeout }}
|
||||
run: cmake --build build --target functionaltest
|
||||
env:
|
||||
# With parallel tests, use shorter timeout for a single group.
|
||||
TEST_TIMEOUT: 600
|
||||
run: |
|
||||
$ErrorActionPreference = 'Continue'
|
||||
cmake --build build --target functionaltest_parallel -j 2 -- -k 0
|
||||
$exitCode = $LASTEXITCODE
|
||||
cmake --build build --target functionaltest_summary
|
||||
exit $exitCode
|
||||
|
||||
- if: ${{ matrix.test == 'old' }}
|
||||
uses: msys2/setup-msys2@v2
|
||||
|
||||
Reference in New Issue
Block a user