Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e83bbca
Run cucumber scenarios from section 2 on Windows in CI
mvz Dec 20, 2025
87eb352
CI: Windows - Fixed 02_Configuring_Aruba\HomeDirectory feature.
xtrasimplicity Jun 10, 2018
96b86db
Make 02_configure_aruba/basics feature platform-independent
mvz Jun 20, 2021
48e65eb
Make 02_configure_aruba/exit_timeout feature platform-independent
mvz Dec 21, 2025
521138e
TMP: Limit set of platforms
mvz Jun 18, 2021
9028dbb
Tighten output check in Cucumber step testing RSpec success
mvz Nov 15, 2024
20b1ac0
Check timeouts in a platform-independent way
mvz Dec 21, 2025
84c4e35
Ensure aruba is loaded first in the cli-app fixture
mvz Dec 21, 2025
8ebd228
Adjust timeout values
mvz Dec 21, 2025
0694dc9
fixup! Ensure aruba is loaded first in the cli-app fixture
mvz Dec 21, 2025
8b699ed
fixup! Check timeouts in a platform-independent way
mvz Dec 21, 2025
08e0f2d
fixup! Ensure aruba is loaded first in the cli-app fixture
mvz Dec 21, 2025
95b7832
fixup! Ensure aruba is loaded first in the cli-app fixture
mvz Dec 21, 2025
f4010f6
TMP: Just run the first failing feature file
mvz Dec 21, 2025
0f67dd9
TMP: Run only one failing scenario
mvz Dec 21, 2025
7a8d617
Remove obsolete .gitignore file from config directory
mvz Dec 21, 2025
799efd4
Configure cucumber to skip work-in-progress scenarios by default
mvz Dec 21, 2025
b21a5ff
TMP: Add a TODO
mvz Dec 21, 2025
280532e
Make timeouts larger
mvz Dec 21, 2025
67c5fd4
fixup! TMP: Add a TODO
mvz Dec 21, 2025
4bec7ab
Make timeouts larget (part 2)
mvz Dec 21, 2025
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
24 changes: 10 additions & 14 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"]
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"]
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"]
runs-on: windows-latest
steps:
- name: git config autocrlf
Expand All @@ -82,12 +76,14 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run specs
run: bundle exec rake spec
- name: Run cukes (1)
run: bundle exec cucumber features/01_getting_started_with_aruba/
# - 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 - focus!
run: bundle exec cucumber features/02_configure_aruba/basics.feature
# - name: Run cukes (3)
# run: bundle exec cucumber features/03_testing_frameworks/
# - name: Run cukes (4)
Expand Down
1 change: 0 additions & 1 deletion config/.gitignore

This file was deleted.

1 change: 1 addition & 0 deletions config/cucumber.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default: --tags 'not @wip'
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Configure announcer activation on command failure
Given I use the fixture "cli-app"

Scenario: Default value
Given a file named "features/support/aruba_config.rb" with:
Given a file named "features/support/aruba.rb" with:
"""ruby
Aruba.configure do |config|
puts %(The default value is "#{config.activate_announcer_on_command_failure.inspect}")
Expand All @@ -21,7 +21,7 @@ Feature: Configure announcer activation on command failure
"""

Scenario: Modify value
Given a file named "features/support/aruba_config.rb" with:
Given a file named "features/support/aruba.rb" with:
"""ruby
Aruba.configure do |config|
config.activate_announcer_on_command_failure = [:foo, :bar]
Expand Down
75 changes: 47 additions & 28 deletions features/02_configure_aruba/basics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ Feature: Usage of configuration
Background:
Given I use a fixture named "cli-app"
And an executable named "bin/aruba-test-cli" with:
"""bash
#!/bin/bash
trap "exit 128" SIGTERM SIGINT
sleep $*
"""ruby
#!/usr/bin/env ruby
sleep ARGV[0].to_f
"""

Scenario: Setting default values for option for RSpec
Given a file named "spec/support/aruba_config.rb" with:
"""ruby
Aruba.configure do |config|
config.exit_timeout = 0.7
config.exit_timeout = 1.0
end
"""
And a file named "spec/usage_configuration_spec.rb" with:
Expand All @@ -34,12 +33,12 @@ Feature: Usage of configuration
RSpec.describe 'Run command', :type => :aruba do
context 'when fast command' do
before { run_command('aruba-test-cli 0') }
it { expect(last_command_started).to be_successfully_executed }
it { expect(last_command_started).to have_finished_in_time }
end

context 'when slow command' do
before { run_command('aruba-test-cli 1') }
it { expect(last_command_started).not_to be_successfully_executed }
it { expect(last_command_started).not_to have_finished_in_time }
end
end
"""
Expand All @@ -55,7 +54,7 @@ Feature: Usage of configuration
Given a file named "spec/support/aruba_config.rb" with:
"""ruby
Aruba.configure do |config|
config.exit_timeout = 0.5
config.exit_timeout = 1.0
end
"""
And a file named "spec/support/hooks.rb" with:
Expand All @@ -64,7 +63,7 @@ Feature: Usage of configuration
config.before :each do |example|
next unless example.metadata.key? :slow_command

aruba.config.exit_timeout = 1.5
aruba.config.exit_timeout = 2.5
end
end
"""
Expand All @@ -75,40 +74,50 @@ Feature: Usage of configuration
RSpec.describe 'Run command', :type => :aruba do
context 'when fast command' do
before { run_command('aruba-test-cli 0') }
it { expect(last_command_started).to be_successfully_executed }
it { expect(last_command_started).to have_finished_in_time }
end

context 'when slow command and this is known by the developer', :slow_command => true do
before { run_command('aruba-test-cli 1') }
it { expect(last_command_started).to be_successfully_executed }
before { run_command('aruba-test-cli 1.1') }
it { expect(last_command_started).to have_finished_in_time }
end

context 'when slow command, but this might be a failure' do
before { run_command('aruba-test-cli 1') }
it { expect(last_command_started).not_to be_successfully_executed }
before { run_command('aruba-test-cli 1.1') }
it { expect(last_command_started).not_to have_finished_in_time }
end
end
"""
When I run `rspec`
Then the specs should all pass

Scenario: Setting default values for option for Cucumber
Given a file named "features/support/aruba_config.rb" with:
Given a file named "features/support/aruba.rb" with:
"""ruby
Aruba.configure do |config|
config.exit_timeout = 0.5
config.exit_timeout = 1.0
end
"""
And a file named "features/step_definitions/timeout_steps.rb" with:
"""ruby
Then 'the command should finish in time' do
expect(last_command_started).to have_finished_in_time
end

Then 'the command should time out' do
expect(last_command_started).to run_too_long
end
"""
And a file named "features/run.feature" with:
"""
Feature: Run it
Scenario: Fast command
When I run `aruba-test-cli 0`
Then the exit status should be 0
Then the command should finish in time

Scenario: Slow command
When I run `aruba-test-cli 1.0`
Then the exit status should be 128
Then the command should time out
"""
When I run `cucumber`
Then the features should all pass
Expand All @@ -119,33 +128,43 @@ Feature: Usage of configuration
want to set the default timeout for all commands to the maximum value only
to prevent those commands from failing.

Given a file named "features/support/aruba_config.rb" with:
Given a file named "features/support/aruba.rb" with:
"""ruby
Aruba.configure do |config|
config.exit_timeout = 0.2
config.exit_timeout = 0.5
end
"""
And a file named "features/support/hooks.rb" with:
"""ruby
Before '@slow-command' do
aruba.config.exit_timeout = 1.5
aruba.config.exit_timeout = 2.5
end
"""
And a file named "features/step_definitions/timeout_steps.rb" with:
"""ruby
Then 'the command should finish in time' do
expect(last_command_started).to have_finished_in_time
end

Then 'the command should time out' do
expect(last_command_started).to run_too_long
end
"""
And a file named "features/usage_configuration.feature" with:
"""
Feature: Run it
Scenario: Fast command
When I run `aruba-test-cli 0`
Then the exit status should be 0
Then the command should finish in time

@slow-command
Scenario: Slow command known by the developer
When I run `aruba-test-cli 0.5`
Then the exit status should be 0
Scenario: Slow command finishes when given more time
When I run `aruba-test-cli 1.1`
Then the command should finish in time

Scenario: Slow command which might be a failure
When I run `aruba-test-cli 0.5`
Then the exit status should be 128
Scenario: Slow command fails
When I run `aruba-test-cli 1.1`
Then the command should time out
"""
When I run `cucumber`
Then the features should all pass
4 changes: 2 additions & 2 deletions features/02_configure_aruba/console_history_file.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Configure the aruba console history file
Given I use the fixture "cli-app"

Scenario: Default value
Given a file named "features/support/aruba_config.rb" with:
Given a file named "features/support/aruba.rb" with:
"""
Aruba.configure do |config|
puts %(The default value is "#{config.console_history_file}")
Expand All @@ -21,7 +21,7 @@ Feature: Configure the aruba console history file
"""

Scenario: Set some value
Given a file named "features/support/aruba_config.rb" with:
Given a file named "features/support/aruba.rb" with:
"""
Aruba.configure do |config|
config.console_history_file = '~/.config/aruba/history.txt'
Expand Down
29 changes: 19 additions & 10 deletions features/02_configure_aruba/exit_timeout.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@ Feature: Configure timeout for command execution
I want to configure the timeout when executing a command
In order to support some longer running commands

Note that on Windows, you must check for timeouts explicitly and cannot rely
on a nonzero exit status: Killing the process from Ruby when the timeout
occurs will set the exit status to 0.

Background:
Given I use the fixture "cli-app"
And an executable named "bin/aruba-test-cli" with:
"""bash
#!/bin/bash
trap "exit 128" SIGTERM SIGINT
sleep $*
"""ruby
#!/usr/bin/env ruby
sleep ARGV[0].to_f
"""
And a file named "features/step_definitions/timeout_steps.rb" with:
"""ruby
Then 'the command should finish in time' do
expect(last_command_started).to have_finished_in_time
end
"""

Scenario: Default value
Given a file named "features/support/aruba_config.rb" with:
Given a file named "features/support/aruba.rb" with:
"""ruby
Aruba.configure do |config|
puts %(The default value is "#{config.exit_timeout}")
Expand All @@ -27,7 +36,7 @@ Feature: Configure timeout for command execution
"""

Scenario: Modify value
Given a file named "features/support/aruba_config.rb" with:
Given a file named "features/support/aruba.rb" with:
"""ruby
Aruba.configure do |config|
config.exit_timeout = 1.0
Expand All @@ -37,13 +46,13 @@ Feature: Configure timeout for command execution
"""
Feature: Run it
Scenario: Fast command
When I run `aruba-test-cli 0.5`
Then the exit status should be 0
When I run `aruba-test-cli 0.1`
Then the command should finish in time
"""
Then I successfully run `cucumber`

Scenario: Fails if takes longer
Given a file named "features/support/aruba_config.rb" with:
Given a file named "features/support/aruba.rb" with:
"""ruby
Aruba.configure do |config|
config.exit_timeout = 0.5
Expand All @@ -54,7 +63,7 @@ Feature: Configure timeout for command execution
Feature: Run it
Scenario: Fast command
When I run `aruba-test-cli 2.5`
Then the exit status should be 0
Then the command should finish in time
"""
Then I run `cucumber`
And the exit status should be 1
4 changes: 2 additions & 2 deletions features/02_configure_aruba/fixtures_directories.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Configure directory where to look for fixtures
Given I use the fixture "cli-app"

Scenario: Default value
Given a file named "features/support/aruba_config.rb" with:
Given a file named "features/support/aruba.rb" with:
"""ruby
Aruba.configure do |config|
puts %(The default value is "%w(#{config.fixtures_directories.join(" ")})")
Expand All @@ -21,7 +21,7 @@ Feature: Configure directory where to look for fixtures
"""

Scenario: Modify value
Given a file named "features/support/aruba_config.rb" with:
Given a file named "features/support/aruba.rb" with:
"""ruby
Aruba.configure do |config|
config.fixtures_directories = %w(spec/fixtures)
Expand Down
2 changes: 1 addition & 1 deletion features/02_configure_aruba/fixtures_path_prefix.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Use fixtures path prefix of aruba
Given I use the fixture "cli-app"

Scenario: Default value
Given a file named "features/support/aruba_config.rb" with:
Given a file named "features/support/aruba.rb" with:
"""ruby
Aruba.configure do |config|
puts "The prefix is \"#{config.fixtures_path_prefix}\"."
Expand Down
Loading
Loading