Skip to content

Commit fbc8ae1

Browse files
committed
Drop cucumber 1.3 support
1 parent 0c7212d commit fbc8ae1

File tree

4 files changed

+16
-37
lines changed

4 files changed

+16
-37
lines changed

Gemfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
PATH
22
remote: .
33
specs:
4-
parallel_cucumber (0.1.21)
5-
cucumber
4+
parallel_cucumber (0.1.22)
5+
cucumber (~> 2)
66
parallel (~> 1.6)
77

88
GEM

lib/parallel_cucumber/grouper.rb

+12-33
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,10 @@ def scenario_groups(group_size, options)
1919
all_runnable_scenarios = distribution_data.map do |feature|
2020
next if feature['elements'].nil?
2121
feature['elements'].map do |scenario|
22-
if scenario['keyword'] == 'Scenario'
23-
{
24-
line: "#{feature['uri']}:#{scenario['line']}",
25-
weight: 1
26-
}
27-
elsif scenario['keyword'] == 'Scenario Outline'
28-
if scenario['examples']
29-
scenario['examples'].map do |example|
30-
examples_count = example['rows'].count - 1 # Do not count the first row with column names
31-
next unless examples_count > 0
32-
{
33-
line: "#{feature['uri']}:#{example['line']}",
34-
weight: examples_count
35-
}
36-
end
37-
else # Cucumber 1.3 with -x/--expand or Cucumber > 2.0
38-
{
39-
line: "#{feature['uri']}:#{scenario['line']}",
40-
weight: 1
41-
}
42-
end
43-
end
22+
"#{feature['uri']}:#{scenario['line']}" if ['Scenario', 'Scenario Outline'].include?(scenario['keyword'])
4423
end
4524
end.flatten.compact
25+
4626
group_creator(group_size, all_runnable_scenarios)
4727
end
4828

@@ -89,25 +69,24 @@ def _expand_profiles(options, config)
8969
expand_next = false
9070
options.split.map do |option|
9171
case
92-
when %w(-p --profile).include?(option)
93-
expand_next = true
94-
next
95-
when expand_next
96-
expand_next = false
97-
_expand_profiles(config[option], config)
98-
else
99-
option
72+
when %w(-p --profile).include?(option)
73+
expand_next = true
74+
next
75+
when expand_next
76+
expand_next = false
77+
_expand_profiles(config[option], config)
78+
else
79+
option
10080
end
10181
end.compact.join(' ')
10282
end
10383

10484
def group_creator(groups_count, tasks)
10585
groups = Array.new(groups_count) { [] }
10686

107-
sorted_tasks = tasks.sort { |t1, t2| t2[:weight] <=> t1[:weight] }
108-
sorted_tasks.each do |task|
87+
tasks.each do |task|
10988
group = groups.min_by(&:size)
110-
group.push(task[:line], *Array.new(task[:weight] - 1))
89+
group.push(task)
11190
end
11291
groups.reject(&:empty?).map(&:compact)
11392
end

lib/parallel_cucumber/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module ParallelCucumber
2-
VERSION = '0.1.21'.freeze
2+
VERSION = '0.1.22'.freeze
33
end # ParallelCucumber

parallel_cucumber.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Gem::Specification.new name, ParallelCucumber::VERSION do |spec|
1313
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
1414
spec.require_paths = 'lib'
1515

16-
spec.add_runtime_dependency 'cucumber'
16+
spec.add_runtime_dependency 'cucumber', '~> 2'
1717
spec.add_runtime_dependency 'parallel', '~> 1.6'
1818
spec.add_development_dependency 'rubocop', '~> 0.36'
1919
end

0 commit comments

Comments
 (0)