aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2022-01-03 17:47:11 +0100
committerGitHub <noreply@github.com>2022-01-03 11:47:11 -0500
commitbe255557ce486b7215bd1bab1d96e8693eb477df (patch)
treedd394e7268cb7e5baf08933b44616831d9e9f17d
parent6ed9ddec29e9a3768d88fedc785b7c0e4b589d04 (diff)
downloadrneovim-be255557ce486b7215bd1bab1d96e8693eb477df.tar.gz
rneovim-be255557ce486b7215bd1bab1d96e8693eb477df.tar.bz2
rneovim-be255557ce486b7215bd1bab1d96e8693eb477df.zip
ci: simplify ci_fold function (#16874)
-rw-r--r--ci/common/suite.sh28
-rwxr-xr-xsrc/nvim/testdir/runnvim.sh4
2 files changed, 8 insertions, 24 deletions
diff --git a/ci/common/suite.sh b/ci/common/suite.sh
index 2591ea37a5..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
diff --git a/src/nvim/testdir/runnvim.sh b/src/nvim/testdir/runnvim.sh
index 25cb8437b4..fdd3f3144b 100755
--- a/src/nvim/testdir/runnvim.sh
+++ b/src/nvim/testdir/runnvim.sh
@@ -66,7 +66,7 @@ main() {(
fi
fi
if test "$FAILED" = 1 ; then
- ci_fold start "$NVIM_TEST_CURRENT_SUITE/$test_name"
+ ci_fold start "$test_name"
fi
valgrind_check .
if test -n "$LOG_DIR" ; then
@@ -78,7 +78,7 @@ main() {(
fi
rm -f "$tlog"
if test "$FAILED" = 1 ; then
- ci_fold end "$NVIM_TEST_CURRENT_SUITE/$test_name"
+ ci_fold end ""
fi
if test "$FAILED" = 1 ; then
echo "Test $test_name failed, see output above and summary for more details" >> test.log