From 10a3e05116234ee7fbf9805a033a08e04e90c6d3 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Mon, 5 Apr 2021 12:16:23 +0200 Subject: [PATCH 1/6] Run cucumber scenarios on Windows --- .github/workflows/test.yml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf183290d..7019b7d4d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,20 +84,8 @@ jobs: 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 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 From eccd7d0178aabf6b9b0b45c2b7d65acbf3e9f84e Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Fri, 18 Jun 2021 15:07:08 +0200 Subject: [PATCH 2/6] Temporarily limit set of platforms --- .github/workflows/test.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7019b7d4d..f3ddf9350 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 From e5ed54ae7dbd3dedade76605f89625f1ed5f5866 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Mon, 5 Apr 2021 12:49:44 +0200 Subject: [PATCH 3/6] Silence warnings about ansicon --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f3ddf9350..ecae6d2c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,6 +76,8 @@ 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 From 1effe1734b3bde2a9913b5e47066826c9c5dc440 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 30 Jun 2019 21:02:01 +0200 Subject: [PATCH 4/6] Use default executable instead of specifying another --- features/04_aruba_api/command/run_command.feature | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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' From 58ff16c21f20815e9002be9d5f2430f5a48dc32c Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 19:43:03 +1000 Subject: [PATCH 5/6] Add @requires-sleep hook --- features/step_definitions/hooks.rb | 6 ++++++ 1 file changed, 6 insertions(+) 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? From b0de6fbd96e347b714bfb800383a73514865090a Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Wed, 3 Jul 2019 16:33:56 +0200 Subject: [PATCH 6/6] Make check_timeouts feature cross-platform * Use existing commands instead of non-portable bash scripts * Use timeout command if sleep is not available --- .../command/check_timeouts.feature | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) 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`