From d6cb291be4bec3b10ebdc2b0f8ded1aa8c44383a Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sat, 20 Dec 2025 17:04:33 +0100 Subject: [PATCH 01/22] Run cucumber scenarios from section 2 on Windows in CI --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0a2761bbb..24d237ed9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -117,8 +117,8 @@ jobs: 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 (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) From bd1934a4f06804954b6b326f63bab5c2da5a75d9 Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 20:47:24 +1000 Subject: [PATCH 02/22] CI: Windows - Fixed 02_Configuring_Aruba\HomeDirectory feature. --- features/02_configure_aruba/home_directory.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/02_configure_aruba/home_directory.feature b/features/02_configure_aruba/home_directory.feature index 065be0eb6..5da4555ee 100644 --- a/features/02_configure_aruba/home_directory.feature +++ b/features/02_configure_aruba/home_directory.feature @@ -22,7 +22,7 @@ Feature: Configure the home directory to be used with aruba When I successfully run `cucumber` Then the output should match: """ - The default value is "/.*/tmp/aruba" + The default value is ".*/tmp/aruba" """ Scenario: Set to current working directory @@ -60,7 +60,7 @@ Feature: Configure the home directory to be used with aruba Then I successfully run `cucumber` Then the output should match: """ - The value is "/.*/tmp/aruba/home" + The value is ".*/tmp/aruba/home" """ Scenario: Set to some other path (deprecated) From 018bf0fb32f9199d2032e2e7ebe301cc0db5f2d8 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 20 Jun 2021 08:55:57 +0200 Subject: [PATCH 03/22] Make 02_configure_aruba/basics feature platform-independent --- features/02_configure_aruba/basics.feature | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/features/02_configure_aruba/basics.feature b/features/02_configure_aruba/basics.feature index a95bca709..a119440bb 100644 --- a/features/02_configure_aruba/basics.feature +++ b/features/02_configure_aruba/basics.feature @@ -14,10 +14,9 @@ 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 @@ -108,7 +107,7 @@ Feature: Usage of configuration Scenario: Slow command When I run `aruba-test-cli 1.0` - Then the exit status should be 128 + Then the exit status should not be 0 """ When I run `cucumber` Then the features should all pass @@ -122,7 +121,7 @@ Feature: Usage of configuration Given a file named "features/support/aruba_config.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: @@ -144,8 +143,8 @@ Feature: Usage of configuration Then the exit status should be 0 Scenario: Slow command which might be a failure - When I run `aruba-test-cli 0.5` - Then the exit status should be 128 + When I run `aruba-test-cli 1` + Then the exit status should not be 0 """ When I run `cucumber` Then the features should all pass From 2533a577c2d56f690f878d77c0ca0a2b97c92ce4 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 21 Dec 2025 08:37:16 +0100 Subject: [PATCH 04/22] Make 02_configure_aruba/exit_timeout feature platform-independent --- features/02_configure_aruba/exit_timeout.feature | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/features/02_configure_aruba/exit_timeout.feature b/features/02_configure_aruba/exit_timeout.feature index a023bf57b..a8803dc47 100644 --- a/features/02_configure_aruba/exit_timeout.feature +++ b/features/02_configure_aruba/exit_timeout.feature @@ -7,10 +7,9 @@ Feature: Configure timeout for command execution 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 """ Scenario: Default value From 81309ab317fcae240479a94b37ca1aa900492482 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Fri, 18 Jun 2021 15:07:08 +0200 Subject: [PATCH 05/22] TMP: Limit set of platforms --- .github/workflows/test.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 24d237ed9..f42798a24 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,17 +47,8 @@ jobs: # Cucumber 9 | Ruby 2.7 # Cucumber 10 | Ruby 3.1 # - ruby: ["3.1", "jruby-9.4", "3.2", "3.3", "3.4", "jruby-10.0", "4.0"] + ruby: ["3.3"] appraisal: [cucumber_10] - include: - - ruby: "3.0" - appraisal: cucumber_8 - - ruby: "3.0" - appraisal: cucumber_9 - - ruby: "3.1" - appraisal: cucumber_9 - - ruby: "4.0" - appraisal: rspec_4 env: BUNDLE_GEMFILE: gemfiles/${{ matrix.appraisal }}.gemfile @@ -80,7 +71,7 @@ jobs: matrix: # This will automatically pick the latest supported version of Cucumber # for each Ruby version - ruby: ["3.0", "3.1", "3.2", "3.3", "3.4", "4.0"] + ruby: ["3.3"] runs-on: macos-latest steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 @@ -101,7 +92,7 @@ jobs: matrix: # This will automatically pick the latest supported version of Cucumber # for each Ruby version - ruby: ["3.0", "3.1", "3.2", "3.3", "3.4", "4.0"] + ruby: ["3.3"] runs-on: windows-latest steps: - name: git config autocrlf From fdc290e7a59b63fca452fdc92dc2b16b9c215abf Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Fri, 15 Nov 2024 18:14:53 +0100 Subject: [PATCH 06/22] Tighten output check in Cucumber step testing RSpec success This change ensures no errors were reported, and that both checks are performed before reporting any failures. --- lib/aruba/cucumber/testing_frameworks.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/aruba/cucumber/testing_frameworks.rb b/lib/aruba/cucumber/testing_frameworks.rb index a6c5f543b..fd8429f0a 100644 --- a/lib/aruba/cucumber/testing_frameworks.rb +++ b/lib/aruba/cucumber/testing_frameworks.rb @@ -87,8 +87,11 @@ end Then(/^the spec(?:s)? should(?: all)? pass$/) do - expect(all_output).to include_output_string '0 failures' - expect(last_command_stopped).to have_exit_status 0 + aggregate_failures do + expect(last_command_stopped) + .to have_output an_output_string_matching('examples?, 0 failures') + expect(last_command_stopped).to have_exit_status 0 + end end Then(/^the spec(?:s)? should fail with (\d+) failures?$/) do |count| From ee3489450a5993370de0091bd53a769392019c2f Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 21 Dec 2025 10:31:19 +0100 Subject: [PATCH 07/22] Check timeouts in a platform-independent way --- features/02_configure_aruba/basics.feature | 46 +++++++++++++------ .../02_configure_aruba/exit_timeout.feature | 16 +++++-- 2 files changed, 46 insertions(+), 16 deletions(-) diff --git a/features/02_configure_aruba/basics.feature b/features/02_configure_aruba/basics.feature index a119440bb..c40c70280 100644 --- a/features/02_configure_aruba/basics.feature +++ b/features/02_configure_aruba/basics.feature @@ -33,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 """ @@ -74,17 +74,17 @@ 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 } + 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 } + it { expect(last_command_started).not_to have_finished_in_time } end end """ @@ -98,16 +98,26 @@ Feature: Usage of configuration config.exit_timeout = 0.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/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 not be 0 + Then the command should time out """ When I run `cucumber` Then the features should all pass @@ -130,21 +140,31 @@ Feature: Usage of configuration aruba.config.exit_timeout = 1.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` + Then the command should finish in time - Scenario: Slow command which might be a failure + Scenario: Slow command fails When I run `aruba-test-cli 1` - Then the exit status should not be 0 + Then the command should time out """ When I run `cucumber` Then the features should all pass diff --git a/features/02_configure_aruba/exit_timeout.feature b/features/02_configure_aruba/exit_timeout.feature index a8803dc47..3facb8b9f 100644 --- a/features/02_configure_aruba/exit_timeout.feature +++ b/features/02_configure_aruba/exit_timeout.feature @@ -4,6 +4,10 @@ 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: @@ -11,6 +15,12 @@ Feature: Configure timeout for command execution #!/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: @@ -36,8 +46,8 @@ 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` @@ -53,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 From 8cbe323f7c77f168769900c0a97fb05e939f931c Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 21 Dec 2025 11:37:18 +0100 Subject: [PATCH 08/22] Ensure aruba is loaded first in the cli-app fixture There may be a load order issue when loading aruba and its config in separate Cucumber support files whose name does not start with 'env'. This change makes the 'env.rb' file load aruba directly, so Aruba should definitely be available when configuring it. --- .../activate_announcer_on_command_failure.feature | 4 ++-- features/02_configure_aruba/basics.feature | 4 ++-- features/02_configure_aruba/console_history_file.feature | 4 ++-- features/02_configure_aruba/exit_timeout.feature | 6 +++--- features/02_configure_aruba/fixtures_directories.feature | 4 ++-- features/02_configure_aruba/fixtures_path_prefix.feature | 2 +- features/02_configure_aruba/home_directory.feature | 8 ++++---- features/02_configure_aruba/io_timeout.feature | 4 ++-- features/02_configure_aruba/log_level.feature | 4 ++-- features/02_configure_aruba/physical_block_size.feature | 6 +++--- .../remove_ansi_escape_sequences.feature | 4 ++-- features/02_configure_aruba/root_directory.feature | 2 +- features/02_configure_aruba/startup_wait_time.feature | 4 ++-- features/02_configure_aruba/working_directory.feature | 4 ++-- .../cucumber/hooks/define_after_hook_for_commands.feature | 6 +----- .../hooks/define_before_hook_for_commands.feature | 6 +----- fixtures/cli-app/features/support/aruba.rb | 3 --- fixtures/cli-app/features/support/env.rb | 2 +- 18 files changed, 33 insertions(+), 44 deletions(-) delete mode 100644 fixtures/cli-app/features/support/aruba.rb diff --git a/features/02_configure_aruba/activate_announcer_on_command_failure.feature b/features/02_configure_aruba/activate_announcer_on_command_failure.feature index 3ccbaa934..5b713007e 100644 --- a/features/02_configure_aruba/activate_announcer_on_command_failure.feature +++ b/features/02_configure_aruba/activate_announcer_on_command_failure.feature @@ -24,7 +24,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}") @@ -37,7 +37,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 = [:stderr, :stdout] diff --git a/features/02_configure_aruba/basics.feature b/features/02_configure_aruba/basics.feature index c40c70280..3e07b1863 100644 --- a/features/02_configure_aruba/basics.feature +++ b/features/02_configure_aruba/basics.feature @@ -92,7 +92,7 @@ Feature: Usage of configuration 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 @@ -128,7 +128,7 @@ 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.5 diff --git a/features/02_configure_aruba/console_history_file.feature b/features/02_configure_aruba/console_history_file.feature index 683f2bbdd..d385ef114 100644 --- a/features/02_configure_aruba/console_history_file.feature +++ b/features/02_configure_aruba/console_history_file.feature @@ -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}") @@ -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' diff --git a/features/02_configure_aruba/exit_timeout.feature b/features/02_configure_aruba/exit_timeout.feature index 3facb8b9f..3cc5db19f 100644 --- a/features/02_configure_aruba/exit_timeout.feature +++ b/features/02_configure_aruba/exit_timeout.feature @@ -23,7 +23,7 @@ Feature: Configure timeout for command execution """ 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}") @@ -36,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 @@ -52,7 +52,7 @@ Feature: Configure timeout for command execution 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 diff --git a/features/02_configure_aruba/fixtures_directories.feature b/features/02_configure_aruba/fixtures_directories.feature index 121d746bd..055c76540 100644 --- a/features/02_configure_aruba/fixtures_directories.feature +++ b/features/02_configure_aruba/fixtures_directories.feature @@ -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(" ")})") @@ -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) diff --git a/features/02_configure_aruba/fixtures_path_prefix.feature b/features/02_configure_aruba/fixtures_path_prefix.feature index b16cc0dac..e2aa6c54c 100644 --- a/features/02_configure_aruba/fixtures_path_prefix.feature +++ b/features/02_configure_aruba/fixtures_path_prefix.feature @@ -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}\"." diff --git a/features/02_configure_aruba/home_directory.feature b/features/02_configure_aruba/home_directory.feature index 5da4555ee..4d57c60e7 100644 --- a/features/02_configure_aruba/home_directory.feature +++ b/features/02_configure_aruba/home_directory.feature @@ -13,7 +13,7 @@ Feature: Configure the home directory to be used with 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 default value is "#{config.home_directory}") @@ -26,7 +26,7 @@ Feature: Configure the home directory to be used with aruba """ Scenario: Set to current working directory - Given a file named "features/support/aruba_config.rb" with: + Given a file named "features/support/aruba.rb" with: """ruby Aruba.configure do |config| # use current working directory @@ -44,7 +44,7 @@ Feature: Configure the home directory to be used with aruba """ Scenario: Set a path inside aruba's working directory - Given a file named "features/support/aruba_config.rb" with: + Given a file named "features/support/aruba.rb" with: """ruby Aruba.configure do |config| # Use aruba working directory @@ -64,7 +64,7 @@ Feature: Configure the home directory to be used with aruba """ Scenario: Set to some other path (deprecated) - Given a file named "features/support/aruba_config.rb" with: + Given a file named "features/support/aruba.rb" with: """ruby Aruba.configure do |config| # use current working directory diff --git a/features/02_configure_aruba/io_timeout.feature b/features/02_configure_aruba/io_timeout.feature index f71bad70b..b89d79805 100644 --- a/features/02_configure_aruba/io_timeout.feature +++ b/features/02_configure_aruba/io_timeout.feature @@ -8,7 +8,7 @@ Feature: Configure timeout for io of commands 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.io_wait_timeout}") @@ -21,7 +21,7 @@ Feature: Configure timeout for io of commands """ 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.io_wait_timeout = 2 diff --git a/features/02_configure_aruba/log_level.feature b/features/02_configure_aruba/log_level.feature index 7bb35556e..a7a2436d0 100644 --- a/features/02_configure_aruba/log_level.feature +++ b/features/02_configure_aruba/log_level.feature @@ -8,7 +8,7 @@ Feature: Configure Log level of aruba logger 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.log_level}") @@ -21,7 +21,7 @@ Feature: Configure Log level of aruba logger """ 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.log_level = :warn diff --git a/features/02_configure_aruba/physical_block_size.feature b/features/02_configure_aruba/physical_block_size.feature index 4d665485c..ccf3d5f88 100644 --- a/features/02_configure_aruba/physical_block_size.feature +++ b/features/02_configure_aruba/physical_block_size.feature @@ -8,7 +8,7 @@ Feature: Configure the physical block size of disk 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.physical_block_size}") @@ -21,7 +21,7 @@ Feature: Configure the physical block size of disk """ Scenario: Set the block size to something else which is a power of two - Given a file named "features/support/aruba_config.rb" with: + Given a file named "features/support/aruba.rb" with: """ruby Aruba.configure do |config| # use current working directory @@ -39,7 +39,7 @@ Feature: Configure the physical block size of disk """ Scenario: The value needs to be a power of two, otherwise it will fail - 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.physical_block_size = 3 diff --git a/features/02_configure_aruba/remove_ansi_escape_sequences.feature b/features/02_configure_aruba/remove_ansi_escape_sequences.feature index d8ff1b882..ee665f508 100644 --- a/features/02_configure_aruba/remove_ansi_escape_sequences.feature +++ b/features/02_configure_aruba/remove_ansi_escape_sequences.feature @@ -8,7 +8,7 @@ Feature: Configure if ansi color codes should be stripped off from command outpu 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.remove_ansi_escape_sequences}") @@ -21,7 +21,7 @@ Feature: Configure if ansi color codes should be stripped off from command outpu """ Scenario: Modify 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.remove_ansi_escape_sequences = false diff --git a/features/02_configure_aruba/root_directory.feature b/features/02_configure_aruba/root_directory.feature index 492fe3891..e6b273528 100644 --- a/features/02_configure_aruba/root_directory.feature +++ b/features/02_configure_aruba/root_directory.feature @@ -8,7 +8,7 @@ Feature: Use root directory of aruba Given I use the fixture "cli-app" Scenario: Default configuration - Given a file named "features/support/aruba_config.rb" with: + Given a file named "features/support/aruba.rb" with: """ Aruba.configure do |config| puts config.root_directory diff --git a/features/02_configure_aruba/startup_wait_time.feature b/features/02_configure_aruba/startup_wait_time.feature index 3da07368d..bca67b873 100644 --- a/features/02_configure_aruba/startup_wait_time.feature +++ b/features/02_configure_aruba/startup_wait_time.feature @@ -18,7 +18,7 @@ Feature: Set time to wait after spawning command 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.startup_wait_time}") @@ -31,7 +31,7 @@ Feature: Set time to wait after spawning command """ 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.startup_wait_time = 2 diff --git a/features/02_configure_aruba/working_directory.feature b/features/02_configure_aruba/working_directory.feature index 23edbcdb3..313c10c91 100644 --- a/features/02_configure_aruba/working_directory.feature +++ b/features/02_configure_aruba/working_directory.feature @@ -8,7 +8,7 @@ Feature: Configure working directory 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: """ Aruba.configure do |config| puts %(The default value is "#{config.working_directory}") @@ -21,7 +21,7 @@ Feature: Configure working directory of aruba """ Scenario: Modify 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.working_directory = 'tmp/cucumber' diff --git a/features/03_testing_frameworks/cucumber/hooks/define_after_hook_for_commands.feature b/features/03_testing_frameworks/cucumber/hooks/define_after_hook_for_commands.feature index e7b15b3ba..cd312990f 100644 --- a/features/03_testing_frameworks/cucumber/hooks/define_after_hook_for_commands.feature +++ b/features/03_testing_frameworks/cucumber/hooks/define_after_hook_for_commands.feature @@ -6,8 +6,6 @@ Feature: After command hooks You can hook into Aruba's lifecycle just before it runs a command and after it has run the command: ```ruby - require 'aruba' - Aruba.configure do |config| config.after :command do |cmd| puts "After the run of '#{cmd}'" @@ -19,10 +17,8 @@ Feature: After command hooks Given I use a fixture named "cli-app" Scenario: Run a simple command with an "after(:command)"-hook - Given a file named "features/support/hooks.rb" with: + Given a file named "features/support/aruba.rb" with: """ - require_relative 'aruba' - Aruba.configure do |config| config.after :command do |cmd| puts "after the run of `#{cmd.commandline}`" diff --git a/features/03_testing_frameworks/cucumber/hooks/define_before_hook_for_commands.feature b/features/03_testing_frameworks/cucumber/hooks/define_before_hook_for_commands.feature index 3e6eba456..8b5d187c1 100644 --- a/features/03_testing_frameworks/cucumber/hooks/define_before_hook_for_commands.feature +++ b/features/03_testing_frameworks/cucumber/hooks/define_before_hook_for_commands.feature @@ -8,8 +8,6 @@ Feature: before_cmd hooks You can hook into Aruba's lifecycle just before it runs a command and after it has run the command: ```ruby - require_relative 'aruba' - Aruba.configure do |config| config.before :command do |cmd| puts "About to run '#{cmd}'" @@ -21,10 +19,8 @@ Feature: before_cmd hooks Given I use a fixture named "cli-app" Scenario: Run a simple command with an "after(:command)"-hook - Given a file named "features/support/hooks.rb" with: + Given a file named "features/support/aruba.rb" with: """ - require_relative 'aruba' - Aruba.configure do |config| config.before :command do |cmd| puts "before the run of `#{cmd.commandline}`" diff --git a/fixtures/cli-app/features/support/aruba.rb b/fixtures/cli-app/features/support/aruba.rb deleted file mode 100644 index 751674fc0..000000000 --- a/fixtures/cli-app/features/support/aruba.rb +++ /dev/null @@ -1,3 +0,0 @@ -# frozen_string_literal: true - -require 'aruba/cucumber' diff --git a/fixtures/cli-app/features/support/env.rb b/fixtures/cli-app/features/support/env.rb index bcc12c29d..751674fc0 100644 --- a/fixtures/cli-app/features/support/env.rb +++ b/fixtures/cli-app/features/support/env.rb @@ -1,3 +1,3 @@ # frozen_string_literal: true -require_relative 'aruba' +require 'aruba/cucumber' From 25050fcfa479c78735155c05d7720fbfffa3d8b0 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 21 Dec 2025 12:08:13 +0100 Subject: [PATCH 09/22] Adjust timeout values --- features/02_configure_aruba/basics.feature | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/features/02_configure_aruba/basics.feature b/features/02_configure_aruba/basics.feature index 3e07b1863..10c08c9c9 100644 --- a/features/02_configure_aruba/basics.feature +++ b/features/02_configure_aruba/basics.feature @@ -78,12 +78,12 @@ Feature: Usage of configuration end context 'when slow command and this is known by the developer', :slow_command => true do - before { run_command('aruba-test-cli 1') } + before { run_command('aruba-test-cli 0.6') } 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') } + before { run_command('aruba-test-cli 0.6') } it { expect(last_command_started).not_to have_finished_in_time } end end @@ -159,11 +159,11 @@ Feature: Usage of configuration @slow-command Scenario: Slow command finishes when given more time - When I run `aruba-test-cli 1` + When I run `aruba-test-cli 0.6` Then the command should finish in time Scenario: Slow command fails - When I run `aruba-test-cli 1` + When I run `aruba-test-cli 0.6` Then the command should time out """ When I run `cucumber` From b81fd81733beb9b7fdc003efe8d3835fabeaca8f Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 21 Dec 2025 12:43:35 +0100 Subject: [PATCH 10/22] TMP: Just run the first failing feature file --- .github/workflows/test.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f42798a24..4e2b60c2d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -104,12 +104,14 @@ jobs: ruby-version: ${{ matrix.ruby }} bundler: latest 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 cukes (2) - run: bundle exec cucumber features/02_configure_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) From c8df61bd61469c683365f0ce7a7e76f2405da6cc Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 21 Dec 2025 12:49:49 +0100 Subject: [PATCH 11/22] TMP: Run only one failing scenario --- features/02_configure_aruba/basics.feature | 3 +++ 1 file changed, 3 insertions(+) diff --git a/features/02_configure_aruba/basics.feature b/features/02_configure_aruba/basics.feature index 10c08c9c9..c6fcda321 100644 --- a/features/02_configure_aruba/basics.feature +++ b/features/02_configure_aruba/basics.feature @@ -19,6 +19,7 @@ Feature: Usage of configuration sleep ARGV[0].to_f """ + @wip Scenario: Setting default values for option for RSpec Given a file named "spec/support/aruba_config.rb" with: """ruby @@ -91,6 +92,7 @@ Feature: Usage of configuration When I run `rspec` Then the specs should all pass + @wip Scenario: Setting default values for option for Cucumber Given a file named "features/support/aruba.rb" with: """ruby @@ -122,6 +124,7 @@ Feature: Usage of configuration When I run `cucumber` Then the features should all pass + @wip Scenario: Setting option during runtime for Cucumber Maybe there are some long running tests, which need longer. You may not From 0c3d1ea78a44167639627ed29e637b7837c49893 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 21 Dec 2025 13:13:05 +0100 Subject: [PATCH 12/22] TMP: Add a TODO --- spec/support/helpers/reporting.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/support/helpers/reporting.rb b/spec/support/helpers/reporting.rb index 23d57c118..3dba8bc37 100644 --- a/spec/support/helpers/reporting.rb +++ b/spec/support/helpers/reporting.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +# TODO: Isn't this provided by RSpec itself? module SpecHelpers module Reporting # Captures the given stream and returns it: From 83a324d6f19ba70f46dee64d46cc9eb2c0f59462 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 21 Dec 2025 13:14:46 +0100 Subject: [PATCH 13/22] Make timeouts larger --- features/02_configure_aruba/basics.feature | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/features/02_configure_aruba/basics.feature b/features/02_configure_aruba/basics.feature index c6fcda321..699b5d727 100644 --- a/features/02_configure_aruba/basics.feature +++ b/features/02_configure_aruba/basics.feature @@ -55,7 +55,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: @@ -64,7 +64,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 """ @@ -79,12 +79,12 @@ Feature: Usage of configuration end context 'when slow command and this is known by the developer', :slow_command => true do - before { run_command('aruba-test-cli 0.6') } + 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 0.6') } + before { run_command('aruba-test-cli 1.1') } it { expect(last_command_started).not_to have_finished_in_time } end end From cfb0a536811b4eb25b4b79c323f052e546847072 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 21 Dec 2025 13:30:57 +0100 Subject: [PATCH 14/22] Make timeouts larget (part 2) --- features/02_configure_aruba/basics.feature | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/features/02_configure_aruba/basics.feature b/features/02_configure_aruba/basics.feature index 699b5d727..50cab8eb1 100644 --- a/features/02_configure_aruba/basics.feature +++ b/features/02_configure_aruba/basics.feature @@ -19,12 +19,11 @@ Feature: Usage of configuration sleep ARGV[0].to_f """ - @wip 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: @@ -92,12 +91,11 @@ Feature: Usage of configuration When I run `rspec` Then the specs should all pass - @wip Scenario: Setting default values for option for Cucumber 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: @@ -124,7 +122,6 @@ Feature: Usage of configuration When I run `cucumber` Then the features should all pass - @wip Scenario: Setting option during runtime for Cucumber Maybe there are some long running tests, which need longer. You may not @@ -140,7 +137,7 @@ Feature: Usage of configuration 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: @@ -162,11 +159,11 @@ Feature: Usage of configuration @slow-command Scenario: Slow command finishes when given more time - When I run `aruba-test-cli 0.6` + When I run `aruba-test-cli 1.1` Then the command should finish in time Scenario: Slow command fails - When I run `aruba-test-cli 0.6` + When I run `aruba-test-cli 1.1` Then the command should time out """ When I run `cucumber` From 864bcfec9d2496e882000dfdee255acb0e7be578 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 1 Feb 2026 12:09:23 +0100 Subject: [PATCH 15/22] TMP: Announce output to see why specs have non-zero exit code --- features/02_configure_aruba/basics.feature | 2 ++ 1 file changed, 2 insertions(+) diff --git a/features/02_configure_aruba/basics.feature b/features/02_configure_aruba/basics.feature index 50cab8eb1..ac751dcf8 100644 --- a/features/02_configure_aruba/basics.feature +++ b/features/02_configure_aruba/basics.feature @@ -45,6 +45,7 @@ Feature: Usage of configuration When I run `rspec` Then the specs should all pass + @announce-output Scenario: Setting option during runtime for RSpec Maybe there are some long running tests, which need longer. You may not @@ -122,6 +123,7 @@ Feature: Usage of configuration When I run `cucumber` Then the features should all pass + @announce-output Scenario: Setting option during runtime for Cucumber Maybe there are some long running tests, which need longer. You may not From 7c7aff057f339025f77773c19fa1dd7b1f16065c Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 1 Feb 2026 12:24:59 +0100 Subject: [PATCH 16/22] WIP: Add a to-do --- lib/aruba/cucumber/testing_frameworks.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/aruba/cucumber/testing_frameworks.rb b/lib/aruba/cucumber/testing_frameworks.rb index fd8429f0a..663a468e5 100644 --- a/lib/aruba/cucumber/testing_frameworks.rb +++ b/lib/aruba/cucumber/testing_frameworks.rb @@ -88,6 +88,7 @@ Then(/^the spec(?:s)? should(?: all)? pass$/) do aggregate_failures do + # TODO: Detect '0 examples, 0 failures, 1 error occurred outside of examples' expect(last_command_stopped) .to have_output an_output_string_matching('examples?, 0 failures') expect(last_command_stopped).to have_exit_status 0 From b097b3f5db9727280614cea494af1ade95179f9e Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 1 Feb 2026 12:28:07 +0100 Subject: [PATCH 17/22] TMP: Announce more --- features/02_configure_aruba/basics.feature | 2 ++ 1 file changed, 2 insertions(+) diff --git a/features/02_configure_aruba/basics.feature b/features/02_configure_aruba/basics.feature index ac751dcf8..60d6f6092 100644 --- a/features/02_configure_aruba/basics.feature +++ b/features/02_configure_aruba/basics.feature @@ -19,6 +19,7 @@ Feature: Usage of configuration sleep ARGV[0].to_f """ + @announce-output Scenario: Setting default values for option for RSpec Given a file named "spec/support/aruba_config.rb" with: """ruby @@ -92,6 +93,7 @@ Feature: Usage of configuration When I run `rspec` Then the specs should all pass + @announce-output Scenario: Setting default values for option for Cucumber Given a file named "features/support/aruba.rb" with: """ruby From 2f5fed47d95d6439fa70c8dca85e6cb92ed366e8 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 1 Feb 2026 14:22:02 +0100 Subject: [PATCH 18/22] WIPdebugging --- lib/aruba/api/core.rb | 1 + lib/aruba/setup.rb | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/aruba/api/core.rb b/lib/aruba/api/core.rb index 0f1489941..e573e4d1c 100644 --- a/lib/aruba/api/core.rb +++ b/lib/aruba/api/core.rb @@ -30,6 +30,7 @@ def aruba # artifacts of your tests. This does NOT clean up the current working # directory. def setup_aruba(clobber = true) + warn "Setting up Aruba" Aruba::Setup.new(aruba).call(clobber) self diff --git a/lib/aruba/setup.rb b/lib/aruba/setup.rb index 71094da3f..773833fa6 100644 --- a/lib/aruba/setup.rb +++ b/lib/aruba/setup.rb @@ -13,7 +13,10 @@ def initialize(runtime) end def call(clobber = true) - return if runtime.setup_already_done? + if runtime.setup_already_done? + warn "Skipping since setup is already done" + return + end working_directory(clobber) register_event_handlers From 75114a5207fa05022f3c1884b9e309f5ba626a11 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 1 Feb 2026 14:36:03 +0100 Subject: [PATCH 19/22] WIP: Maybe the destination exists and stuff gets copied wrong? --- lib/aruba/cucumber/file.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/aruba/cucumber/file.rb b/lib/aruba/cucumber/file.rb index ac96f2d42..9ec2b3323 100644 --- a/lib/aruba/cucumber/file.rb +++ b/lib/aruba/cucumber/file.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true Given(/^I use (?:a|the) fixture(?: named)? "([^"]*)"$/) do |name| - copy File.join(aruba.config.fixtures_path_prefix, name), name + copy File.join(aruba.config.fixtures_path_prefix, name), '.' cd name end From 8fd5233c60c90d9eee5bcfe03cff8a98674fadd3 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 1 Feb 2026 14:40:57 +0100 Subject: [PATCH 20/22] WIP --- lib/aruba/cucumber/file.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/aruba/cucumber/file.rb b/lib/aruba/cucumber/file.rb index 9ec2b3323..83e68c44a 100644 --- a/lib/aruba/cucumber/file.rb +++ b/lib/aruba/cucumber/file.rb @@ -1,7 +1,8 @@ # frozen_string_literal: true Given(/^I use (?:a|the) fixture(?: named)? "([^"]*)"$/) do |name| - copy File.join(aruba.config.fixtures_path_prefix, name), '.' + remove name + copy File.join(aruba.config.fixtures_path_prefix, name), name cd name end From ce019080d70319425bfbdc1c011db8ecd6b74232 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 1 Feb 2026 14:41:31 +0100 Subject: [PATCH 21/22] WILP --- lib/aruba/api/core.rb | 1 - lib/aruba/setup.rb | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/aruba/api/core.rb b/lib/aruba/api/core.rb index e573e4d1c..0f1489941 100644 --- a/lib/aruba/api/core.rb +++ b/lib/aruba/api/core.rb @@ -30,7 +30,6 @@ def aruba # artifacts of your tests. This does NOT clean up the current working # directory. def setup_aruba(clobber = true) - warn "Setting up Aruba" Aruba::Setup.new(aruba).call(clobber) self diff --git a/lib/aruba/setup.rb b/lib/aruba/setup.rb index 773833fa6..71094da3f 100644 --- a/lib/aruba/setup.rb +++ b/lib/aruba/setup.rb @@ -13,10 +13,7 @@ def initialize(runtime) end def call(clobber = true) - if runtime.setup_already_done? - warn "Skipping since setup is already done" - return - end + return if runtime.setup_already_done? working_directory(clobber) register_event_handlers From 87e0d02f264fd9264b6261875d88703892d6fc9e Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Mon, 2 Feb 2026 09:31:52 +0100 Subject: [PATCH 22/22] WIP: Check before removing --- lib/aruba/cucumber/file.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/aruba/cucumber/file.rb b/lib/aruba/cucumber/file.rb index 83e68c44a..460000047 100644 --- a/lib/aruba/cucumber/file.rb +++ b/lib/aruba/cucumber/file.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true Given(/^I use (?:a|the) fixture(?: named)? "([^"]*)"$/) do |name| - remove name + remove name if exist? name copy File.join(aruba.config.fixtures_path_prefix, name), name cd name end