From 568a15530cbb3b91dbf0c1c688cd5d27ccf8949b Mon Sep 17 00:00:00 2001 From: mitermayer Date: Fri, 30 Aug 2019 05:02:09 +0000 Subject: enabling-tests-to-auto-run-on-ci - Fixing linting and moving to use yarn on the tests - fixing lint that was forced to test build - use yarn over npm - use yarn cache --- .travis.yml | 7 ++++++- Dockerfile | 3 +++ autoload/prettier/logging/error.vim | 2 +- run-test | 18 +++++++++--------- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index c146062..8419911 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,17 @@ --- language: python +cache: + yarn: true + directories: + - node_modules + services: - docker before_install: - docker pull mitermayer/vim-test-bed - - npm install + - yarn install script: - ./run-test diff --git a/Dockerfile b/Dockerfile index 0dcb58d..50fb9cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,5 +23,8 @@ RUN install_vim -tag v7.4.052 -name vim7 -build \ # alias vim to allow contextual load RUN echo 'alias vim="/sbin/run_vim $DEFAULT_VIM"' >> ~/.bashrc +# upgrade node and yarn +RUN npm install -g npm yarn + # install vint RUN pip install typing>=3.6.2 pathlib==1.0.1 enum34>=1.0.4 vim-vint==0.3.19 diff --git a/autoload/prettier/logging/error.vim b/autoload/prettier/logging/error.vim index 3539a1e..48ad048 100644 --- a/autoload/prettier/logging/error.vim +++ b/autoload/prettier/logging/error.vim @@ -7,6 +7,6 @@ let s:DEFAULT_ERROR = get(s:, 'PARSING_ERROR') function! prettier#logging#error#log(...) abort let l:error = a:0 > 0 ? a:1 : s:DEFAULT_ERROR - let l:msg = a:0 > 1 ? ': ' . :2 : '' + let l:msg = a:0 > 1 ? ': ' . a:2 : '' echohl WarningMsg | echom s:PREFIX_MSG . get(s:ERRORS, l:error, s:DEFAULT_ERROR) . l:msg | echohl NONE endfunction diff --git a/run-test b/run-test index fc52cee..724706d 100755 --- a/run-test +++ b/run-test @@ -8,12 +8,12 @@ docker run \ "mitermayer/vim-test-bed" \ vint testplugin -#echo "Running tests..." -#docker run \ -# --rm \ -# --entrypoint=/bin/bash \ -# -v $PWD:/testplugin \ -# -v $PWD/tests:/home \ -# "mitermayer/vim-test-bed" \ -# -s -# npm test +echo "Running tests..." +docker run \ + --rm \ + --entrypoint=/bin/bash \ + -v $PWD:/testplugin \ + -v $PWD/tests:/home \ + "mitermayer/vim-test-bed" \ + -s + yarn test -- cgit v1.3