parallel_calabash 0.0.5 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -4
- data/bin/parallel_calabash +5 -1
- data/lib/parallel_calabash.rb +5 -4
- data/lib/parallel_calabash/feature_grouper.rb +13 -2
- data/lib/parallel_calabash/version.rb +1 -1
- data/spec/lib/parallel_calabash/feature_grouper_spec.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efbbc2a68f8afdd17130f1ca786be9471178900f
|
4
|
+
data.tar.gz: 0dbf0e57b693485d8bed88144d53df1d1e06d243
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b91350856d0c29d57e82a5103b3b53bfd8ed5517a219ad1cadf2bba34590b3b685de1f2b05ee832ae415ae0bb90b39c8b46810071a0c5f500072f684e84d8d65
|
7
|
+
data.tar.gz: 1c3c11ac5b97a6672db65a6cfe3d69cdeb459a54e9187c40299e2077b75e2b0eef5c87131921c7bc575ff7f1ac6903850b2cbfc956d31c589e680348d9c08f65
|
data/README.md
CHANGED
@@ -37,11 +37,10 @@ Example: parallel_calabash -a my.apk -o 'cucumber_opts_like_tags_profile_etc_her
|
|
37
37
|
-h, --help Show this message
|
38
38
|
-v, --version Show version
|
39
39
|
-a, --apk apk_path apk file path
|
40
|
+
-d, --distribution-tag tag divide features into groups as per occurrence of given tag
|
40
41
|
-o, --cucumber_opts '[OPTIONS]' execute with those cucumber options
|
41
|
-
|
42
|
-
|
43
|
-
--distribution-tag
|
44
|
-
--serialize-stdout Serialize stdout output show output only after process completion
|
42
|
+
--serialize-stdout Serialize stdout output, nothing will be written until everything is done
|
43
|
+
--concurrent Run tests concurrently. Each test will run once on each device.
|
45
44
|
|
46
45
|
## REPROTING
|
47
46
|
|
data/bin/parallel_calabash
CHANGED
@@ -25,7 +25,7 @@ def parse_arguments(arguments)
|
|
25
25
|
options[:apk_path] = apk_path
|
26
26
|
end
|
27
27
|
|
28
|
-
|
28
|
+
opts.on("-d", "--distribution-tag tag", "divide features into groups as per occurrence of given tag") do |distribution_tag|
|
29
29
|
options[:distribution_tag] = distribution_tag
|
30
30
|
end
|
31
31
|
|
@@ -37,6 +37,10 @@ def parse_arguments(arguments)
|
|
37
37
|
options[:mute_output] = mute_output
|
38
38
|
end
|
39
39
|
|
40
|
+
opts.on("--concurrent", "Run tests concurrently. Each test will run once on each device") do |concurrent_opt|
|
41
|
+
options[:concurrent] = true
|
42
|
+
end
|
43
|
+
|
40
44
|
end
|
41
45
|
|
42
46
|
opt_parser.parse!(arguments)
|
data/lib/parallel_calabash.rb
CHANGED
@@ -26,10 +26,11 @@ module ParallelCalabash
|
|
26
26
|
|
27
27
|
test_results = nil
|
28
28
|
report_time_taken do
|
29
|
-
groups = FeatureGrouper.feature_groups(options[:feature_folder], number_of_processes,options[:distribution_tag])
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
groups = FeatureGrouper.feature_groups(options[:feature_folder], number_of_processes, options[:distribution_tag], options[:concurrent])
|
30
|
+
threads = groups.size
|
31
|
+
|
32
|
+
test_results = Parallel.map_with_index(groups, :in_threads => threads) do |group, index|
|
33
|
+
Runner.run_tests(group, index, options)
|
33
34
|
end
|
34
35
|
ResultFormatter.report_results(test_results)
|
35
36
|
end
|
@@ -3,8 +3,18 @@ module ParallelCalabash
|
|
3
3
|
|
4
4
|
class << self
|
5
5
|
|
6
|
-
def feature_groups(feature_folder, group_size,weighing_factor = nil)
|
7
|
-
|
6
|
+
def feature_groups(feature_folder, group_size,weighing_factor = nil, concurrent = nil)
|
7
|
+
if concurrent.nil?
|
8
|
+
weighing_factor.nil? ? feature_groups_by_feature_files(feature_folder, group_size) : feature_groups_by_weight(feature_folder, group_size,weighing_factor)
|
9
|
+
else
|
10
|
+
concurrent_feature_groups(feature_folder, group_size)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def concurrent_feature_groups(feature_folder, number_of_groups)
|
15
|
+
groups = []
|
16
|
+
(0...number_of_groups).each{ groups << feature_files_in_folder(feature_folder) }
|
17
|
+
groups
|
8
18
|
end
|
9
19
|
|
10
20
|
def feature_groups_by_feature_files(feature_folder, group_size)
|
@@ -50,6 +60,7 @@ module ParallelCalabash
|
|
50
60
|
features.each do |feature|
|
51
61
|
feature_groups[index_of_lightest_group(feature_groups)] << feature
|
52
62
|
end
|
63
|
+
feature_groups.reject!{|group| group.empty?}
|
53
64
|
feature_groups.map{|group| group.map{|feature_hash| feature_hash[:feature]}}
|
54
65
|
end
|
55
66
|
|
@@ -38,6 +38,17 @@ describe ParallelCalabash::FeatureGrouper do
|
|
38
38
|
[["spec/test_data/features/aaa.feature", "spec/test_data/features/fff.feature"], ["spec/test_data/features/bbb.feature"], ["spec/test_data/features/ccc.feature"], ["spec/test_data/features/ddd.feature"], ["spec/test_data/features/eee.feature"]]
|
39
39
|
end
|
40
40
|
|
41
|
+
it 'should create 1 group for concurrent 1 process' do
|
42
|
+
expect(ParallelCalabash::FeatureGrouper.feature_groups(['spec/test_data/features'], 1, nil, true)).to eq \
|
43
|
+
[["spec/test_data/features/aaa.feature", "spec/test_data/features/bbb.feature", "spec/test_data/features/ccc.feature", "spec/test_data/features/ddd.feature", "spec/test_data/features/eee.feature", "spec/test_data/features/fff.feature"]]
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'should create 2 group for concurrent 2 processes' do
|
47
|
+
expect(ParallelCalabash::FeatureGrouper.feature_groups(['spec/test_data/features'], 2, nil, true)).to eq \
|
48
|
+
[["spec/test_data/features/aaa.feature", "spec/test_data/features/bbb.feature", "spec/test_data/features/ccc.feature", "spec/test_data/features/ddd.feature", "spec/test_data/features/eee.feature", "spec/test_data/features/fff.feature"],
|
49
|
+
["spec/test_data/features/aaa.feature", "spec/test_data/features/bbb.feature", "spec/test_data/features/ccc.feature", "spec/test_data/features/ddd.feature", "spec/test_data/features/eee.feature", "spec/test_data/features/fff.feature"]]
|
50
|
+
end
|
51
|
+
|
41
52
|
end
|
42
53
|
|
43
54
|
describe :feature_weight do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel_calabash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajdeep
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|