From 927ee79026cffd50d888aa1edbe277d98d262a43 Mon Sep 17 00:00:00 2001 From: w0rp Date: Sun, 2 Apr 2017 22:57:29 +0100 Subject: [PATCH] Update the test suite so it uses the latest Docker image, and use Bourne shell for most tests, so weird shell issues are easier to catch. --- Makefile | 2 +- test/test_history_saving.vader | 9 ++++++++- test/vimrc | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 57c8bda..0b9f7b6 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ SHELL := /usr/bin/env bash IMAGE ?= w0rp/ale -CURRENT_IMAGE_ID = 82334204724d +CURRENT_IMAGE_ID = 26d48d06e5e8 DOCKER_FLAGS = --rm -v $(PWD):/testplugin -v $(PWD)/test:/home "$(IMAGE)" tests = test/*.vader test/*/*.vader test/*/*/*.vader test/*/*/*/*.vader diff --git a/test/test_history_saving.vader b/test/test_history_saving.vader index 303a02f..2f1044d 100644 --- a/test/test_history_saving.vader +++ b/test/test_history_saving.vader @@ -1,4 +1,8 @@ Before: + " Temporarily set the shell to /bin/sh, if it isn't already set that way. + " This will make it so the test works when running it directly. + let g:current_shell = &shell + let &shell = '/bin/sh' let g:history = [] let g:ale_buffer_info = {} let g:ale_max_buffer_history_size = 20 @@ -16,6 +20,9 @@ Before: \}) After: + " Reset the shell back to what it was before. + let &shell = g:current_shell + unlet g:current_shell let g:ale_history_enabled = 1 let g:ale_history_log_output = 0 unlet g:history @@ -37,7 +44,7 @@ Execute(History should be set when commands are run): AssertEqual 1, len(g:history) AssertEqual sort(['status', 'exit_code', 'job_id', 'command']), sort(keys(g:history[0])) - AssertEqual ['/bin/bash', '-c', 'echo command history test'], g:history[0].command + AssertEqual ['/bin/sh', '-c', 'echo command history test'], g:history[0].command AssertEqual 'finished', g:history[0].status AssertEqual 0, g:history[0].exit_code " The Job ID will change each time, but we can check the type. diff --git a/test/vimrc b/test/vimrc index ef67884..197be97 100644 --- a/test/vimrc +++ b/test/vimrc @@ -7,6 +7,7 @@ set runtimepath=/home/vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,/testplu " The following is just an example filetype plugin indent on syntax on +set shell=/bin/sh set nocompatible set tabstop=4 set softtabstop=4