Sha256: d6fc9d7b86674239b63f4a034dbb53e397ed7c94c249f5500ff9234593109e82

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

require 'parallel_tests/test/runner'

module ParallelTests
  module Cucumber
    class Runner < ParallelTests::Test::Runner
      def self.run_tests(test_files, process_number, options)
        color = ($stdout.tty? ? 'AUTOTEST=1 ; export AUTOTEST ;' : '')#display color when we are in a terminal
        runtime_logging = " --format ParallelCucumber::RuntimeLogger --out #{runtime_log}"
        cmd = "#{color} #{executable}"
        cmd << runtime_logging if File.directory?(File.dirname(runtime_log))
        cmd << " #{options[:test_options]} #{test_files*' '}"
        execute_command(cmd, process_number, options)
      end

      def self.executable
        if ParallelTests.bundler_enabled?
          "bundle exec cucumber"
        elsif File.file?("script/cucumber")
          "script/cucumber"
        else
          "cucumber"
        end
      end

      def self.runtime_log
        'tmp/parallel_runtime_cucumber.log'
      end

      protected

      def self.test_suffix
        ".feature"
      end

      def self.line_is_result?(line)
        line =~ /^\d+ (steps|scenarios)/
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parallel_tests-0.7.0.alpha lib/parallel_tests/cucumber/runner.rb