Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve build set for still branch #611

Merged
merged 11 commits into from
May 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
AllCops:
Exclude:
- tmp/**/*
- vendor/bundle/**/*
DisplayCopNames: true

# Cop supports --auto-correct.
# Configuration parameters: SupportedStyles.
Style/HashSyntax:
Expand Down
54 changes: 17 additions & 37 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,34 @@
sudo: false
language: ruby
script: script/test
install: script/bootstrap --without development debug
bundler_args: --without development debug
cache: bundler

rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1.8
- 2.2.4
- 2.3.8
- 2.4.5
- 2.5.3
- 2.6.0
- jruby-1.7.26
- jruby-20mode
- jruby-21mode
- rbx
- 2.2
- 2.3
- 2.4
- 2.5
- 2.6
- jruby-1.7
- jruby-9.0
- jruby-9.1
- jruby-9.2.6.0
- rbx-3
matrix:
include:
- rvm: jruby-9.0.1.0
env: JRUBY_OPTS='--dev'
- rvm: jruby-9.0.1.0-20mode
env: JRUBY_OPTS='--dev'
- rvm: jruby-9.0.1.0-21mode
env: JRUBY_OPTS='--dev'
- rvm: jruby-1.7
env: JRUBY_OPTS='--dev --1.8'
allow_failures:
- rvm: rbx
- rvm: jruby-9.0.1.0
env: JRUBY_OPTS='--dev'
- rvm: jruby-9.0.1.0-20mode
env: JRUBY_OPTS='--dev'
- rvm: jruby-9.0.1.0-21mode
env: JRUBY_OPTS='--dev'
- rvm: rbx-3
branches:
only:
- master
- still
notifications:
email:
- [email protected]
webhooks:
urls:
- https://webhooks.gitter.im/e/d4d9080e2a8c4910f609
env:
global:
- secure: l8uznA5K4K9mZ1krmP3lTMD8WcJ32qGxFOR3jubKHcOBSLB4xSzU2aIqjyJdO+rLzebkwamhJc8pGSIWOUDQYvFiX7splK+uEkbBJ5huAhXtLF4Qgl86bCWbEXYzN7rvn0DQfpJAovyFMNRMnfo70XhwqWzFsaYa7Z0YbqYsJE4=
- JRUBY_OPTS='--dev'
cache: apt
addons:
apt:
packages:
- zsh
- JRUBY_OPTS='--dev'
12 changes: 11 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ group :development, :test do
end

# Code Coverage
gem 'simplecov', '~> 0.10'
gem 'simplecov', '~> 0.10' unless RUBY_PLATFORM.include?('java')

# Test api
gem 'rspec', '~> 3.4'
Expand All @@ -84,6 +84,12 @@ group :development, :test do
gem 'cucumber', '~> 2.0'
end

if RUBY_VERSION < '1.9.2'
gem 'childprocess', '~> 0.6.3'
else
gem 'childprocess', '~> 1.0.1'
end

if RUBY_VERSION < '1.9.2'
gem 'contracts', '~> 0.15.0'
else
Expand All @@ -99,5 +105,9 @@ group :development, :test do
gem 'cucumber-pro', '~> 0.0'
end

if RUBY_VERSION < '2.0.0'
gem 'ffi', '< 1.11.0'
end

gem 'minitest', '~> 5.8'
end
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Feature: Running shell commands
- `When I run the following script:`

Or you can run shell commands with:
- `I run the following (bash|zsh|...shell)? commands`
- `I run the following (bash|zsh|...shell)? commands (in|with) \`interpreter\``
- `I run the following (bash|zsh|...shell)? commands (in|with) \`/path/to/interpreter\``
- `I run the following commands`
- `I run the following commands (in|with) \`interpreter\``
- `I run the following commands (in|with) \`/path/to/interpreter\``

Background:
Given I use a fixture named "cli-app"
Expand Down Expand Up @@ -50,106 +50,30 @@ Feature: Running shell commands
When I run `cucumber`
Then the features should all pass

Scenario: Running bash commands
Given a file named "features/shell.feature" with:
"""
Feature: Running scripts
Scenario: Running bash commands
When I run the following commands with `bash`:
\"\"\"bash
echo -n "Hello "
echo `echo bash` # subshell
\"\"\"
Then the output should contain exactly "Hello bash"
"""
When I run `cucumber`
Then the features should all pass

Scenario: Running zsh commands
Given a file named "features/shell.feature" with:
"""
Feature: Running zsh scripts
Scenario: Running zsh commands
When I run the following commands with `zsh`:
\"\"\"bash
echo "Hello \c"
echo $((2 + 2))
\"\"\"
Then the output should contain exactly "Hello 4"
"""
When I run `cucumber`
Then the features should all pass

Scenario: Running ruby commands
Scenario: Running commands with a named interpreter
Given a file named "features/shell.feature" with:
"""
Feature: Running scripts
Scenario: Running ruby commands
When I run the following commands with `ruby`:
\"\"\"ruby
\"\"\"
puts "Hello, Aruba!"
\"\"\"
Then the output should contain "Hello, Aruba!"
"""
When I run `cucumber`
Then the features should all pass

Scenario: Running python commands
Given a file named "features/shell.feature" with:
"""
Feature: Running scripts
Scenario: Running ruby commands
When I run the following commands with `python`:
\"\"\"ruby
print("Hello, Aruba!")
\"\"\"
Then the output should contain exactly "Hello, Aruba!"
"""
When I run `cucumber`
Then the features should all pass

Scenario: Running commands if full path to interpreter is given
Given a file named "features/shell.feature" with:
"""
Feature: Running full path zsh
Scenario: Running zsh commands #1
When I run the following commands with `/bin/zsh`:
\"\"\"bash
echo "Hello \c"
echo $((6 - 2))
\"\"\"
Then the output should contain exactly "Hello 4"

Scenario: Running zsh commands #1
When I run the following commands in `/bin/zsh`:
\"\"\"bash
echo "Hello \c"
echo $((6 - 2))
\"\"\"
Then the output should contain exactly "Hello 4"
"""
When I run `cucumber`
Then the features should all pass

Scenario: Running commands if only the name of interpreter is given
Given a file named "features/shell.feature" with:
"""
Feature: Running full path zsh
Scenario: Running zsh commands #1
When I run the following commands with `zsh`:
\"\"\"bash
echo "Hello \c"
echo $((6 - 2))
\"\"\"
Then the output should contain exactly "Hello 4"

Scenario: Running zsh commands #2
When I run the following commands in `zsh`:
Feature: Running full path
Scenario: Running full path bash
When I run the following commands with `/bin/bash`:
\"\"\"bash
echo "Hello \c"
echo $((6 - 2))
echo "Hello Aruba!"
\"\"\"
Then the output should contain exactly "Hello 4"
Then the output should contain "Hello Aruba!"
"""
When I run `cucumber`
Then the features should all pass
10 changes: 0 additions & 10 deletions features/step_definitions/hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@
end
end

Before '@requires-zsh' do |scenario|
next unless Aruba.platform.which('zsh').nil?

if Cucumber::VERSION < '2'
scenario.skip_invoke!
else
skip_this_scenario
end
end

Before '@requires-java' do |scenario|
next unless Aruba.platform.which('javac').nil?

Expand Down
2 changes: 1 addition & 1 deletion features/support/env.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)

# Has to be the first file required so that all other files show coverage information
require 'simplecov'
require 'simplecov' unless RUBY_PLATFORM.include?('java')

# Standard Library
require 'fileutils'
Expand Down
15 changes: 9 additions & 6 deletions features/support/simplecov_setup.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# @note this file is loaded in env.rb to setup simplecov using RUBYOPTs for child processes and @in-process
require 'simplecov'
# @note this file is loaded in env.rb to setup simplecov using RUBYOPTs for
# child processes and @in-process
unless RUBY_PLATFORM.include?('java')
require 'simplecov'

root = File.expand_path('../../../', __FILE__)
root = File.expand_path('../../../', __FILE__)

SimpleCov.command_name(ENV['SIMPLECOV_COMMAND_NAME'])
SimpleCov.root(root)
load File.join(root, '.simplecov')
SimpleCov.command_name(ENV['SIMPLECOV_COMMAND_NAME'])
SimpleCov.root(root)
load File.join(root, '.simplecov')
end
4 changes: 0 additions & 4 deletions script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ echo -ne "$info_msg Checking if bash installed? "
which 'bash' >/dev/null 2>error.log || ( echo -e "$error_msg\n\nCould not find \`bash\`. Please install bash or add it to PATH"; output_error_log; exit 1 )
echo OK

echo -ne "$info_msg Checking if zsh installed? "
which 'zsh' >/dev/null 2>error.log || ( echo -e "$error_msg\n\nCould not find \`zsh\`. Please install zsh or add it to PATH"; output_error_log; exit 1 )
echo OK

echo -e "$info_msg rubygem \"bundler\" "
which bundle > /dev/null || gem install bundler --version '~> 1.17.3'

Expand Down
1 change: 1 addition & 0 deletions spec/aruba/api_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'spec_helper'
require 'aruba/api'
require 'fileutils'
require 'time'

describe Aruba::Api do
include_context 'uses aruba API'
Expand Down
8 changes: 5 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

$LOAD_PATH << ::File.expand_path('../../lib', __FILE__)

require 'simplecov'
SimpleCov.command_name 'rspec'
SimpleCov.start
unless RUBY_PLATFORM.include?('java')
require 'simplecov'
SimpleCov.command_name 'rspec'
SimpleCov.start
end

# Pull in all of the gems including those in the `test` group
require 'bundler'
Expand Down