From e8245dbf1746aa59774124de1c77ffc4d8b5b52f Mon Sep 17 00:00:00 2001 From: German Lashevich Date: Wed, 1 May 2019 23:52:55 +0200 Subject: [PATCH] FIx CI build freezing (#398) * Kill vim server * Fix incorrect usage of rspec * Add build stage to CI * Try using new server for each run * Sort and uniq test files --- .travis.yml | 5 ++--- spec/loading_spec.rb | 6 +++++- spec/spec_helper.rb | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 92020c6..78f7ea9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,5 @@ addons: packages: - vim-gtk before_script: - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" -script: bundle exec rspec --format=documentation + - "./build" +script: xvfb-run bundle exec rspec --format=documentation diff --git a/spec/loading_spec.rb b/spec/loading_spec.rb index 4d78f53..e9e1f3b 100644 --- a/spec/loading_spec.rb +++ b/spec/loading_spec.rb @@ -9,7 +9,7 @@ describe "My Vim plugin" do extensions = extensions.split(/[\n,]/) - extensions.each do |ext| + extensions.sort!.uniq!.each do |ext| if ext.match?(/^[a-z\.]+$/i) it "should parse #{ext} file" do Timeout::timeout(20) do @@ -21,4 +21,8 @@ describe "My Vim plugin" do end end end + + after(:all) do + vim.kill + end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5b8e5ac..21ab43c 100755 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,7 +4,7 @@ require 'vimrunner/rspec' $plugin_path = File.expand_path('../..', __FILE__) Vimrunner::RSpec.configure do |config| - config.reuse_server = true + config.reuse_server = false # Decide how to start a Vim instance. In this block, an instance should be # spawned and set up with anything project-specific.