Skip to content

Commit 90e00b6

Browse files
authored
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
1 parent 56f3e54 commit 90e00b6

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed

.travis.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1+
language: ruby
2+
dist: trusty
3+
sudo: false
4+
cache: bundler
5+
rvm:
6+
- 2.4.1
7+
addons:
8+
apt:
9+
packages:
10+
- vim-gtk
111
branches:
212
only:
313
- master
4-
language: ruby
5-
rvm:
6-
- 1.9.3
7-
before_install:
8-
- sudo apt-get install vim-gtk
914
before_script:
10-
- export DISPLAY=:99.0
11-
- sh -e /etc/init.d/xvfb start
12-
- bundle install
13-
- sudo pip install vim-vint
15+
- pip install --user vim-vint
1416
- vim --version
17+
- Xvfb :99 &
1518
script:
16-
- bundle exec rspec
19+
- VIMRUNNER_REUSE_SERVER=1 DISPLAY=:99 bundle exec rspec spec
1720
- vint **/*.vim

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
test:
2+
VIMRUNNER_REUSE_SERVER=0 bundle exec rspec
3+
4+
test_fast:
5+
VIMRUNNER_REUSE_SERVER=1 xvfb-run bundle exec rspec
6+
7+
test_visible:
8+
VIMRUNNER_REUSE_SERVER=1 bundle exec rspec

spec/spec_helper.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@
44
Vimrunner::RSpec.configure do |config|
55
# Use a single Vim instance for the test suite. Set to false to use an
66
# instance per test (slower, but can be easier to manage).
7-
# FIXME: reuse_server = true seems to hang after a certain number of test cases
8-
# - Travis CI hangs after 15 successful tests.
9-
# - Locally it may hang also, with Vim and Xorg using 100% CPU.
10-
# Therefore default to false in both cases.
11-
config.reuse_server = ENV['CI'] ? false : false
7+
# This requires using gvim, otherwise it hangs after a few tests.
8+
config.reuse_server = ENV['VIMRUNNER_REUSE_SERVER'] == '1' ? true : false
129

1310
config.start_vim do
14-
vim = Vimrunner.start
15-
11+
vim = config.reuse_server ? Vimrunner.start_gvim : Vimrunner.start
1612
plugin_path = File.expand_path('../..', __FILE__)
1713

1814
# add_plugin appends the path to the rtp... :(

0 commit comments

Comments
 (0)