From 124a94624b0faac56230bd48253d2cae7a11f734 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 4 Nov 2017 20:33:08 +0100 Subject: [PATCH 1/6] Add test_quick make target --- Makefile | 7 +++++-- example/Dockerfile | 3 +-- example/Dockerfile.quicktests | 5 +++++ example/Makefile | 21 ++++++++++++--------- 4 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 example/Dockerfile.quicktests diff --git a/Makefile b/Makefile index cc4cb31..2c7f27d 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,9 @@ update_latest: # test: build the base image and example image on top, running tests therein. DOCKER_BASE_IMAGE:=vim-testbed-base -test: + +test test_quick: docker build -t "$(DOCKER_BASE_IMAGE)" . - make -C example test + make -C example $< + +.PHONY: build push test test_quick diff --git a/example/Dockerfile b/example/Dockerfile index 2160252..fb32318 100644 --- a/example/Dockerfile +++ b/example/Dockerfile @@ -1,7 +1,6 @@ FROM testbed/vim -RUN install_vim -tag v7.1 -name vim71 -prebuild_script 'echo "#define FEAT_PROFILE" >> src/feature.h' -build \ - -tag v7.3.429 -name vim73 -py -build \ +RUN install_vim -tag v7.3.429 -name vim73 -py -build \ -tag v7.4.052 -name vim74-trusty -build \ -tag master -py2 -py3 -ruby -lua -build \ -tag neovim:v0.2.0 -py2 -py3 -ruby -build \ diff --git a/example/Dockerfile.quicktests b/example/Dockerfile.quicktests new file mode 100644 index 0000000..6cfdcde --- /dev/null +++ b/example/Dockerfile.quicktests @@ -0,0 +1,5 @@ +# Dockerfile for quick tests. +FROM vim-testbed-base + +RUN install_vim -tag v7.1 -name vim71 \ + -prebuild_script 'echo "#define FEAT_PROFILE" >> src/feature.h' -build diff --git a/example/Makefile b/example/Makefile index 5f7d092..7f9858f 100644 --- a/example/Makefile +++ b/example/Makefile @@ -12,8 +12,17 @@ DOCKER = docker run -a stderr --rm \ -v $(WRITABLE_HOME):/home/vimtest \ -v $(CURDIR)/$(PLUGINS):/home/vimtest/plugins "$(IMAGE)" -test: build $(PLUGINS)/vader.vim -test: test_vim71_with_profiling_enabled +test_quick: $(PLUGINS)/vader.vim +test_quick: + docker build -f Dockerfile.quicktests -t "$(IMAGE)" . + docker run --rm "$(IMAGE)" vim71 -es -u NORC -c "exe has('profile') ? 'q' : 'cq'" || { \ + echo "vim71 should have FEAT_PROFILE enabled."; \ + docker run --rm "$(IMAGE)" vim71 --version; \ + exit 1; } + $(DOCKER) vim71 '+Vader! test/*' + +test: test_quick +test: Dockerfile.tests $(PLUGINS)/vader.vim test: set -ex; \ vims="$$(docker run --rm $(IMAGE) ls /vim-build/bin | grep vim)"; \ @@ -69,12 +78,6 @@ test: exit 1; \ fi -test_vim71_with_profiling_enabled: - docker run --rm "$(IMAGE)" vim71 -es -u NORC -c "exe has('profile') ? 'q' : 'cq'" || { \ - echo "vim71 should have FEAT_PROFILE enabled."; \ - docker run --rm "$(IMAGE)" vim71 --version; \ - exit 1; } - build: Dockerfile.tests docker build -f Dockerfile.tests -t "$(IMAGE)" . @@ -87,4 +90,4 @@ $(PLUGINS)/vader.vim: mkdir -p $(PLUGINS) cd $(PLUGINS) && git clone https://github.com/junegunn/vader.vim.git -.PHONY: test-setup test +.PHONY: test From e308e09b34eaa245e5db623d40c7be2e212bebcb Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 4 Nov 2017 21:20:27 +0100 Subject: [PATCH 2/6] Travis: language: generic --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index e33c09c..55ece2c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ sudo: false +language: generic services: - docker From 81e38d403f5d34576fc11b02b40e9fd50d015116 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 4 Nov 2017 21:48:16 +0100 Subject: [PATCH 3/6] example/Makefile: use -ti with docker-run --- example/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/Makefile b/example/Makefile index 7f9858f..9811feb 100644 --- a/example/Makefile +++ b/example/Makefile @@ -7,7 +7,7 @@ WRITABLE_HOME:=$(shell tmpdir=$$(mktemp -d --dry-run); \ cd $(CURDIR)/test; \ cp -a vimrc *.vader $${tmpdir}/; \ echo $${tmpdir}) -DOCKER = docker run -a stderr --rm \ +DOCKER = docker run -ti --rm \ -v $(CURDIR):/testplugin \ -v $(WRITABLE_HOME):/home/vimtest \ -v $(CURDIR)/$(PLUGINS):/home/vimtest/plugins "$(IMAGE)" From 54c0e961922455b5516904b3e8660fce9c9ddf60 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 16 Feb 2019 01:54:33 +0100 Subject: [PATCH 4/6] empty: trigger build From 00aff81cbcd5e73e321ccb3f4cba3ed19a31ef01 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 16 Feb 2019 20:15:25 +0100 Subject: [PATCH 5/6] phony --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index 2c7f27d..c974f58 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,3 @@ -.PHONY: build push test - TAG:=11 build: From 76bef98aca4ef9a5f7f7024ee8a5ea0697c44efa Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 16 Feb 2019 20:15:53 +0100 Subject: [PATCH 6/6] fix passing test/test_quick to example Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c974f58..44bf3ed 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,6 @@ DOCKER_BASE_IMAGE:=vim-testbed-base test test_quick: docker build -t "$(DOCKER_BASE_IMAGE)" . - make -C example $< + make -C example $@ .PHONY: build push test test_quick