diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf183290d..ecae6d2c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/features/04_aruba_api/command/run_command.feature b/features/04_aruba_api/command/run_command.feature index c7c655890..4ddda99de 100644 --- a/features/04_aruba_api/command/run_command.feature +++ b/features/04_aruba_api/command/run_command.feature @@ -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' diff --git a/features/05_use_rspec_matchers/command/check_timeouts.feature b/features/05_use_rspec_matchers/command/check_timeouts.feature index c02145ee2..c90cfdca3 100644 --- a/features/05_use_rspec_matchers/command/check_timeouts.feature +++ b/features/05_use_rspec_matchers/command/check_timeouts.feature @@ -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` diff --git a/features/step_definitions/hooks.rb b/features/step_definitions/hooks.rb index 71a7f5746..a40249599 100644 --- a/features/step_definitions/hooks.rb +++ b/features/step_definitions/hooks.rb @@ -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?