testing sleepy tests in CI

This commit is contained in:
Jorge Morante 2017-04-21 09:01:12 +02:00
parent 39b8dcc89a
commit 36f946b1c9
4 changed files with 16 additions and 7 deletions

View File

@ -9,11 +9,11 @@ function test_clean_up() {
function tmux_send() { function tmux_send() {
local key=$1 local key=$1
sleep 0.5 tmuxomatic__sleep 1
tmuxomatic send-keys "$TMUX_PREFIX" tmuxomatic send-keys "$TMUX_PREFIX"
sleep 0.5 tmuxomatic__sleep 1
tmuxomatic send-keys "$key" tmuxomatic send-keys "$key"
sleep 0.5 tmuxomatic__sleep 1
} }
function tmux_paste() { function tmux_paste() {
@ -33,11 +33,11 @@ function init_pane_fish() {
function invoke_fingers() { function invoke_fingers() {
tmux_send "F" tmux_send "F"
sleep 1.0 tmuxomatic__sleep 1
} }
function echo_yanked() { function echo_yanked() {
sleep 0.5 tmuxomatic__sleep 1
tmuxomatic__exec "clear" tmuxomatic__exec "clear"
tmuxomatic send-keys "echo yanked text is " tmuxomatic send-keys "echo yanked text is "
tmux_paste tmux_paste

View File

@ -17,6 +17,7 @@ tmuxomatic__exec "cat ./test/fixtures/grep-output"
invoke_fingers invoke_fingers
tmuxomatic send-keys C-c tmuxomatic send-keys C-c
tmuxomatic__sleep 1
tmuxomatic__exec "echo \"current pane is \$(tmux list-panes -F '#{?window_zoomed_flag,zoomed,not_zoomed}' | head -1)\"" tmuxomatic__exec "echo \"current pane is \$(tmux list-panes -F '#{?window_zoomed_flag,zoomed,not_zoomed}' | head -1)\""
tmuxomatic__expect "current pane is zoomed" tmuxomatic__expect "current pane is zoomed"

View File

@ -13,7 +13,7 @@ tmuxomatic__exec "cat ./test/fixtures/grep-output"
invoke_fingers invoke_fingers
tmuxomatic send-keys "i" tmuxomatic send-keys "i"
sleep 10 tmuxomatic__sleep 1
tmuxomatic__exec "cat /tmp/tmux-yank-result" tmuxomatic__exec "cat /tmp/tmux-yank-result"
tmuxomatic__expect "tmux-yank yolo" tmuxomatic__expect "tmux-yank yolo"

View File

@ -58,7 +58,7 @@ function tmuxomatic__expect() {
TMUXOMATIC_EXIT_CODE=0 TMUXOMATIC_EXIT_CODE=0
break break
fi fi
sleep 0.5 tmuxomatic__sleep 1
done done
if [[ $n_matches -le 0 ]]; then if [[ $n_matches -le 0 ]]; then
@ -75,6 +75,14 @@ function tmuxomatic__expect() {
fi fi
} }
function tmuxomatic__sleep() {
if [[ -z $CI ]]; then
sleep "$1"
else
sleep "$(($1 * 5))"
fi
}
# TODO not working in BSD, therefore end hook not being called and :skull: # TODO not working in BSD, therefore end hook not being called and :skull:
function __fn_exists() { function __fn_exists() {
local fn_type=$(type "$1" 2> /dev/null) local fn_type=$(type "$1" 2> /dev/null)