diff options
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/before_install.sh | 46 | ||||
-rwxr-xr-x | ci/before_script.sh | 13 | ||||
-rw-r--r-- | ci/common/suite.sh | 121 | ||||
-rwxr-xr-x | ci/install.sh | 11 | ||||
-rwxr-xr-x | ci/run_lint.sh | 7 | ||||
-rwxr-xr-x | ci/run_tests.sh | 4 | ||||
-rwxr-xr-x | ci/script.sh | 9 |
7 files changed, 8 insertions, 203 deletions
diff --git a/ci/before_install.sh b/ci/before_install.sh deleted file mode 100755 index f12f972fe0..0000000000 --- a/ci/before_install.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -echo 'Python info:' -( - set -x - python3 --version - python2 --version - python --version - pip3 --version - pip2 --version - pip --version - - pyenv --version - pyenv versions -) 2>&1 | sed 's/^/ /' || true - -# Use pyenv, but not for OSX on Travis, where it only has the "system" version. -if [[ "${TRAVIS_OS_NAME}" != osx ]] && command -v pyenv; then - echo 'Setting Python versions via pyenv' - - # Prefer Python 2 over 3 (more conservative). - pyenv global 2.7:3.8 - - echo 'Updated Python info:' - ( - set -x - python3 --version - python2 --version - python --version - - python3 -m pip --version - python2 -m pip --version - ) 2>&1 | sed 's/^/ /' -fi - -echo "Install node (LTS)" - -if [[ "${TRAVIS_OS_NAME}" == osx ]] || [ ! -f ~/.nvm/nvm.sh ]; then - curl -o ~/.nvm/nvm.sh https://raw.githubusercontent.com/creationix/nvm/master/nvm.sh -fi - -source ~/.nvm/nvm.sh -nvm install 10 diff --git a/ci/before_script.sh b/ci/before_script.sh index 701fe1d9eb..f7216338d4 100755 --- a/ci/before_script.sh +++ b/ci/before_script.sh @@ -6,12 +6,6 @@ set -o pipefail CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${CI_DIR}/common/build.sh" -# Enable ipv6 on Travis. ref: a39c8b7ce30d -if test -n "${TRAVIS_OS_NAME}" && ! test "${TRAVIS_OS_NAME}" = osx ; then - echo "before_script.sh: enable ipv6" - sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 -fi - # Test some of the configuration variables. if [[ -n "${GCOV}" ]] && [[ ! $(type -P "${GCOV}") ]]; then echo "\$GCOV: '${GCOV}' is not executable." @@ -27,13 +21,6 @@ ccache -s # Reset ccache stats for real results in before_cache. ccache --zero-stats -if [[ "${TRAVIS_OS_NAME}" == osx ]]; then - # Adds user to a dummy group. - # That allows to test changing the group of the file by `os_fchown`. - sudo dscl . -create /Groups/chown_test - sudo dscl . -append /Groups/chown_test GroupMembership "${USER}" -fi - # Compile dependencies. build_deps diff --git a/ci/common/suite.sh b/ci/common/suite.sh index 038b116c5a..561849ce2d 100644 --- a/ci/common/suite.sh +++ b/ci/common/suite.sh @@ -11,22 +11,10 @@ FAIL_SUMMARY="" END_MARKER="$BUILD_DIR/.tests_finished" FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors" -ANSI_CLEAR="\033[0K" - -if test "$TRAVIS" = "true"; then - ci_fold() { - local action="$1" - local name="$2" - name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')" - name="$(echo -n "$name" | sed 's/-$//')" - echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}" - } -elif test "$GITHUB_ACTIONS" = "true"; then - ci_fold() { +ci_fold() { + if test "$GITHUB_ACTIONS" = "true"; then local action="$1" local name="$2" - name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')" - name="$(echo -n "$name" | sed 's/-$//')" case "$action" in start) echo "::group::${name}" @@ -37,12 +25,8 @@ elif test "$GITHUB_ACTIONS" = "true"; then *) :;; esac - } -else - ci_fold() { - return 0 - } -fi + fi +} enter_suite() { set +x @@ -50,7 +34,7 @@ enter_suite() { rm -f "${END_MARKER}" local suite_name="$1" export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE}/$suite_name" - ci_fold start "${NVIM_TEST_CURRENT_SUITE}" + ci_fold "start" "$suite_name" set -x } @@ -60,7 +44,7 @@ exit_suite() { echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:" echo "${FAIL_SUMMARY}" else - ci_fold end "${NVIM_TEST_CURRENT_SUITE}" + ci_fold "end" "" fi export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}" if test "$1" != "--continue" ; then @@ -98,99 +82,6 @@ run_test() { fi } -run_test_wd() { - local hang_ok= - if test "$1" = "--allow-hang" ; then - hang_ok=1 - shift - fi - - local timeout="$1" - test $# -gt 0 && shift - - local cmd="$1" - test $# -gt 0 && shift - - local restart_cmd="$1" - : ${restart_cmd:=true} - test $# -gt 0 && shift - - local test_name="$1" - : ${test_name:=$cmd} - test $# -gt 0 && shift - - local output_file="$(mktemp)" - local status_file="$(mktemp)" - local sid_file="$(mktemp)" - - local restarts=5 - local prev_tmpsize=-1 - while test $restarts -gt 0 ; do - : > "$status_file" - : > "$sid_file" - setsid \ - env \ - output_file="$output_file" \ - status_file="$status_file" \ - sid_file="$sid_file" \ - cmd="$cmd" \ - CI_DIR="$CI_DIR" \ - sh -c ' - . "${CI_DIR}/common/test.sh" - ps -o sid= > "$sid_file" - ( - ret=0 - if ! eval "$cmd" 2>&1 ; then - ret=1 - fi - echo "$ret" > "$status_file" - ) | tee -a "$output_file" - ' - while test "$(stat -c "%s" "$status_file")" -eq 0 ; do - prev_tmpsize=$tmpsize - sleep $timeout - tmpsize="$(stat -c "%s" "$output_file")" - if test $tempsize -eq $prev_temsize ; then - # no output, assuming either hang or exit - break - fi - done - restarts=$(( restarts - 1 )) - if test "$(stat -c "%s" "$status_file")" -eq 0 ; then - # Status file not updated, assuming hang - - # SID not known, this should not ever happen - if test "$(stat -c "%s" "$sid_file")" -eq 0 ; then - fail "$test_name" E "Shell did not run" - break - fi - - # Kill all processes which belong to one session: should get rid of test - # processes as well as sh itself. - pkill -KILL -s$(cat "$sid_file") - - if test $restarts -eq 0 ; then - if test -z "$hang_ok" ; then - fail "$test_name" E "Test hang up" - fi - else - echo "Test ${test_name} hang up, restarting" - eval "$restart_cmd" - fi - else - local new_failed="$(cat "$status_file")" - if test "$new_failed" != "0" ; then - fail "$test_name" F "Test failed in run_test_wd" - fi - break - fi - done - - rm -f "$output_file" - rm -f "$status_file" - rm -f "$sid_file" -} - ended_successfully() { if test -f "${FAIL_SUMMARY_FILE}" ; then echo 'Test failed, complete summary:' diff --git a/ci/install.sh b/ci/install.sh index 1edc1138ee..bd42274b49 100755 --- a/ci/install.sh +++ b/ci/install.sh @@ -3,15 +3,6 @@ set -e set -o pipefail -if [[ "${CI_TARGET}" == lint ]]; then - python3 -m pip -q install --user --upgrade flake8 - exit -fi - -if [[ "${TRAVIS_OS_NAME}" == osx ]]; then - export PATH="/usr/local/opt/ccache/libexec:$PATH" -fi - # Use default CC to avoid compilation problems when installing Python modules. echo "Install neovim module for Python 3." CC=cc python3 -m pip -q install --user --upgrade pynvim @@ -24,8 +15,6 @@ echo "Install neovim RubyGem." gem install --no-document --bindir "$HOME/.local/bin" --user-install --pre neovim echo "Install neovim npm package" -source ~/.nvm/nvm.sh -nvm use 10 npm install -g neovim npm link neovim diff --git a/ci/run_lint.sh b/ci/run_lint.sh index 8373a3cb36..314976edc2 100755 --- a/ci/run_lint.sh +++ b/ci/run_lint.sh @@ -25,12 +25,7 @@ run_test 'make shlint' shlint exit_suite --continue enter_suite single-includes -CLICOLOR_FORCE=1 run_test_wd \ - --allow-hang \ - 10s \ - 'make check-single-includes' \ - 'csi_clean' \ - single-includes +run_test 'make check-single-includes' single-includes exit_suite --continue end_tests diff --git a/ci/run_tests.sh b/ci/run_tests.sh index d91ac5589e..c175910da5 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -17,10 +17,6 @@ build_nvim exit_suite --continue -source ~/.nvm/nvm.sh -nvm use 10 - - enter_suite tests if test "$CLANG_SANITIZER" != "TSAN" ; then diff --git a/ci/script.sh b/ci/script.sh index c8025ce34d..74fc4eda6c 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -3,14 +3,7 @@ set -e set -o pipefail -# This will pass the environment variables down to a bash process which runs -# as $USER, while retaining the environment variables defined and belonging -# to secondary groups given above in usermod. -if [[ "${TRAVIS_OS_NAME}" == osx ]]; then - sudo -E su "${USER}" -c "ci/run_${CI_TARGET}.sh" -else - ci/run_${CI_TARGET}.sh -fi +ci/run_${CI_TARGET}.sh if [[ -s "${GCOV_ERROR_FILE}" ]]; then echo '=== Unexpected gcov errors: ===' |