From: Daniel Hahler Date: Sun, 30 Jul 2017 14:34:15 +0000 (+0200) Subject: Travis: update config (#87) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/90e00b6189ace2b85192d74ce40929fe9d665062?hp=-c Travis: update config (#87) * Travis: update config based on splitjoin's config * rvm: 2.4.1 * Add VIMRUNNER_REUSE_SERVER, and a wrapper Makefile * Travis: VIMRUNNER_REUSE_SERVER=1 * Start Xvfb manually --- 90e00b6189ace2b85192d74ce40929fe9d665062 diff --git a/.travis.yml b/.travis.yml index c43dd5f..53118ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,20 @@ +language: ruby +dist: trusty +sudo: false +cache: bundler +rvm: + - 2.4.1 +addons: + apt: + packages: + - vim-gtk branches: only: - master -language: ruby -rvm: - - 1.9.3 -before_install: - - sudo apt-get install vim-gtk before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - - bundle install - - sudo pip install vim-vint + - pip install --user vim-vint - vim --version + - Xvfb :99 & script: - - bundle exec rspec + - VIMRUNNER_REUSE_SERVER=1 DISPLAY=:99 bundle exec rspec spec - vint **/*.vim diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8822dca --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +test: + VIMRUNNER_REUSE_SERVER=0 bundle exec rspec + +test_fast: + VIMRUNNER_REUSE_SERVER=1 xvfb-run bundle exec rspec + +test_visible: + VIMRUNNER_REUSE_SERVER=1 bundle exec rspec diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 46ad026..9191526 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,15 +4,11 @@ require 'vimrunner/rspec' Vimrunner::RSpec.configure do |config| # Use a single Vim instance for the test suite. Set to false to use an # instance per test (slower, but can be easier to manage). - # FIXME: reuse_server = true seems to hang after a certain number of test cases - # - Travis CI hangs after 15 successful tests. - # - Locally it may hang also, with Vim and Xorg using 100% CPU. - # Therefore default to false in both cases. - config.reuse_server = ENV['CI'] ? false : false + # This requires using gvim, otherwise it hangs after a few tests. + config.reuse_server = ENV['VIMRUNNER_REUSE_SERVER'] == '1' ? true : false config.start_vim do - vim = Vimrunner.start - + vim = config.reuse_server ? Vimrunner.start_gvim : Vimrunner.start plugin_path = File.expand_path('../..', __FILE__) # add_plugin appends the path to the rtp... :(