flatware-cucumber 1.0.0 → 2.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e57bee3ec267db9c1a50a6d499e0f7c042255df9
4
- data.tar.gz: 93b2e602ffffe885154f8d14a1b84ffa24d00a6d
2
+ SHA256:
3
+ metadata.gz: d80d74aa343b44ea43063bed4c87aad8a3b6736fc40d624f089cb3894be99a77
4
+ data.tar.gz: 6ee613418c313737c1b10d4c83df61b28e829f66764d9577655a06999e977777
5
5
  SHA512:
6
- metadata.gz: ceab1a559a2c45aeff2e53f6b8bdbab0cb8894363611ee73fc18b3367b55d72e1ff62b97814ef25582ce4629c15a0506736300d369accd22f35b8b322265b77b
7
- data.tar.gz: 230f6855909aaa84ca3e8078cd70c6cdc38a6a524204149f6c746c2eabfa39847816166b7af84e1ecc3c6f95e0e6f92be24dd0f13f7bf15a16e8b7f0753ae6d3
6
+ metadata.gz: e908a714ec6cb97cf97d967f1b23f6310306d9f2225b1d7c823b8d4004f3e321c88a8ef61b7f8ec204706b52b26d045c8b1b6cb510f24bfade9523e922f755b9
7
+ data.tar.gz: 9d79a2b4a5b6625e69dd098200cdc4323100478c01bfa12875714340b458d9b0b7c45bd0bb70233f0ba49a5999208b84bd3493f3d261fe1c36969e05ce014789
data/README.md CHANGED
@@ -1,45 +1,10 @@
1
- # Flatware [![Build Status][travis-badge]][travis] [![Code Climate][code-climate-badge]][code-climate]
1
+ # Flatware [![Code Climate][code-climate-badge]][code-climate]
2
2
 
3
- [travis-badge]: https://travis-ci.org/briandunn/flatware.svg?branch=master
4
- [travis]: http://travis-ci.org/briandunn/flatware
5
3
  [code-climate-badge]: https://codeclimate.com/github/briandunn/flatware.png
6
4
  [code-climate]: https://codeclimate.com/github/briandunn/flatware
7
5
 
8
6
  Flatware parallelizes your test suite to significantly reduce test time.
9
7
 
10
- ## Requirements
11
-
12
- * ZeroMQ > 4.0
13
-
14
- ## Installation
15
-
16
- ### ZeroMQ
17
-
18
- #### Linux Ubuntu
19
-
20
- ```sh
21
- sudo apt-get install -qq libzmq3-dev
22
- ```
23
-
24
- (Never you mind the 3. This package contains ZMQ version 4.)
25
-
26
- #### Mac OSX
27
-
28
-
29
- If you're on macOS 10.12, use the custom hashrocket ZMQ homebrew formula.
30
-
31
- ```sh
32
- brew tap hashrocket/formulas
33
- brew install hashrocket/formulas/zeromq
34
- ```
35
-
36
- The stock homebrew version will likely work on older versions of macOS.
37
-
38
-
39
- ```sh
40
- brew install zeromq
41
- ```
42
-
43
8
  ### Flatware
44
9
 
45
10
  Add the runners you need to your Gemfile:
@@ -73,6 +38,18 @@ To run your entire suite with the default rspec options add the `flatware-rspec`
73
38
  $ flatware rspec
74
39
  ```
75
40
 
41
+ The rspec runner can balance worker loads, making your suite even faster.
42
+
43
+ It forms balaced groups of spec files according to their last run times, if you've set `example_status_persistence_file_path` [in your RSpec config](https://relishapp.com/rspec/rspec-core/v/3-8/docs/command-line/only-failures).
44
+
45
+ For this to work the configuration option must be loaded before any specs are run. The `.rspec` file is one way to achive this:
46
+
47
+ --require spec_helper
48
+
49
+ But beware, if you're using ActiveRecord in your suite you'll need to avoid doing things that cause it to establish a database connection in `spec_helper.rb`. If ActiveRecord connects before flatware forks off workers, each will die messily. All of this will just work if you're following [the recomended pattern of splitting your helpers into `spec_helper` and `rails_helper`](https://github.com/rspec/rspec-rails/blob/v3.8.2/lib/generators/rspec/install/templates/spec/rails_helper.rb). Another option is to use [the configurable hooks](
50
+ #faster-startup-with-activerecord
51
+ ).
52
+
76
53
  ### Options
77
54
 
78
55
  If you'd like to limit the number of forked workers, you can pass the 'w' flag:
@@ -123,9 +100,31 @@ Now you are ready to rock:
123
100
  $ flatware rspec && flatware cucumber
124
101
  ```
125
102
 
126
- ## Planned Features
103
+ ### Faster Startup With ActiveRecord
127
104
 
128
- * Use heuristics to run your slowest tests first
105
+ Flatware has a couple lifecycle callbacks that you can use to avoid booting your app
106
+ over again on every core. One way to take advantage of this via a `spec/flatware_helper.rb` file like so:
107
+
108
+ ```ruby
109
+ Flatware.configure do |conf|
110
+ conf.before_fork do
111
+ require 'rails_helper'
112
+
113
+ ActiveRecord::Base.connection.disconnect!
114
+ end
115
+
116
+ conf.after_fork do |test_env_number|
117
+ config = ActiveRecord::Base.connection_config
118
+
119
+ ActiveRecord::Base.establish_connection(
120
+ config.merge(
121
+ database: config.fetch(:database) + test_env_number.to_s
122
+ )
123
+ )
124
+ end
125
+ end
126
+ ```
127
+ Now when I run `bundle exec flatware rspec -r ./spec/flatware_helper` My app only boots once, rather than once per core.
129
128
 
130
129
  ## Design Goals
131
130
 
@@ -156,20 +155,10 @@ directory. CD there and `flatware` will be in your path so you can tinker away.
156
155
 
157
156
  ## How it works
158
157
 
159
- Flatware relies on a message passing system to enable concurrency.
160
- The main process declares a worker for each cpu in the computer. Each
161
- worker forks from the main process and is then assigned a portion of the
162
- test suite. As the worker runs the test suite it sends progress
163
- messages to the main process. These messages are collected and when
164
- the last worker is finished the main process provides a report on the
165
- collected progress messages.
158
+ Flatware relies on a message passing system to enable concurrency. The main process forks a worker for each cpu in the computer. These workers are each given a chunk of the tests to run. The workers report back to the main process about their progress. The main process prints those progress messages. When the last worker is finished the main process prints the results.
166
159
 
167
160
  ## Resources
168
161
 
169
- To learn more about the messaging system that Flatware uses, take a look at the
170
- [excellent ZeroMQ guide][z].
171
-
172
- [z]: http://zguide.zeromq.org/page:all
173
162
  [a]: https://github.com/cucumber/aruba
174
163
 
175
164
  ## Contributing to Flatware
@@ -0,0 +1,51 @@
1
+ require 'cucumber'
2
+ require 'flatware/cucumber/formatter'
3
+ require 'flatware/cucumber/result'
4
+ require 'flatware/cucumber/step_result'
5
+ require 'flatware/cucumber/formatters/console'
6
+ require 'flatware/cucumber/cli'
7
+
8
+ module Flatware
9
+ module Cucumber
10
+ class Config
11
+ attr_reader :config, :args
12
+
13
+ def initialize(cucumber_config, args)
14
+ @config = cucumber_config
15
+ @args = args
16
+ end
17
+
18
+ def feature_dir
19
+ @config.feature_dirs.first
20
+ end
21
+
22
+ def jobs
23
+ feature_files.map { |file| Job.new file, args }.to_a
24
+ end
25
+
26
+ private
27
+
28
+ def feature_files
29
+ config.feature_files - config.feature_dirs
30
+ end
31
+ end
32
+
33
+ module_function
34
+
35
+ def configure(args, out_stream = $stdout, error_stream = $stderr)
36
+ raw_args = args.dup
37
+ cli_config = ::Cucumber::Cli::Configuration.new(out_stream, error_stream)
38
+ cli_config.parse! args + %w[--format Flatware::Cucumber::Formatter]
39
+ cucumber_config = ::Cucumber::Configuration.new cli_config
40
+ Config.new cucumber_config, raw_args
41
+ end
42
+
43
+ def run(feature_files, options)
44
+ runtime(Array(feature_files) + options).run!
45
+ end
46
+
47
+ def runtime(args)
48
+ ::Cucumber::Runtime.new(configure(args).config)
49
+ end
50
+ end
51
+ end
@@ -1,22 +1,46 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'flatware/cli'
2
4
 
3
5
  module Flatware
6
+ # cucumber thor command
4
7
  class CLI
5
8
  worker_option
6
- method_option 'dispatch-endpoint', type: :string, default: 'ipc://dispatch'
7
- method_option 'sink-endpoint', type: :string, default: 'ipc://task'
8
- desc "cucumber [FLATWARE_OPTS] [CUCUMBER_ARGS]", "parallelizes cucumber with custom arguments"
9
+ method_option(
10
+ 'sink-endpoint',
11
+ type: :string,
12
+ default: 'drbunix:sink'
13
+ )
14
+ desc(
15
+ 'cucumber [FLATWARE_OPTS] [CUCUMBER_ARGS]',
16
+ 'parallelizes cucumber with custom arguments'
17
+ )
9
18
  def cucumber(*args)
10
19
  config = Cucumber.configure args
11
20
 
12
- unless config.jobs.any?
13
- puts "Please create some feature files in the #{config.feature_dir} directory."
14
- exit 1
15
- end
21
+ ensure_jobs(config)
16
22
 
17
23
  Flatware.verbose = options[:log]
18
- Worker.spawn count: workers, runner: Cucumber, dispatch: options['dispatch-endpoint'], sink: options['sink-endpoint']
19
- start_sink jobs: config.jobs, workers: workers, formatter: Flatware::Cucumber::Formatters::Console.new($stdout, $stderr)
24
+ sink = options['sink-endpoint']
25
+ Worker.spawn(count: workers, runner: Cucumber, sink: sink)
26
+ start_sink(
27
+ jobs: config.jobs,
28
+ workers: workers,
29
+ formatter: Flatware::Cucumber::Formatters::Console.new($stdout, $stderr)
30
+ )
31
+ end
32
+
33
+ private
34
+
35
+ def ensure_jobs(config)
36
+ return if config.jobs.any?
37
+
38
+ abort(
39
+ format(
40
+ 'Please create some feature files in the %<dir>s directory.',
41
+ dir: config.feature_dir
42
+ )
43
+ )
20
44
  end
21
45
  end
22
46
  end
@@ -6,7 +6,7 @@ module Flatware
6
6
  class Formatter
7
7
  Checkpoint = Struct.new :steps, :scenarios do
8
8
  def failures?
9
- scenarios.any? &:failed?
9
+ scenarios.any?(&:failed?)
10
10
  end
11
11
  end
12
12
 
@@ -21,6 +21,7 @@ module Flatware
21
21
  end
22
22
 
23
23
  def initialize(config)
24
+ # FIXME: can we sneak the sink in through the config?
24
25
  config.on_event :test_case_finished, &method(:on_test_case_finished)
25
26
  config.on_event :test_step_finished, &method(:on_test_step_finished)
26
27
  config.on_event :test_run_finished, &method(:on_test_run_finished)
@@ -39,7 +40,11 @@ module Flatware
39
40
  attr_reader :steps, :scenarios, :matched_steps
40
41
 
41
42
  def on_test_case_finished(event)
42
- scenarios << Scenario.new(event.test_case.name, event.test_case.location.to_s, event.result.to_sym)
43
+ scenarios << Scenario.new(
44
+ event.test_case.name,
45
+ event.test_case.location.to_s,
46
+ event.result.to_sym
47
+ )
43
48
  end
44
49
 
45
50
  def on_step_activated(event)
@@ -47,14 +52,18 @@ module Flatware
47
52
  end
48
53
 
49
54
  def on_test_step_finished(event)
50
- if really_a_step?(event.test_step) or event.result.undefined?
51
- steps << StepResult.new(event.result.to_sym, event.result.failed? && event.result.exception)
52
- Sink::client.progress Result.new event.result.to_sym
53
- end
55
+ result = event.result
56
+ return unless really_a_step?(event.test_step) || result.undefined?
57
+
58
+ steps << StepResult.new(
59
+ result.to_sym,
60
+ result.failed? && result.exception
61
+ )
62
+ Sink.client.progress Result.new result.to_sym
54
63
  end
55
64
 
56
65
  def on_test_run_finished(*)
57
- Sink::client.checkpoint Checkpoint.new steps, scenarios
66
+ Sink.client.checkpoint Checkpoint.new steps, scenarios
58
67
  reset
59
68
  end
60
69
 
@@ -1,48 +1,56 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'flatware/cucumber/formatters/console/summary'
2
4
  require 'cucumber/formatter/console'
3
5
 
4
- module Flatware::Cucumber::Formatters
5
- class Console
6
- #for format_string
7
- include ::Cucumber::Formatter::Console
8
-
9
- FORMATS = {
10
- passed: '.',
11
- failed: 'F',
12
- undefined: 'U',
13
- pending: 'P',
14
- skipped: '-'
15
- }
16
-
17
- STATUSES = FORMATS.keys
18
-
19
- attr_reader :out, :err
20
-
21
- def initialize(stdout, stderr)
22
- @out, @err = stdout, stderr
23
- end
24
-
25
- def progress(result)
26
- out.print format result.progress
27
- end
28
-
29
- def summarize(checkpoints)
30
- steps = checkpoints.flat_map(&:steps)
31
- scenarios = checkpoints.flat_map(&:scenarios)
32
- Summary.new(steps, scenarios, out).summarize
33
- end
34
-
35
- def summarize_remaining(remaining_jobs)
36
- out.puts
37
- out.puts "The following features have not been run:"
38
- for job in remaining_jobs
39
- out.puts job.id
6
+ module Flatware
7
+ module Cucumber
8
+ module Formatters
9
+ class Console
10
+ # for format_string
11
+ include ::Cucumber::Formatter::Console
12
+
13
+ FORMATS = {
14
+ passed: '.',
15
+ failed: 'F',
16
+ undefined: 'U',
17
+ pending: 'P',
18
+ skipped: '-'
19
+ }.freeze
20
+
21
+ STATUSES = FORMATS.keys
22
+
23
+ attr_reader :out, :err
24
+
25
+ def initialize(stdout, stderr)
26
+ @out = stdout
27
+ @err = stderr
28
+ end
29
+
30
+ def progress(result)
31
+ out.print format result.progress
32
+ end
33
+
34
+ def summarize(checkpoints)
35
+ steps = checkpoints.flat_map(&:steps)
36
+ scenarios = checkpoints.flat_map(&:scenarios)
37
+ Summary.new(steps, scenarios, out).summarize
38
+ end
39
+
40
+ def summarize_remaining(remaining_jobs)
41
+ out.puts
42
+ out.puts 'The following features have not been run:'
43
+ remaining_jobs.each do |job|
44
+ out.puts job.id
45
+ end
46
+ end
47
+
48
+ private
49
+
50
+ def format(status)
51
+ format_string FORMATS[status], status
52
+ end
40
53
  end
41
54
  end
42
-
43
- private
44
- def format(status)
45
- format_string FORMATS[status], status
46
- end
47
55
  end
48
56
  end
@@ -1,64 +1,82 @@
1
1
  require 'cucumber/formatter/console'
2
2
  require 'flatware/cucumber/formatters/console'
3
3
 
4
- module Flatware::Cucumber::Formatters
5
- class Console
6
- class Summary
7
- include ::Cucumber::Formatter::Console
8
- attr_reader :io, :steps, :scenarios
4
+ module Flatware
5
+ module Cucumber
6
+ module Formatters
7
+ class Console
8
+ class Summary
9
+ include ::Cucumber::Formatter::Console
10
+ attr_reader :io, :steps, :scenarios
9
11
 
10
- def initialize(steps, scenarios=[], io=StringIO.new)
11
- @io = io
12
- @steps = steps
13
- @scenarios = scenarios
14
- end
12
+ def initialize(steps, scenarios = [], io = StringIO.new)
13
+ @io = io
14
+ @steps = steps
15
+ @scenarios = scenarios
16
+ end
15
17
 
16
- def summarize
17
- 2.times { io.puts }
18
- print_failures(steps, 'step')
19
- print_failures(scenarios.select(&:failed_outside_step?), 'scenario')
20
- print_failed_scenarios scenarios
21
- print_counts 'scenario', scenarios
22
- print_counts 'step', steps
23
- end
18
+ def summarize
19
+ 2.times { io.puts }
20
+ print_failures(steps, 'step')
21
+ print_failures(scenarios.select(&:failed_outside_step?), 'scenario')
22
+ print_failed_scenarios scenarios
23
+ print_counts 'scenario', scenarios
24
+ print_counts 'step', steps
25
+ end
24
26
 
25
- private
27
+ private
26
28
 
27
- def print_failed_scenarios(scenarios)
28
- return unless scenarios.any? &with_status(:failed)
29
+ def print_failed_scenarios(scenarios)
30
+ failed_scenarios = scenarios.select(&with_status(:failed))
31
+ return if failed_scenarios.empty?
29
32
 
30
- io.puts format_string "Failing Scenarios:", :failed
31
- scenarios.select(&with_status(:failed)).sort_by(&:file_colon_line).each do |scenario|
32
- io.puts format_string(scenario.file_colon_line, :failed) + format_string(" # Scenario: " + scenario.name, :comment)
33
- end
34
- io.puts
35
- end
33
+ io.puts format_string 'Failing Scenarios:', :failed
34
+ failed_scenarios
35
+ .sort_by(&:file_colon_line)
36
+ .map(&method(:to_failed_scenario_line))
37
+ .each(&io.method(:puts))
38
+ io.puts
39
+ end
36
40
 
37
- def print_failures(collection, label)
38
- failures = collection.select(&with_status(:failed))
39
- print_elements failures, :failed, pluralize(label, failures.size)
40
- end
41
+ def to_failed_scenario_line(scenario)
42
+ [
43
+ [scenario.file_colon_line, :failed],
44
+ ["# Scenario: #{scenario.name}", :comment]
45
+ ].map do |string, format|
46
+ format_string string, format
47
+ end.join(' ')
48
+ end
41
49
 
42
- def print_counts(label, collection)
43
- io.puts pluralize(label, collection.size) + count_summary(collection)
44
- end
50
+ def print_failures(collection, label)
51
+ failures = collection.select(&with_status(:failed))
52
+ print_elements failures, :failed, pluralize(label, failures.size)
53
+ end
45
54
 
46
- def pluralize(word, number)
47
- "#{number} #{number == 1 ? word : word + 's'}"
48
- end
55
+ def print_counts(label, collection)
56
+ io.puts(
57
+ pluralize(label, collection.size) + count_summary(collection)
58
+ )
59
+ end
49
60
 
50
- def with_status(status)
51
- proc {|r| r.status == status}
52
- end
61
+ def pluralize(word, number)
62
+ "#{number} #{number == 1 ? word : "#{word}s"}"
63
+ end
64
+
65
+ def with_status(status)
66
+ proc { |r| r.status == status }
67
+ end
53
68
 
54
- def count_summary(results)
55
- return "" unless results.any?
56
- status_counts = STATUSES.map do |status|
57
- count = results.select(&with_status(status)).size
58
- format_string "#{count} #{status}", status if count > 0
59
- end.compact.join ", "
69
+ def count_summary(results)
70
+ return '' unless results.any?
60
71
 
61
- " (#{status_counts})"
72
+ status_counts = STATUSES.map do |status|
73
+ count = results.select(&with_status(status)).size
74
+ format_string "#{count} #{status}", status if count.positive?
75
+ end.compact.join ', '
76
+
77
+ " (#{status_counts})"
78
+ end
79
+ end
62
80
  end
63
81
  end
64
82
  end
@@ -5,12 +5,12 @@ module Flatware
5
5
 
6
6
  def initialize(progress)
7
7
  @progress = progress
8
- @worker = ENV['TEST_ENV_NUMBER'].to_i
8
+ @worker = ENV.fetch('TEST_ENV_NUMBER', 0).to_i
9
9
  end
10
10
 
11
11
  class << self
12
12
  def step(*args)
13
- step = StepResult.new *args
13
+ step = StepResult.new(*args)
14
14
  new step.progress, [step]
15
15
  end
16
16
 
@@ -3,13 +3,12 @@ require 'cucumber'
3
3
  module Flatware
4
4
  module Cucumber
5
5
  class Runtime < ::Cucumber::Runtime
6
-
7
6
  attr_accessor :configuration, :loader
8
- attr_reader :out, :err
9
- attr_reader :visitor
7
+ attr_reader :out, :err, :visitor
10
8
 
11
- def initialize(out=StringIO.new, err=out)
12
- @out, @err = out, err
9
+ def initialize(out = StringIO.new, err = out)
10
+ @out = out
11
+ @err = err
13
12
  super(default_configuration)
14
13
  load_step_definitions
15
14
  @results = Results.new(configuration)
@@ -21,9 +20,13 @@ module Flatware
21
20
  config
22
21
  end
23
22
 
24
- def run(feature_files=[], options=[])
23
+ def run(feature_files = [], options = [])
25
24
  @loader = nil
26
- options = Array(feature_files) + %w[--format Flatware::Cucumber::Formatter] + options
25
+ options = [
26
+ Array(feature_files),
27
+ %w[--format Flatware::Cucumber::Formatter],
28
+ options
29
+ ].reduce(:+)
27
30
 
28
31
  configure(::Cucumber::Cli::Main.new(options, out, err).configuration)
29
32
 
@@ -5,7 +5,8 @@ module Flatware
5
5
  attr_reader :status, :exception
6
6
 
7
7
  def initialize(status, exception)
8
- @status, @exception = status, (serialized(exception) if exception)
8
+ @status = status
9
+ @exception = (serialized(exception) if exception)
9
10
  end
10
11
 
11
12
  def passed?
@@ -21,9 +22,10 @@ module Flatware
21
22
  end
22
23
 
23
24
  private
24
- def serialized(e)
25
- e.backtrace and e.backtrace.unshift e.backtrace.shift.sub(Dir.pwd, '.')
26
- SerializedException.new(e.class, e.message, e.backtrace)
25
+
26
+ def serialized(err)
27
+ err.backtrace&.unshift(err.backtrace.shift.sub(Dir.pwd, '.'))
28
+ SerializedException.new(err.class, err.message, err.backtrace)
27
29
  end
28
30
  end
29
31
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flatware-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dunn
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-28 00:00:00.000000000 Z
11
+ date: 2021-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: flatware
14
+ name: cucumber
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0
19
+ version: '3.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '='
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.0
26
+ version: '3.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: cucumber
28
+ name: flatware
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: '3.0'
33
+ version: 2.0.0.rc3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: '3.0'
40
+ version: 2.0.0.rc3
41
41
  description: A distributed cucumber runner
42
42
  email: brian@hashrocket.com
43
43
  executables: []
@@ -49,36 +49,38 @@ files:
49
49
  - LICENSE.txt
50
50
  - README.md
51
51
  - lib/flatware-cucumber.rb
52
+ - lib/flatware/cucumber.rb
52
53
  - lib/flatware/cucumber/cli.rb
53
54
  - lib/flatware/cucumber/formatter.rb
54
55
  - lib/flatware/cucumber/formatters/console.rb
55
56
  - lib/flatware/cucumber/formatters/console/summary.rb
56
57
  - lib/flatware/cucumber/result.rb
57
58
  - lib/flatware/cucumber/runtime.rb
58
- - lib/flatware/cucumber/scenario_result.rb
59
59
  - lib/flatware/cucumber/step_result.rb
60
60
  homepage: http://github.com/briandunn/flatware
61
61
  licenses:
62
62
  - MIT
63
63
  metadata: {}
64
- post_install_message:
64
+ post_install_message:
65
65
  rdoc_options: []
66
66
  require_paths:
67
67
  - lib
68
68
  required_ruby_version: !ruby/object:Gem::Requirement
69
69
  requirements:
70
- - - "~>"
70
+ - - ">="
71
71
  - !ruby/object:Gem::Version
72
- version: '2.1'
72
+ version: '2.6'
73
+ - - "<"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.1'
73
76
  required_rubygems_version: !ruby/object:Gem::Requirement
74
77
  requirements:
75
- - - ">="
78
+ - - ">"
76
79
  - !ruby/object:Gem::Version
77
- version: '0'
80
+ version: 1.3.1
78
81
  requirements: []
79
- rubyforge_project:
80
- rubygems_version: 2.6.12
81
- signing_key:
82
+ rubygems_version: 3.2.3
83
+ signing_key:
82
84
  specification_version: 4
83
85
  summary: A distributed cucumber runner
84
86
  test_files: []
@@ -1,38 +0,0 @@
1
- require 'flatware/serialized_exception'
2
- module Flatware
3
- module Cucumber
4
- class ScenarioResult
5
- attr_reader :status, :file_colon_line, :name
6
- def initialize(status, file_colon_line, name, e)
7
- @status = status
8
- @file_colon_line = file_colon_line
9
- @name = name
10
- @exception = SerializedException.new(e.class, e.message, e.backtrace) if e
11
- @failed_outside_step = false
12
- end
13
-
14
- def passed?
15
- status == :passed
16
- end
17
-
18
- def failed?
19
- status == :failed
20
- end
21
-
22
- def failed_outside_step!(file_colon_line)
23
- @failed_outside_step = file_colon_line
24
- end
25
-
26
- def failed_outside_step?
27
- !!@failed_outside_step
28
- end
29
-
30
- def exception
31
- @exception.tap do |e|
32
- e.backtrace = e.backtrace.grep(Regexp.new(Dir.pwd)).map { |line| line[Dir.pwd.size..-1] }
33
- e.backtrace = e.backtrace + [@failed_outside_step] if failed_outside_step?
34
- end
35
- end
36
- end
37
- end
38
- end