flatware-cucumber 0.4.0 → 2.0.0.rc1

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: af10de976bd3f5ab9978612d0eca4303fce90326
4
- data.tar.gz: 06c0102f0d981ac87c918a77a346b35abd9dbd8f
2
+ SHA256:
3
+ metadata.gz: ca4704cbed2b88a90d866db8ba7b74b3ba32214e27ab1c543a802f6fd90f11a6
4
+ data.tar.gz: 38d82c0121d3c9a3c67e3b129ae75f1fdbefa31c1dd6486b48c17b3793651094
5
5
  SHA512:
6
- metadata.gz: f54ab4f38b3b837151349f8d453ef39f27a3855fada7cffd042c07c0afc7e54c60cf2f806f4725896d7c0a8311d87fd0f6ad96eee5103e212ed91e54f53304be
7
- data.tar.gz: 1f3b63d49b7ffb911bfc49fec675f9e8b54e87b9756716d48a85dd64e862f185dce981955c6d8de32d774daa2e103f18d5a579edc92c0083a2a690835343bbfc
6
+ metadata.gz: 5a8b8f51c2c83933398e7b8f3d19ec55db65d58dfc944966a094e97fc176893af18f79b486cf101159a07d4588ff86bc75d800d032c4809e1f120c9c03ce2cba
7
+ data.tar.gz: 3262a5428592bd11866750ce8a019a5433471296b7b7e2f00f4316cbbfdc51536ad08c1a6c11525f1343e5ce15053648a9320b7c6cfbe058c6653b81895752b2
data/README.md CHANGED
@@ -7,39 +7,13 @@
7
7
 
8
8
  Flatware parallelizes your test suite to significantly reduce test time.
9
9
 
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
- Ruby FFI isn't getting along with the latest ZMQ formula. A tweaked verson is available in the Hashrocket tap.
29
-
30
- ```sh
31
- brew tap hashrocket/formulas
32
- brew install hashrocket/formulas/zeromq
33
- brew install zeromq
34
- ```
35
-
36
10
  ### Flatware
37
11
 
38
12
  Add the runners you need to your Gemfile:
39
13
 
40
14
  ```ruby
41
- gem 'flatware-rspec' # one
42
- gem 'flatware-cucumber' # or both
15
+ gem 'flatware-rspec', require: false # one
16
+ gem 'flatware-cucumber', require: false # or both
43
17
  ```
44
18
 
45
19
  then run
@@ -66,6 +40,18 @@ To run your entire suite with the default rspec options add the `flatware-rspec`
66
40
  $ flatware rspec
67
41
  ```
68
42
 
43
+ The rspec runner can balance worker loads, making your suite even faster.
44
+
45
+ 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).
46
+
47
+ For this to work the configuration option must be loaded before any specs are run. The `.rspec` file is one way to achive this:
48
+
49
+ --require spec_helper
50
+
51
+ 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](
52
+ #faster-startup-with-activerecord
53
+ ).
54
+
69
55
  ### Options
70
56
 
71
57
  If you'd like to limit the number of forked workers, you can pass the 'w' flag:
@@ -78,7 +64,7 @@ You can also pass most cucumber/rspec options to Flatware. For example, to run o
78
64
  features that are not tagged 'javascript', you can:
79
65
 
80
66
  ```sh
81
- $ flatware cucumber -t ~@javascript
67
+ $ flatware cucumber -t 'not @javascript'
82
68
  ```
83
69
 
84
70
  Additionally, for either cucumber or rspec you can specify a directory:
@@ -116,9 +102,31 @@ Now you are ready to rock:
116
102
  $ flatware rspec && flatware cucumber
117
103
  ```
118
104
 
119
- ## Planned Features
105
+ ### Faster Startup With ActiveRecord
120
106
 
121
- * Use heuristics to run your slowest tests first
107
+ Flatware has a couple lifecycle callbacks that you can use to avoid booting your app
108
+ over again on every core. One way to take advantage of this via a `spec/flatware_helper.rb` file like so:
109
+
110
+ ```ruby
111
+ Flatware.configure do |conf|
112
+ conf.before_fork do
113
+ require 'rails_helper'
114
+
115
+ ActiveRecord::Base.connection.disconnect!
116
+ end
117
+
118
+ conf.after_fork do |test_env_number|
119
+ config = ActiveRecord::Base.connection_config
120
+
121
+ ActiveRecord::Base.establish_connection(
122
+ config.merge(
123
+ database: config.fetch(:database) + test_env_number.to_s
124
+ )
125
+ )
126
+ end
127
+ end
128
+ ```
129
+ Now when I run `bundle exec flatware rspec -r ./spec/flatware_helper` My app only boots once, rather than once per core.
122
130
 
123
131
  ## Design Goals
124
132
 
@@ -149,20 +157,10 @@ directory. CD there and `flatware` will be in your path so you can tinker away.
149
157
 
150
158
  ## How it works
151
159
 
152
- Flatware relies on a message passing system to enable concurrency.
153
- The main process declares a worker for each cpu in the computer. Each
154
- worker forks from the main process and is then assigned a portion of the
155
- test suite. As the worker runs the test suite it sends progress
156
- messages to the main process. These messages are collected and when
157
- the last worker is finished the main process provides a report on the
158
- collected progress messages.
160
+ 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.
159
161
 
160
162
  ## Resources
161
163
 
162
- To learn more about the messaging system that Flatware uses, take a look at the
163
- [excellent ZeroMQ guide][z].
164
-
165
- [z]: http://zguide.zeromq.org/page:all
166
164
  [a]: https://github.com/cucumber/aruba
167
165
 
168
166
  ## 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,10 +21,11 @@ module Flatware
21
21
  end
22
22
 
23
23
  def initialize(config)
24
- config.on_event :after_test_case, &method(:on_after_test_case)
25
- config.on_event :after_test_step, &method(:on_after_test_step)
26
- config.on_event :finished_testing, &method(:on_finished_testing)
27
- config.on_event :step_match, &method(:on_step_match)
24
+ # FIXME: can we sneak the sink in through the config?
25
+ config.on_event :test_case_finished, &method(:on_test_case_finished)
26
+ config.on_event :test_step_finished, &method(:on_test_step_finished)
27
+ config.on_event :test_run_finished, &method(:on_test_run_finished)
28
+ config.on_event :step_activated, &method(:on_step_activated)
28
29
  reset
29
30
  end
30
31
 
@@ -38,23 +39,31 @@ module Flatware
38
39
 
39
40
  attr_reader :steps, :scenarios, :matched_steps
40
41
 
41
- def on_after_test_case(event)
42
- scenarios << Scenario.new(event.test_case.name, event.test_case.location.to_s, event.result.to_sym)
42
+ def on_test_case_finished(event)
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
- def on_step_match(event)
50
+ def on_step_activated(event)
46
51
  @matched_steps << event.step_match.location.to_s
47
52
  end
48
53
 
49
- def on_after_test_step(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
54
+ def on_test_step_finished(event)
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
- def on_finished_testing(*)
57
- Sink::client.checkpoint Checkpoint.new steps, scenarios
65
+ def on_test_run_finished(*)
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,65 +1,82 @@
1
1
  require 'cucumber/formatter/console'
2
2
  require 'flatware/cucumber/formatters/console'
3
- require 'flatware/cucumber/checkpoint'
4
3
 
5
- module Flatware::Cucumber::Formatters
6
- class Console
7
- class Summary
8
- include ::Cucumber::Formatter::Console
9
- 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
10
11
 
11
- def initialize(steps, scenarios=[], io=StringIO.new)
12
- @io = io
13
- @steps = steps
14
- @scenarios = scenarios
15
- end
12
+ def initialize(steps, scenarios = [], io = StringIO.new)
13
+ @io = io
14
+ @steps = steps
15
+ @scenarios = scenarios
16
+ end
16
17
 
17
- def summarize
18
- 2.times { io.puts }
19
- print_failures(steps, 'step')
20
- print_failures(scenarios.select(&:failed_outside_step?), 'scenario')
21
- print_failed_scenarios scenarios
22
- print_counts 'scenario', scenarios
23
- print_counts 'step', steps
24
- 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
25
26
 
26
- private
27
+ private
27
28
 
28
- def print_failed_scenarios(scenarios)
29
- 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?
30
32
 
31
- io.puts format_string "Failing Scenarios:", :failed
32
- scenarios.select(&with_status(:failed)).sort_by(&:file_colon_line).each do |scenario|
33
- io.puts format_string(scenario.file_colon_line, :failed) + format_string(" # Scenario: " + scenario.name, :comment)
34
- end
35
- io.puts
36
- 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
37
40
 
38
- def print_failures(collection, label)
39
- failures = collection.select(&with_status(:failed))
40
- print_elements failures, :failed, pluralize(label, failures.size)
41
- 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
42
49
 
43
- def print_counts(label, collection)
44
- io.puts pluralize(label, collection.size) + count_summary(collection)
45
- 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
46
54
 
47
- def pluralize(word, number)
48
- "#{number} #{number == 1 ? word : word + 's'}"
49
- end
55
+ def print_counts(label, collection)
56
+ io.puts(
57
+ pluralize(label, collection.size) + count_summary(collection)
58
+ )
59
+ end
50
60
 
51
- def with_status(status)
52
- proc {|r| r.status == status}
53
- 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
54
68
 
55
- def count_summary(results)
56
- return "" unless results.any?
57
- status_counts = STATUSES.map do |status|
58
- count = results.select(&with_status(status)).size
59
- format_string "#{count} #{status}", status if count > 0
60
- end.compact.join ", "
69
+ def count_summary(results)
70
+ return '' unless results.any?
61
71
 
62
- " (#{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
63
80
  end
64
81
  end
65
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: 0.4.0
4
+ version: 2.0.0.rc1
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: 2017-01-27 00:00:00.000000000 Z
11
+ date: 2021-03-02 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: 0.4.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: 0.4.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: '2.0'
33
+ version: 2.0.0.rc1
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: '2.0'
40
+ version: 2.0.0.rc1
41
41
  description: A distributed cucumber runner
42
42
  email: brian@hashrocket.com
43
43
  executables: []
@@ -49,37 +49,38 @@ files:
49
49
  - LICENSE.txt
50
50
  - README.md
51
51
  - lib/flatware-cucumber.rb
52
- - lib/flatware/cucumber/checkpoint.rb
52
+ - lib/flatware/cucumber.rb
53
53
  - lib/flatware/cucumber/cli.rb
54
54
  - lib/flatware/cucumber/formatter.rb
55
55
  - lib/flatware/cucumber/formatters/console.rb
56
56
  - lib/flatware/cucumber/formatters/console/summary.rb
57
57
  - lib/flatware/cucumber/result.rb
58
58
  - lib/flatware/cucumber/runtime.rb
59
- - lib/flatware/cucumber/scenario_result.rb
60
59
  - lib/flatware/cucumber/step_result.rb
61
60
  homepage: http://github.com/briandunn/flatware
62
61
  licenses:
63
62
  - MIT
64
63
  metadata: {}
65
- post_install_message:
64
+ post_install_message:
66
65
  rdoc_options: []
67
66
  require_paths:
68
67
  - lib
69
68
  required_ruby_version: !ruby/object:Gem::Requirement
70
69
  requirements:
71
- - - "~>"
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '2.6'
73
+ - - "<"
72
74
  - !ruby/object:Gem::Version
73
- version: '2.1'
75
+ version: '3.1'
74
76
  required_rubygems_version: !ruby/object:Gem::Requirement
75
77
  requirements:
76
- - - ">="
78
+ - - ">"
77
79
  - !ruby/object:Gem::Version
78
- version: '0'
80
+ version: 1.3.1
79
81
  requirements: []
80
- rubyforge_project:
81
- rubygems_version: 2.6.8
82
- signing_key:
82
+ rubygems_version: 3.2.3
83
+ signing_key:
83
84
  specification_version: 4
84
85
  summary: A distributed cucumber runner
85
86
  test_files: []
@@ -1,28 +0,0 @@
1
- module Flatware
2
- module Cucumber
3
- class Checkpoint
4
- attr_reader :steps, :scenarios
5
- def initialize(steps, scenarios)
6
- @steps, @scenarios = serialize_steps(steps), serialize_scenarios(scenarios)
7
- end
8
-
9
- def failures?
10
- scenarios.any? &:failed?
11
- end
12
-
13
- private
14
-
15
- def serialize_steps(steps)
16
- steps.map do |step|
17
- StepResult.new step.status, step.exception
18
- end
19
- end
20
-
21
- def serialize_scenarios(scenarios)
22
- scenarios.map do |scenario|
23
- ScenarioResult.new scenario.status, scenario.file_colon_line, scenario.name, scenario.exception
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -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