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

Update supported set of rubies #679

Merged
merged 14 commits into from
Dec 31, 2019
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AllCops:
- tmp/**/*
- vendor/**/*
DisplayCopNames: true
TargetRubyVersion: 2.3
TargetRubyVersion: 2.4

# Use older RuboCop default
Style/PercentLiteralDelimiters:
Expand Down
50 changes: 20 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Use old Ubuntu distribution to avoid JRuby issues
dist: trusty
language: ruby
script: bundle exec rake test
before_install:
- gem install bundler -v '< 2'
bundler_args: --without debug

jobs:
Expand All @@ -13,41 +9,28 @@ jobs:
os: linux
- rvm: ruby-head
os: osx
- rvm: 2.6.3
- rvm: 2.7
os: linux
- rvm: 2.6.3
- rvm: 2.7
os: osx
- rvm: 2.5.5
- rvm: 2.6
os: linux
- rvm: 2.5.5
- rvm: 2.6
os: osx
- rvm: 2.4.6
- rvm: 2.5
os: linux
- rvm: 2.4.6
- rvm: 2.5
os: osx
- rvm: 2.3.8
- rvm: 2.4
os: linux
- rvm: 2.3.8
- rvm: 2.4
os: osx
- rvm: 2.3.0
os: linux
- rvm: jruby-9.1
- rvm: 2.4.0
os: linux
- rvm: jruby-9.2.8.0
os: linux
- rvm: jruby-9.2.8.0
os: osx
env: JAVA_OPTS="
--add-opens java.base/java.io=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
--add-opens java.base/java.security.cert=ALL-UNNAMED
--add-opens java.base/java.security=ALL-UNNAMED
--add-opens java.base/javax.crypto=ALL-UNNAMED
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
--add-opens java.base/java.nio.channels.spi=ALL-UNNAMED
--illegal-access=warn"
script: bundle exec rake spec
- stage: lint
script: bundle exec rake lint
Expand All @@ -67,7 +50,14 @@ branches:
env:
global:
- secure: l8uznA5K4K9mZ1krmP3lTMD8WcJ32qGxFOR3jubKHcOBSLB4xSzU2aIqjyJdO+rLzebkwamhJc8pGSIWOUDQYvFiX7splK+uEkbBJ5huAhXtLF4Qgl86bCWbEXYzN7rvn0DQfpJAovyFMNRMnfo70XhwqWzFsaYa7Z0YbqYsJE4=
# Travis by default also have "-Dcext.enabled=false" set in
# JRUBY_OPTS, but JRuby 9 does not support C extensions at all
# so it issues warning that will mess up the stderr checks.
- JRUBY_OPTS="--dev --debug"
- JAVA_OPTS="
--add-opens java.base/java.io=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
--add-opens java.base/java.security.cert=ALL-UNNAMED
--add-opens java.base/java.security=ALL-UNNAMED
--add-opens java.base/javax.crypto=ALL-UNNAMED
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
--add-opens java.base/java.nio.channels.spi=ALL-UNNAMED
--illegal-access=warn"
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test_script:

environment:
matrix:
- ruby_version: '23'
- ruby_version: '24'
- ruby_version: '25'
- ruby_version: '26'
# Note: ruby version 2.7 is not available as of 2019-12-31
2 changes: 1 addition & 1 deletion aruba.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ to make testing commandline applications meaningful, easy and fun.'
spec.add_development_dependency 'yard-junk', '~> 0.0.7'

spec.rubygems_version = '>= 1.6.1'
spec.required_ruby_version = '>= 2.3'
spec.required_ruby_version = '>= 2.4'

spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Feature: Check exit status of commands
"""
Feature: Failing program
Scenario: Run command
Given the default aruba exit timeout is 0.2 seconds
Given the default aruba exit timeout is 0.3 seconds
When I successfully run `aruba-test-cli`
"""
When I run `cucumber`
Expand All @@ -112,7 +112,7 @@ Feature: Check exit status of commands
Feature: Failing program
Scenario: Run command
Given the default aruba exit timeout is 0 seconds
When I successfully run `aruba-test-cli` for up to 0.2 seconds
When I successfully run `aruba-test-cli` for up to 0.3 seconds
"""
When I run `cucumber`
Then the features should all pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Feature: Access STDERR of command
"""ruby
require 'spec_helper'

RSpec.describe 'Run command', type: :aruba, io_wait_timeout: 0.2 do
RSpec.describe 'Run command', type: :aruba, io_wait_timeout: 0.3 do
before(:each) { run_command('aruba-test-cli') }
it { expect(last_command_started.stderr).to start_with 'Hello' }
end
Expand Down
6 changes: 3 additions & 3 deletions features/04_aruba_api/command/run_command.feature
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Feature: Run command
"""ruby
require 'spec_helper'

RSpec.describe 'Run command', type: :aruba, exit_timeout: 0.1, startup_wait_time: 0.2 do
RSpec.describe 'Run command', type: :aruba, exit_timeout: 0.1, startup_wait_time: 0.3 do
before do
run_command('aruba-test-cli')
last_command_started.send_signal 'HUP'
Expand Down Expand Up @@ -139,7 +139,7 @@ Feature: Run command
#!/usr/bin/env bash

function do_some_work {
sleep 0.2
sleep 0.1
echo "Hello, Aruba here"
}

Expand Down Expand Up @@ -284,7 +284,7 @@ Feature: Run command

RSpec.describe 'Run command', type: :aruba do
before do
run_command 'aruba-test-cli1', exit_timeout: 0.3
run_command 'aruba-test-cli1', exit_timeout: 0.4
run_command 'aruba-test-cli2', exit_timeout: 0.1
end

Expand Down
2 changes: 1 addition & 1 deletion features/04_aruba_api/command/run_simple.feature
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Feature: Run command in a simpler fashion
#!/usr/bin/env bash

function do_some_work {
sleep 0.2
sleep 0.1
echo "Hello, Aruba here"
}

Expand Down
9 changes: 6 additions & 3 deletions features/06_use_aruba_cli/open_console.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ Feature: Aruba Console
* setup_aruba
"""

Scenario: Has history
Scenario: Has its own history file
Given I run `aruba console` interactively
And I type "aruba_methods"
And I type "IRB.conf[:HISTORY_FILE]"
And I type "exit"
When I close the stdin stream
Then the file "~/.aruba_history" should exist
Then the output should contain:
"""
~/.aruba_history
"""
8 changes: 4 additions & 4 deletions lib/aruba/platforms/unix_platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ def touch(args, options)
end

# Copy file/directory
def cp(args, options)
FileUtils.cp_r(args, options)
def cp(src, dest)
FileUtils.cp_r(src, dest)
end

# Move file/directory
def mv(args, options)
FileUtils.mv(args, options)
def mv(src, dest)
FileUtils.mv(src, dest)
end

# Change mode of file/directory
Expand Down
9 changes: 5 additions & 4 deletions lib/aruba/processes/spawn_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ def terminate
# ... and set the exit status
wait
else
@process.stop
begin
@process.stop
rescue Errno::EPERM # This can occur on MacOS
nil
end
end
end

Expand All @@ -213,9 +217,6 @@ def terminate
@stdout_cache = read_temporary_output_file @stdout_file
@stderr_cache = read_temporary_output_file @stderr_file

# @stdout_file = nil
# @stderr_file = nil

@started = false

@exit_status
Expand Down