Merge pull request #17322 from dundargoc/ci/simplify-ci-process

This commit is contained in:
James McCoy 2022-02-10 10:54:34 -05:00 committed by GitHub
commit c2ec3664e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 45 deletions

View File

@ -44,7 +44,9 @@ build_deps() {
cd "${CI_BUILD_DIR}" cd "${CI_BUILD_DIR}"
} }
prepare_build() { build_nvim() {
check_core_dumps --delete quiet
if test -n "${CLANG_SANITIZER}" ; then if test -n "${CLANG_SANITIZER}" ; then
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON" CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
fi fi
@ -53,9 +55,8 @@ prepare_build() {
cd "${BUILD_DIR}" cd "${BUILD_DIR}"
echo "Configuring with '${CMAKE_FLAGS} $@'." echo "Configuring with '${CMAKE_FLAGS} $@'."
cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}" cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}"
}
build_nvim() {
echo "Building nvim." echo "Building nvim."
if ! top_make nvim ; then if ! top_make nvim ; then
exit 1 exit 1

View File

@ -47,13 +47,7 @@ exit_suite() {
ci_fold "end" "" ci_fold "end" ""
fi fi
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}" export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}"
if test "$1" != "--continue" ; then FAILED=0
exit $FAILED
else
local saved_failed=$FAILED
FAILED=0
return $saved_failed
fi
} }
fail() { fail() {
@ -71,12 +65,6 @@ fail() {
FAILED=1 FAILED=1
} }
run_test() {
local cmd="$1"
local test_name="$2"
eval "$cmd" || fail "$test_name"
}
ended_successfully() { ended_successfully() {
if test -f "${FAIL_SUMMARY_FILE}" ; then if test -f "${FAIL_SUMMARY_FILE}" ; then
echo 'Test failed, complete summary:' echo 'Test failed, complete summary:'
@ -100,7 +88,7 @@ run_suite() {
local suite_name="$2" local suite_name="$2"
enter_suite "$suite_name" enter_suite "$suite_name"
run_test "$command" "$suite_name" eval "$command" || fail "$suite_name"
exit_suite --continue exit_suite
} }

View File

@ -87,18 +87,15 @@ check_sanitizer() {
} }
run_unittests() {( run_unittests() {(
enter_suite unittests
ulimit -c unlimited || true ulimit -c unlimited || true
if ! build_make unittest ; then if ! build_make unittest ; then
fail 'unittests' F 'Unit tests failed' fail 'unittests' F 'Unit tests failed'
fi fi
submit_coverage unittest submit_coverage unittest
check_core_dumps "$(command -v luajit)" check_core_dumps "$(command -v luajit)"
exit_suite
)} )}
run_functionaltests() {( run_functionaltests() {(
enter_suite functionaltests
ulimit -c unlimited || true ulimit -c unlimited || true
if ! build_make ${FUNCTIONALTEST}; then if ! build_make ${FUNCTIONALTEST}; then
fail 'functionaltests' F 'Functional tests failed' fail 'functionaltests' F 'Functional tests failed'
@ -107,11 +104,9 @@ run_functionaltests() {(
check_sanitizer "${LOG_DIR}" check_sanitizer "${LOG_DIR}"
valgrind_check "${LOG_DIR}" valgrind_check "${LOG_DIR}"
check_core_dumps check_core_dumps
exit_suite
)} )}
run_oldtests() {( run_oldtests() {(
enter_suite oldtests
ulimit -c unlimited || true ulimit -c unlimited || true
if ! make oldtest; then if ! make oldtest; then
reset reset
@ -121,7 +116,6 @@ run_oldtests() {(
check_sanitizer "${LOG_DIR}" check_sanitizer "${LOG_DIR}"
valgrind_check "${LOG_DIR}" valgrind_check "${LOG_DIR}"
check_core_dumps check_core_dumps
exit_suite
)} )}
check_runtime_files() {( check_runtime_files() {(
@ -146,7 +140,6 @@ check_runtime_files() {(
)} )}
install_nvim() {( install_nvim() {(
enter_suite 'install_nvim'
if ! build_make install ; then if ! build_make install ; then
fail 'install' E 'make install failed' fail 'install' E 'make install failed'
exit_suite exit_suite
@ -179,6 +172,4 @@ install_nvim() {(
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then
fail 'funcnames' F "It appears that $genvimsynf does not contain $gpat." fail 'funcnames' F "It appears that $genvimsynf does not contain $gpat."
fi fi
exit_suite
)} )}

View File

@ -8,29 +8,17 @@ source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/test.sh" source "${CI_DIR}/common/test.sh"
source "${CI_DIR}/common/suite.sh" source "${CI_DIR}/common/suite.sh"
enter_suite build run_suite 'build_nvim' 'build'
check_core_dumps --delete quiet if test "$CLANG_SANITIZER" != "TSAN"; then
prepare_build
build_nvim
exit_suite --continue
enter_suite tests
if test "$CLANG_SANITIZER" != "TSAN" ; then
# Additional threads are only created when the builtin UI starts, which # Additional threads are only created when the builtin UI starts, which
# doesn't happen in the unit/functional tests # doesn't happen in the unit/functional tests
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
run_test run_unittests unittests run_suite run_unittests unittests
fi fi
run_test run_functionaltests functionaltests run_suite run_functionaltests functionaltests
fi fi
run_test run_oldtests oldtests run_suite run_oldtests oldtests
run_suite install_nvim install_nvim
run_test install_nvim install_nvim
exit_suite --continue
end_tests end_tests