Skip to content

Commit

Permalink
Refactor travis test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Jan 8, 2018
1 parent edefb20 commit 3a1d9eb
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 9 deletions.
14 changes: 5 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ services:
language: ruby
rvm:
- '2.3'
env:
- SUITE=python
- SUITE=ruby
before_install:
- gem install bundler -v 1.5.1
- cd python
- sudo pip install -U pip
- sudo pip install setuptools==33.1.1
- pip --version
- sudo make install
- cd ../ruby
- bin/before-install
script:
- cd ../ruby && bundle exec rake
- cd ../python && PYTHONPATH='.' sudo make test
- bin/test
22 changes: 22 additions & 0 deletions bin/before-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env ruby

def run(*args)
puts "$ #{args.join(' ')}"
unless system(*args)
exit $?.exitstatus
end
end

case ENV['SUITE']
when 'python'
Dir.chdir('python/') do
run('sudo', 'pip', 'install', '-U', 'pip')
run('sudo', 'pip', 'install', 'setuptools==33.1.1')
run('pip', '--version')
run('sudo', 'make', 'install')
end
when 'ruby'
run('gem', 'install', 'bundler', '-v', '1.5.1')
else
abort("Missing or invalid SUITE environment variable")
end
22 changes: 22 additions & 0 deletions bin/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env ruby

def run(*args)
puts "$ #{args.join(' ')}"
unless system(*args)
exit $?.exitstatus
end
end

case ENV['SUITE']
when 'python'
Dir.chdir('python/') do
run({ 'PYTHONPATH' => '.' }, 'sudo', 'make', 'test')
end
when 'ruby'
Dir.chdir('ruby/') do
run('bundle', 'install')
run('bundle', 'exec', 'rake')
end
else
abort("Missing or invalid SUITE environment variable")
end

0 comments on commit 3a1d9eb

Please sign in to comment.