From aa04efcf574ac9b8b6868a6c6793b3ec937ce263 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Mon, 6 Feb 2023 23:14:41 +0100 Subject: ci: remove unhelpful helper functions for make (#22148) --- ci/common/build.sh | 21 +++------------------ ci/common/test.sh | 6 +++--- 2 files changed, 6 insertions(+), 21 deletions(-) (limited to 'ci/common') diff --git a/ci/common/build.sh b/ci/common/build.sh index 95972aab13..8b91af69b3 100644 --- a/ci/common/build.sh +++ b/ci/common/build.sh @@ -6,15 +6,6 @@ _stat() { fi } -top_make() { - printf '%78s\n' ' ' | tr ' ' '=' - ninja "$@" -} - -build_make() { - top_make -C "${BUILD_DIR}" "$@" -} - build_deps() { if test "${FUNCTIONALTEST}" = "functionaltest-lua" ; then DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON" @@ -35,9 +26,7 @@ build_deps() { # shellcheck disable=SC2086 CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${CI_BUILD_DIR}/cmake.deps/" - if ! top_make; then - exit 1 - fi + ninja || exit 1 cd "${CI_BUILD_DIR}" } @@ -56,15 +45,11 @@ build_nvim() { cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}" echo "Building nvim." - if ! top_make nvim ; then - exit 1 - fi + ninja nvim || exit 1 if test "$CLANG_SANITIZER" != "TSAN" ; then echo "Building libnvim." - if ! top_make libnvim ; then - exit 1 - fi + ninja libnvim || exit 1 fi # Invoke nvim to trigger *San early. diff --git a/ci/common/test.sh b/ci/common/test.sh index 326ec162c3..03d85067be 100644 --- a/ci/common/test.sh +++ b/ci/common/test.sh @@ -90,7 +90,7 @@ check_sanitizer() { unittests() {( ulimit -c unlimited || true - if ! build_make unittest ; then + if ! ninja -C "${BUILD_DIR}" unittest; then fail 'unittests' 'Unit tests failed' fi submit_coverage unittest @@ -99,7 +99,7 @@ unittests() {( functionaltests() {( ulimit -c unlimited || true - if ! build_make "${FUNCTIONALTEST}"; then + if ! ninja -C "${BUILD_DIR}" "${FUNCTIONALTEST}"; then fail 'functionaltests' 'Functional tests failed' fi submit_coverage functionaltest @@ -140,7 +140,7 @@ check_runtime_files() {( )} install_nvim() {( - if ! build_make install ; then + if ! ninja -C "${BUILD_DIR}" install; then fail 'install' 'make install failed' exit 1 fi -- cgit From 3170e05d5743c5b46b14058f3c0702b4d7a43320 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Mon, 6 Feb 2023 23:42:03 +0100 Subject: build: don't build libnvim when running the CI (#22149) It shouldn't be sneakily run alongside the nvim build. If it's to be used it should be done in a separate step. --- ci/common/build.sh | 5 ----- 1 file changed, 5 deletions(-) (limited to 'ci/common') diff --git a/ci/common/build.sh b/ci/common/build.sh index 8b91af69b3..b1ea2270c0 100644 --- a/ci/common/build.sh +++ b/ci/common/build.sh @@ -47,11 +47,6 @@ build_nvim() { echo "Building nvim." ninja nvim || exit 1 - if test "$CLANG_SANITIZER" != "TSAN" ; then - echo "Building libnvim." - ninja libnvim || exit 1 - fi - # Invoke nvim to trigger *San early. if ! (bin/nvim --version && bin/nvim -u NONE -e -cq | cat -vet) ; then check_sanitizer "${LOG_DIR}" -- cgit From adae075fcffe0b5d1a790c41c083b78db27ba80b Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Tue, 7 Feb 2023 09:27:51 +0100 Subject: ci: remove unnecessary variables and functions (#22150) --- ci/common/build.sh | 58 ------------------------------------------------------ ci/common/suite.sh | 5 ----- ci/common/test.sh | 3 +-- 3 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 ci/common/build.sh (limited to 'ci/common') diff --git a/ci/common/build.sh b/ci/common/build.sh deleted file mode 100644 index b1ea2270c0..0000000000 --- a/ci/common/build.sh +++ /dev/null @@ -1,58 +0,0 @@ -_stat() { - if test "${CI_OS_NAME}" = osx ; then - stat -f %Sm "${@}" - else - stat -c %y "${@}" - fi -} - -build_deps() { - if test "${FUNCTIONALTEST}" = "functionaltest-lua" ; then - DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON" - fi - - mkdir -p "${DEPS_BUILD_DIR}" - - # Use cached dependencies if $CACHE_MARKER exists. - if test -f "${CACHE_MARKER}"; then - echo "Using third-party dependencies from cache (last update: $(_stat "${CACHE_MARKER}"))." - cp -a "${CACHE_NVIM_DEPS_DIR}"/. "${DEPS_BUILD_DIR}" - fi - - # Even if we're using cached dependencies, run CMake and make to - # update CMake configuration and update to newer deps versions. - cd "${DEPS_BUILD_DIR}" - echo "Configuring with '${DEPS_CMAKE_FLAGS}'." - # shellcheck disable=SC2086 - CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${CI_BUILD_DIR}/cmake.deps/" - - ninja || exit 1 - - cd "${CI_BUILD_DIR}" -} - -build_nvim() { - check_core_dumps --delete quiet - - if test -n "${CLANG_SANITIZER}" ; then - CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON" - fi - - mkdir -p "${BUILD_DIR}" - cd "${BUILD_DIR}" - echo "Configuring with '${CMAKE_FLAGS} $*'." - # shellcheck disable=SC2086 - cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}" - - echo "Building nvim." - ninja nvim || exit 1 - - # Invoke nvim to trigger *San early. - if ! (bin/nvim --version && bin/nvim -u NONE -e -cq | cat -vet) ; then - check_sanitizer "${LOG_DIR}" - exit 1 - fi - check_sanitizer "${LOG_DIR}" - - cd "${CI_BUILD_DIR}" -} diff --git a/ci/common/suite.sh b/ci/common/suite.sh index c81261d2e7..9c3056baaf 100644 --- a/ci/common/suite.sh +++ b/ci/common/suite.sh @@ -34,8 +34,3 @@ ended_successfully() { fi return 0 } - -end_tests() { - touch "${END_MARKER}" - ended_successfully -} diff --git a/ci/common/test.sh b/ci/common/test.sh index 03d85067be..c3b8d45b9f 100644 --- a/ci/common/test.sh +++ b/ci/common/test.sh @@ -1,4 +1,3 @@ -. "${CI_DIR}/common/build.sh" . "${CI_DIR}/common/suite.sh" submit_coverage() { @@ -84,7 +83,7 @@ valgrind_check() { check_sanitizer() { if test -n "${CLANG_SANITIZER}"; then - check_logs "${1}" "*san.*" | ${SYMBOLIZER:-cat} + check_logs "${1}" "*san.*" | cat fi } -- cgit From 0fc9a232e09d1b246b2d6bb5b862e63aa623e825 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Wed, 8 Feb 2023 16:21:50 +0100 Subject: ci: remove unnecessary END_MARKER variable (#22171) --- ci/common/suite.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'ci/common') diff --git a/ci/common/suite.sh b/ci/common/suite.sh index 9c3056baaf..d13546823b 100644 --- a/ci/common/suite.sh +++ b/ci/common/suite.sh @@ -1,8 +1,6 @@ -# Test success marker. If END_MARKER file exists, we know that all tests -# finished. If FAIL_SUMMARY_FILE exists we know that some tests failed, this -# file will contain information about failed tests. Build is considered -# successful if tests ended without any of them failing. -END_MARKER="$BUILD_DIR/.tests_finished" +# If FAIL_SUMMARY_FILE exists we know that some tests failed, this file will +# contain information about failed tests. Build is considered successful if +# tests ended without any of them failing. FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors" fail() { @@ -28,9 +26,5 @@ ended_successfully() { return 1 fi - if ! test -f "${END_MARKER}" ; then - echo 'ended_successfully called before end marker was touched' - return 1 - fi return 0 } -- cgit From 2294210660056df2f8abb277776cfd68f3fb1156 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Wed, 8 Feb 2023 18:32:17 +0100 Subject: ci: remove fail summary (#22174) The tests already have a summary at the end, there's no need for an additional fail summary wrapper. --- ci/common/suite.sh | 30 ------------------------------ ci/common/test.sh | 14 +++++++++++--- 2 files changed, 11 insertions(+), 33 deletions(-) delete mode 100644 ci/common/suite.sh (limited to 'ci/common') diff --git a/ci/common/suite.sh b/ci/common/suite.sh deleted file mode 100644 index d13546823b..0000000000 --- a/ci/common/suite.sh +++ /dev/null @@ -1,30 +0,0 @@ -# If FAIL_SUMMARY_FILE exists we know that some tests failed, this file will -# contain information about failed tests. Build is considered successful if -# tests ended without any of them failing. -FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors" - -fail() { - local test_name="$1" - local message="$2" - - : "${message:=Test $test_name failed}" - - local full_msg="$test_name :: $message" - echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}" - echo "Failed: $full_msg" - export FAILED=1 -} - -ended_successfully() { - if test -f "${FAIL_SUMMARY_FILE}" ; then - echo 'Test failed, complete summary:' - cat "${FAIL_SUMMARY_FILE}" - - if [[ "$GITHUB_ACTIONS" == "true" ]]; then - rm -f "$FAIL_SUMMARY_FILE" - fi - - return 1 - fi - return 0 -} diff --git a/ci/common/test.sh b/ci/common/test.sh index c3b8d45b9f..f6e20d8f59 100644 --- a/ci/common/test.sh +++ b/ci/common/test.sh @@ -1,4 +1,13 @@ -. "${CI_DIR}/common/suite.sh" +fail() { + local test_name="$1" + local message="$2" + + : "${message:=Test $test_name failed}" + + local full_msg="$test_name :: $message" + echo "Failed: $full_msg" + exit 1 +} submit_coverage() { if [ -n "${GCOV}" ]; then @@ -124,7 +133,7 @@ check_runtime_files() {( local message="$1" ; shift local tst="$1" ; shift - cd runtime + cd runtime || exit for file in $(git ls-files "$@") ; do # Check that test is not trying to work with files with spaces/etc # Prefer failing the build over using more robust construct because files @@ -141,7 +150,6 @@ check_runtime_files() {( install_nvim() {( if ! ninja -C "${BUILD_DIR}" install; then fail 'install' 'make install failed' - exit 1 fi "${INSTALL_PREFIX}/bin/nvim" --version -- cgit From ad00b034261dac70f728012339bd05fc89f8e90e Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Thu, 9 Feb 2023 11:04:02 +0100 Subject: build: remove codecov related files (#20859) These aren't needed as we don't use codecov anymore. --- ci/common/submit_coverage.sh | 56 -------------------------------------------- ci/common/test.sh | 9 ------- 2 files changed, 65 deletions(-) delete mode 100755 ci/common/submit_coverage.sh (limited to 'ci/common') diff --git a/ci/common/submit_coverage.sh b/ci/common/submit_coverage.sh deleted file mode 100755 index f781ca8e5e..0000000000 --- a/ci/common/submit_coverage.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -# Collect and submit coverage reports. -# -# Args: -# $1: Flag(s) for codecov, separated by comma. - -set -e - -# Change to grandparent dir (POSIXly). -CDPATH='' cd -P -- "$(dirname -- "$0")/../.." || exit - -echo "=== running submit_coverage in $PWD: $* ===" -"$GCOV" --version - -# Download/install codecov-bash and gcovr once. -codecov_sh="${TEMP:-/tmp}/codecov.bash" -if ! [ -f "$codecov_sh" ]; then - curl --retry 5 --silent --fail -o "$codecov_sh" https://codecov.io/bash - chmod +x "$codecov_sh" - - python -m pip install --quiet --user gcovr -fi - -( - cd build - python -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 --exclude '.*/auto/.*' --root .. --delete -o ../coverage.xml --xml -) - -# Upload to codecov. -# -X gcov: disable gcov, done manually above. -# -X fix: disable fixing of reports (not necessary, rather slow) -# -Z: exit non-zero on failure -# -F: flag(s) -# NOTE: ignoring flags for now, since this causes timeouts on codecov.io then, -# which they know about for about a year already... -# Flags must match pattern ^[\w\,]+$ ("," as separator). -codecov_flags="$(uname -s),${1}" -codecov_flags=$(echo "$codecov_flags" | sed 's/[^,_a-zA-Z0-9]/_/g') -if ! "$codecov_sh" -f coverage.xml -X gcov -X fix -Z -F "${codecov_flags}"; then - echo "codecov upload failed." -fi - -# Cleanup always, especially collected data. -find . \( -name '*.gcov' -o -name '*.gcda' \) -ls -delete | wc -l -rm -f coverage.xml - -# Upload Lua coverage (generated manually on AppVeyor/Windows). -if [ "$USE_LUACOV" = 1 ] && [ "$1" != "oldtest" ]; then - if [ -x "${DEPS_BUILD_DIR}/usr/bin/luacov" ]; then - "${DEPS_BUILD_DIR}/usr/bin/luacov" - fi - if ! "$codecov_sh" -f luacov.report.out -X gcov -X fix -Z -F "lua,${codecov_flags}"; then - echo "codecov upload failed." - fi - rm luacov.stats.out -fi diff --git a/ci/common/test.sh b/ci/common/test.sh index f6e20d8f59..5ef7dc4024 100644 --- a/ci/common/test.sh +++ b/ci/common/test.sh @@ -9,12 +9,6 @@ fail() { exit 1 } -submit_coverage() { - if [ -n "${GCOV}" ]; then - "${CI_DIR}/common/submit_coverage.sh" "$@" || echo 'codecov upload failed.' - fi -} - print_core() { local app="$1" local core="$2" @@ -101,7 +95,6 @@ unittests() {( if ! ninja -C "${BUILD_DIR}" unittest; then fail 'unittests' 'Unit tests failed' fi - submit_coverage unittest check_core_dumps "$(command -v luajit)" )} @@ -110,7 +103,6 @@ functionaltests() {( if ! ninja -C "${BUILD_DIR}" "${FUNCTIONALTEST}"; then fail 'functionaltests' 'Functional tests failed' fi - submit_coverage functionaltest check_sanitizer "${LOG_DIR}" valgrind_check "${LOG_DIR}" check_core_dumps @@ -122,7 +114,6 @@ oldtests() {( reset fail 'oldtests' 'Legacy tests failed' fi - submit_coverage oldtest check_sanitizer "${LOG_DIR}" valgrind_check "${LOG_DIR}" check_core_dumps -- cgit From fe1e6b82f4f3ff3d919d1243f37e9216781bb786 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Fri, 10 Feb 2023 00:42:37 +0100 Subject: ci: inline test.sh to run_tests.sh (#22198) This will get rid of the common/ directory. --- ci/common/test.sh | 173 ------------------------------------------------------ 1 file changed, 173 deletions(-) delete mode 100644 ci/common/test.sh (limited to 'ci/common') diff --git a/ci/common/test.sh b/ci/common/test.sh deleted file mode 100644 index 5ef7dc4024..0000000000 --- a/ci/common/test.sh +++ /dev/null @@ -1,173 +0,0 @@ -fail() { - local test_name="$1" - local message="$2" - - : "${message:=Test $test_name failed}" - - local full_msg="$test_name :: $message" - echo "Failed: $full_msg" - exit 1 -} - -print_core() { - local app="$1" - local core="$2" - if test "$app" = quiet ; then - echo "Found core $core" - return 0 - fi - echo "======= Core file $core =======" - if test "${CI_OS_NAME}" = osx ; then - lldb -Q -o "bt all" -f "${app}" -c "${core}" - else - gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}" - fi -} - -check_core_dumps() { - local del= - if test "$1" = "--delete" ; then - del=1 - shift - fi - local app="${1:-${BUILD_DIR}/bin/nvim}" - local cores - if test "${CI_OS_NAME}" = osx ; then - cores="$(find /cores/ -type f -print)" - local _sudo='sudo' - else - cores="$(find ./ -type f \( -name 'core.*' -o -name core -o -name nvim.core \) -print)" - local _sudo= - fi - - if test -z "${cores}" ; then - return - fi - local core - for core in $cores; do - if test "$del" = "1" ; then - print_core "$app" "$core" >&2 - "$_sudo" rm "$core" - else - print_core "$app" "$core" - fi - done - if test "$app" != quiet ; then - fail 'cores' 'Core dumps found' - fi -} - -check_logs() { - # Iterate through each log to remove an useless warning. - # shellcheck disable=SC2044 - for log in $(find "${1}" -type f -name "${2}"); do - sed -i "${log}" \ - -e '/Warning: noted but unhandled ioctl/d' \ - -e '/could cause spurious value errors to appear/d' \ - -e '/See README_MISSING_SYSCALL_OR_IOCTL for guidance/d' - done - - # Now do it again, but only consider files with size > 0. - local err="" - # shellcheck disable=SC2044 - for log in $(find "${1}" -type f -name "${2}" -size +0); do - cat "${log}" - err=1 - rm "${log}" - done - if test -n "${err}" ; then - fail 'logs' 'Runtime errors detected.' - fi -} - -valgrind_check() { - check_logs "${1}" "valgrind-*" -} - -check_sanitizer() { - if test -n "${CLANG_SANITIZER}"; then - check_logs "${1}" "*san.*" | cat - fi -} - -unittests() {( - ulimit -c unlimited || true - if ! ninja -C "${BUILD_DIR}" unittest; then - fail 'unittests' 'Unit tests failed' - fi - check_core_dumps "$(command -v luajit)" -)} - -functionaltests() {( - ulimit -c unlimited || true - if ! ninja -C "${BUILD_DIR}" "${FUNCTIONALTEST}"; then - fail 'functionaltests' 'Functional tests failed' - fi - check_sanitizer "${LOG_DIR}" - valgrind_check "${LOG_DIR}" - check_core_dumps -)} - -oldtests() {( - ulimit -c unlimited || true - if ! make oldtest; then - reset - fail 'oldtests' 'Legacy tests failed' - fi - check_sanitizer "${LOG_DIR}" - valgrind_check "${LOG_DIR}" - check_core_dumps -)} - -check_runtime_files() {( - local test_name="$1" ; shift - local message="$1" ; shift - local tst="$1" ; shift - - cd runtime || exit - for file in $(git ls-files "$@") ; do - # Check that test is not trying to work with files with spaces/etc - # Prefer failing the build over using more robust construct because files - # with IFS are not welcome. - if ! test -e "$file" ; then - fail "$test_name" "It appears that $file is only a part of the file name" - fi - if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then - fail "$test_name" "$(printf "%s%s" "$message" "$file")" - fi - done -)} - -install_nvim() {( - if ! ninja -C "${BUILD_DIR}" install; then - fail 'install' 'make install failed' - fi - - "${INSTALL_PREFIX}/bin/nvim" --version - if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then - echo "Running ':help' in the installed nvim failed." - echo "Maybe the helptags have not been generated properly." - fail 'help' 'Failed running :help' - fi - - # Check that all runtime files were installed - check_runtime_files \ - 'runtime-install' \ - 'It appears that %s is not installed.' \ - -e \ - '*.vim' '*.ps' '*.dict' '*.py' '*.tutor' - - # Check that some runtime files are installed and are executables - check_runtime_files \ - 'not-exe' \ - 'It appears that %s is not installed or is not executable.' \ - -x \ - '*.awk' '*.sh' '*.bat' - - # Check that generated syntax file has function names, #5060. - local genvimsynf=syntax/vim/generated.vim - local gpat='syn keyword vimFuncName .*eval' - if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then - fail 'funcnames' "It appears that $genvimsynf does not contain $gpat." - fi -)} -- cgit