Skip to content

Commit

Permalink
Merge pull request neomake#1852 from neomake/docker
Browse files Browse the repository at this point in the history
- Update Docker: Alpine 3.7 / updated master versions
- fix coveragerc and coverage target
- cover syntax/neomake/python.vim
  • Loading branch information
blueyed authored Feb 14, 2018
2 parents 9eaea54 + 46ae686 commit 83f4f7f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2

common: &common
docker:
- image: neomake/vims-for-tests:19@sha256:91774f9a883c8ff950bb40232d84f5f3cec5dee7fad8cf7df3cd8af613342544
- image: neomake/vims-for-tests:20@sha256:14859f9e4b73e13c716ac85dd05edb4dbd451e4870fc210a0529f6f603eaa3ee
working_directory: ~/repo
steps:
- checkout
Expand Down
3 changes: 2 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[run]
plugins = covimerage
data_file = .coverage.covimerage
include = autoload/*,plugin/*,tests/*
[report]
include = autoload/*,plugin/*,syntax/*,tests/*
omit = tests/fixtures/vim/*
4 changes: 2 additions & 2 deletions Dockerfile.tests
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# From https://github.com/tweekmonster/vim-testbed.
FROM testbed/vim:6@sha256:107a7f57871202d75f6279d64b31a177a1022c5503fbe7f3b7951f88c1d18d3c
FROM testbed/vim:9@sha256:dc14380bb3d6a87790e4b6d4fc696a369258bd86b4a597dbe73c174cb7f0f5a8

# Currently tested versions:
# - v7.3.429 (Ubuntu Precise, 12.04LTS)
Expand All @@ -17,7 +17,7 @@ RUN install_vim -tag v7.3.429 -name vim73 --with-features=huge -build \
-tag neovim:v0.2.2 -py3 -build \
&& rm -rf /vim-build/vim/vim/*/share/vim/*/tutor

ENV NEOMAKE_DOCKERFILE_UPDATE=2018-01-07
ENV NEOMAKE_DOCKERFILE_UPDATE=2018-02-13

# Git master in a separate layer, since the above is meant to be stable.
RUN install_vim -tag master -build \
Expand Down
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ vimhelplint: | $(if $(VIMHELPLINT_DIR),,build/vimhelplint)

# Run tests in dockerized Vims.
DOCKER_REPO:=neomake/vims-for-tests
DOCKER_TAG:=19
DOCKER_TAG:=20
NEOMAKE_DOCKER_IMAGE?=
DOCKER_IMAGE:=$(if $(NEOMAKE_DOCKER_IMAGE),$(NEOMAKE_DOCKER_IMAGE),$(DOCKER_REPO):$(DOCKER_TAG))
DOCKER_STREAMS:=-ti
Expand All @@ -188,6 +188,14 @@ docker_image:
docker build -f Dockerfile.tests -t $(DOCKER_REPO):$(DOCKER_TAG) .
docker_push:
docker push $(DOCKER_REPO):$(DOCKER_TAG)
docker_update_image:
git diff --cached --exit-code >/dev/null || { echo "Index is not clean."; exit 1 ; }
git diff --exit-code Makefile >/dev/null || { echo "Makefile is not clean."; exit 2 ; }
sed -i '/^DOCKER_TAG:=/s/:=.*/:=$(shell echo $$(($(DOCKER_TAG)+1)))/' Makefile
sed -i '/^ENV NEOMAKE_DOCKERFILE_UPDATE=/s/=.*/=$(shell date +%Y-%m-%d)/' Dockerfile.tests
make docker_image
make docker_test DOCKER_VIM=neovim-master
@echo "Done. Use 'make docker_push' to push it."

DOCKER_VIMS:=vim73 vim74-trusty vim74-xenial vim8069 vim-master neovim-v0.1.7 neovim-v0.2.0 neovim-v0.2.1 neovim-v0.2.2 neovim-master
_DOCKER_VIM_TARGETS:=$(addprefix docker_test-,$(DOCKER_VIMS))
Expand Down Expand Up @@ -301,12 +309,10 @@ check:
contrib/vim-checks $(LINT_ARGS) || (( ret+= 16 )); \
exit $$ret

build/coverage: $(shell find . -name '*.vim')
.coverage.covimerage: .coveragerc $(shell find . -name '*.vim')
$(MAKE) testcoverage
.coverage: build/coverage
covimerage write_coverage $?/*.profile
coverage: .coverage
coverage report -m --skip-covered
coverage: .coverage.covimerage
coverage report -m

clean:
$(RM) -r build
Expand Down
14 changes: 10 additions & 4 deletions tests/customqf.vader
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,27 @@ Include: include/setup.vader
Execute (Displays custom formatted quickfix buffer):
call neomake#quickfix#enable()
try
new
let bufnr = bufnr('%')
noautocmd set filetype=python
Assert !hlexists('neomakePythonLint'), 'neomakePythonLint does not exist'

call setloclist(0, [{
\ 'lnum': 1,
\ 'bufnr': 1,
\ 'text': 'Line 1 nmcfg:{"name": "Alpha", "short": "Alph"}',
\ 'bufnr': bufnr,
\ 'text': 'Line 1 nmcfg:{"name": "python", "short": "Alph"}',
\ },
\ {
\ 'lnum': 2,
\ 'col': 5,
\ 'bufnr': 1,
\ 'bufnr': bufnr,
\ 'text': 'Line 2',
\ }])

lopen
let loclist_bufnr = bufnr('%')
AssertEqual b:current_syntax, 'neomake_qf'

Assert hlexists('neomakePythonLint'), 'neomakePythonLint does exists'

AssertEqual getline(1, '$'),
\ ['Alph 1:- Line 1', 'Alph 2:5 Line 2']
Expand Down Expand Up @@ -75,6 +80,7 @@ Execute (Displays custom formatted quickfix buffer):
close
finally
call neomake#quickfix#disable()
bwipe
endtry

Execute (Sets quickfix title (location list)):
Expand Down

0 comments on commit 83f4f7f

Please sign in to comment.