Skip to content
Open
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
32 changes: 8 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ["3.1", "3.2", "jruby-9.4", "3.3", "3.4"]
appraisal: [cucumber_8, cucumber_9, cucumber_10, rspec_4]
include:
- ruby: "3.0"
appraisal: cucumber_8
exclude:
- ruby: "3.4"
appraisal: cucumber_8
ruby: ["3.3", "3.4"]
appraisal: [cucumber_10]

env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.appraisal }}.gemfile
Expand All @@ -53,7 +47,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4"]
ruby: ["3.3", "3.4"]
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
Expand All @@ -71,7 +65,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4"]
ruby: ["3.3", "3.4"]
runs-on: windows-latest
steps:
- name: git config autocrlf
Expand All @@ -82,22 +76,12 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install ansicon to silence colour warnings
run: cinst ansicon
- name: Run specs
run: bundle exec rake spec
- name: Run cukes (1)
run: bundle exec cucumber features/01_getting_started_with_aruba/
# - name: Run cukes (2)
# run: bundle exec cucumber features/02_configure_aruba/
# - name: Run cukes (3)
# run: bundle exec cucumber features/03_testing_frameworks/
# - name: Run cukes (4)
# run: bundle exec cucumber features/04_aruba_api/
# - name: Run cukes (5)
# run: bundle exec cucumber features/05_use_rspec_matchers/
# - name: Run cukes (6)
# run: bundle exec cucumber features/06_use_aruba_cli/
# - name: Run cukes (8)
# run: bundle exec cucumber features/08_other/
- name: Run cukes
run: bundle exec rake cucumber

checks:
runs-on: ubuntu-latest
Expand Down
7 changes: 1 addition & 6 deletions features/04_aruba_api/command/run_command.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ Feature: Run command
Given I use a fixture named "cli-app"

Scenario: Executable in the project's path
Given an executable named "bin/aruba-test-cli" with:
"""bash
#!/bin/bash
exit 0
"""
And a file named "spec/run_spec.rb" with:
Given a file named "spec/run_spec.rb" with:
"""ruby
require 'spec_helper'

Expand Down
39 changes: 17 additions & 22 deletions features/05_use_rspec_matchers/command/check_timeouts.feature
Original file line number Diff line number Diff line change
@@ -1,47 +1,42 @@
Feature: Check if a timeout occured during command execution

If you want to check if a command takes to long to finish it's work
If you want to check if a command takes too long to finish its work, you can
use the `run_too_long` and `have_finished_in_time` matchers.

Background:
Given I use a fixture named "cli-app"

Scenario: Check if command runs to long
Given an executable named "bin/aruba-test-cli" with:
"""
#!/bin/bash
sleep 1
"""
And a file named "spec/timeout_spec.rb" with:
Scenario: Check if command runs too long
Given a file named "spec/timeout_spec.rb" with:
"""
require 'spec_helper'

RSpec.describe 'Long running command', :type => :aruba do
before { aruba.config.exit_timeout = 0 }

before { run_command('aruba-test-cli') }
RSpec.describe 'Long running command', type: :aruba do
before { aruba.config.exit_timeout = 0.1 }

it { expect(last_command_started).to run_too_long }
it "runs too long" do
slow_command = which('sleep') ? 'sleep 0.2' : 'timeout 2'
run_command slow_command
expect(last_command_started).to run_too_long
end
end
"""
When I run `rspec`
Then the specs should all pass

Scenario: Check if command finishes in time
Given an executable named "bin/aruba-test-cli" with:
"""
#!/bin/bash
exit 0
"""
And a file named "spec/timeout_spec.rb" with:
Given a file named "spec/timeout_spec.rb" with:
"""
require 'spec_helper'

RSpec.describe 'Short running command', :type => :aruba do
RSpec.describe 'Short running command', type: :aruba do
before { aruba.config.exit_timeout = 5 }

before { run_command('aruba-test-cli') }
it "is done quickly" do
run_command('echo "Fast!"')

it { expect(last_command_started).to have_finished_in_time }
expect(last_command_started).to have_finished_in_time
end
end
"""
When I run `rspec`
Expand Down
6 changes: 6 additions & 0 deletions features/step_definitions/hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
skip_this_scenario
end

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

skip_this_scenario
end

Before '@requires-posix-standard-tools' do
next unless Aruba.platform.which('printf').nil?

Expand Down
Loading