Sha256: 6da8ba7fbb4ccda367e9b5152f7b22db1416e88d35db7e5ca30bad5f8b5a9ef7

Contents?: true

Size: 1.08 KB

Versions: 26

Compression:

Stored size: 1.08 KB

Contents

require "parallel_tests/gherkin/runner"

module ParallelTests
  module Cucumber
    class Runner < ParallelTests::Gherkin::Runner
      SCENARIOS_RESULTS_BOUNDARY_REGEX = /^(Failing|Flaky) Scenarios:$/
      SCENARIO_REGEX = /^cucumber features\/.+:\d+/

      class << self
        def name
          'cucumber'
        end

        def line_is_result?(line)
          super || line =~ SCENARIO_REGEX || line =~ SCENARIOS_RESULTS_BOUNDARY_REGEX
        end

        def summarize_results(results)
          output = []

          scenario_groups = results.slice_before(SCENARIOS_RESULTS_BOUNDARY_REGEX).group_by(&:first)
          scenario_groups.each do |header, group|
            scenarios = group.flatten.grep(SCENARIO_REGEX)
            if scenarios.any?
              output << ([header] + scenarios).join("\n")
            end
          end

          output << super

          output.join("\n\n")
        end

        def command_with_seed(cmd, seed)
          clean = cmd.sub(/\s--order\s+random(:\d+)?\b/, '')
          "#{clean} --order random:#{seed}"
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
parallel_tests-3.4.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-3.3.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-3.2.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-3.1.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-3.0.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.32.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.31.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.30.1 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.30.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.29.2 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.29.1 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.29.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.28.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.27.1 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.27.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.26.2 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.26.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.25.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.24.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.23.0 lib/parallel_tests/cucumber/runner.rb