semaphore_test_boosters 1.2.4 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/cucumber.yml +2 -1
- data/lib/test_boosters/cucumber_booster.rb +5 -7
- data/lib/test_boosters/rspec_booster.rb +5 -6
- data/lib/test_boosters/split_configuration.rb +54 -0
- data/lib/test_boosters/version.rb +1 -1
- data/lib/test_boosters.rb +1 -0
- metadata +2 -2
- data/lib/test_boosters/run_cucumber_config.rb +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4520935b29d20711b3eb5820b25f06f4636b9508
|
|
4
|
+
data.tar.gz: 128cc7b8d1003a16958eb8422170067627e24435
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3e9462ca2bd7c54e737c5af5b7f1385e07430993e79c0a0ce4e4fa3453561bfcee0b720cd99e8cc74367c12a3784217f581259348bb5071104e3dc6cc8772262
|
|
7
|
+
data.tar.gz: de26c3793cb0aad2fe81428c18b7851d7b28d0c11b7f46644f76f5124bf21ee9f1f7592c1a4969d601f1080dd5128a3fc60b5a6f81af8510a5f6934a992e03fc
|
data/config/cucumber.yml
CHANGED
|
@@ -4,8 +4,7 @@ module TestBoosters
|
|
|
4
4
|
|
|
5
5
|
def initialize(thread_index)
|
|
6
6
|
@thread_index = thread_index
|
|
7
|
-
@
|
|
8
|
-
@report_path = "#{ENV["HOME"]}/rspec_report.json"
|
|
7
|
+
@report_path = ENV["REPORT_PATH"] || "#{ENV["HOME"]}/cucumber_report.json"
|
|
9
8
|
@spec_path = ENV["SPEC_PATH"] || "features"
|
|
10
9
|
end
|
|
11
10
|
|
|
@@ -37,16 +36,15 @@ module TestBoosters
|
|
|
37
36
|
|
|
38
37
|
def select
|
|
39
38
|
with_fallback do
|
|
40
|
-
|
|
41
|
-
thread_count =
|
|
42
|
-
thread = file_distribution[@thread_index]
|
|
39
|
+
split_configuration = TestBoosters::SplitConfiguration.for_cucumber
|
|
40
|
+
thread_count = split_configuration.threads.count
|
|
43
41
|
|
|
44
42
|
all_features = Dir["#{@spec_path}/**/*.feature"].sort
|
|
45
|
-
all_known_features =
|
|
43
|
+
all_known_features = split_configuration.all_files
|
|
46
44
|
|
|
47
45
|
all_leftover_features = all_features - all_known_features
|
|
48
46
|
thread_leftover_features = TestBoosters::LeftoverFiles.select(all_leftover_features, thread_count, @thread_index)
|
|
49
|
-
thread_features = all_features &
|
|
47
|
+
thread_features = all_features & split_configuration.files_for_thread(@thread_index)
|
|
50
48
|
features_to_run = thread_features + thread_leftover_features
|
|
51
49
|
|
|
52
50
|
TestBoosters::Shell.display_files("This thread features:", thread_features)
|
|
@@ -4,7 +4,6 @@ module TestBoosters
|
|
|
4
4
|
|
|
5
5
|
def initialize(thread_index)
|
|
6
6
|
@thread_index = thread_index
|
|
7
|
-
@rspec_split_configuration_path = ENV["RSPEC_SPLIT_CONFIGURATION_PATH"] || "#{ENV["HOME"]}/rspec_split_configuration.json"
|
|
8
7
|
@report_path = ENV["REPORT_PATH"] || "#{ENV["HOME"]}/rspec_report.json"
|
|
9
8
|
@spec_path = ENV["SPEC_PATH"] || "spec"
|
|
10
9
|
end
|
|
@@ -39,18 +38,18 @@ module TestBoosters
|
|
|
39
38
|
|
|
40
39
|
def select
|
|
41
40
|
with_fallback do
|
|
42
|
-
|
|
43
|
-
thread_count =
|
|
44
|
-
thread = file_distribution[@thread_index]
|
|
41
|
+
split_configuration = TestBoosters::SplitConfiguration.for_rspec
|
|
42
|
+
thread_count = split_configuration.threads.count
|
|
45
43
|
|
|
46
44
|
puts "Running RSpec thread #{@thread_index + 1} out of #{thread_count} threads\n"
|
|
47
45
|
|
|
48
46
|
all_specs = Dir["#{@spec_path}/**/*_spec.rb"].sort
|
|
49
|
-
all_known_specs =
|
|
47
|
+
all_known_specs = split_configuration.all_files
|
|
50
48
|
|
|
51
49
|
all_leftover_specs = all_specs - all_known_specs
|
|
52
50
|
thread_leftover_specs = TestBoosters::LeftoverFiles.select(all_leftover_specs, thread_count, @thread_index)
|
|
53
|
-
|
|
51
|
+
|
|
52
|
+
thread_specs = all_specs & split_configuration.files_for_thread(@thread_index)
|
|
54
53
|
specs_to_run = thread_specs + thread_leftover_specs
|
|
55
54
|
|
|
56
55
|
TestBoosters::Shell.display_files("This thread specs:", thread_specs)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
module TestBoosters
|
|
2
|
+
class SplitConfiguration
|
|
3
|
+
|
|
4
|
+
def self.for_rspec
|
|
5
|
+
path_from_env = ENV["RSPEC_SPLIT_CONFIGURATION_PATH"]
|
|
6
|
+
default_path = "#{ENV["HOME"]}/rspec_split_configuration.json"
|
|
7
|
+
|
|
8
|
+
new(path_from_env || default_path)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def self.for_cucumber
|
|
12
|
+
path_from_env = ENV["CUCUMBER_SPLIT_CONFIGURATION_PATH"]
|
|
13
|
+
default_path = "#{ENV["HOME"]}/cucumber_split_configuration.json"
|
|
14
|
+
|
|
15
|
+
new(path_from_env || default_path)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
class Thread < Struct.new(:files, :thread_index)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def initialize(path)
|
|
22
|
+
@path = path
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def present?
|
|
26
|
+
File.exist?(@path)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def all_files
|
|
30
|
+
@all_files ||= threads.map(&:files).flatten.sort
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def files_for_thread(thread_index)
|
|
34
|
+
threads[thread_index].files
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def threads
|
|
38
|
+
@threads ||= load_data.map.with_index do |raw_thread, index|
|
|
39
|
+
TestBoosters::SplitConfiguration::Thread.new(raw_thread["files"].sort, index)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
private
|
|
44
|
+
|
|
45
|
+
def load_data
|
|
46
|
+
if present?
|
|
47
|
+
JSON.parse(File.read(@path))
|
|
48
|
+
else
|
|
49
|
+
[]
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
end
|
data/lib/test_boosters.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: semaphore_test_boosters
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- MAINTAINER Rendered Text
|
|
@@ -107,8 +107,8 @@ files:
|
|
|
107
107
|
- lib/test_boosters/leftover_files.rb
|
|
108
108
|
- lib/test_boosters/logger.rb
|
|
109
109
|
- lib/test_boosters/rspec_booster.rb
|
|
110
|
-
- lib/test_boosters/run_cucumber_config.rb
|
|
111
110
|
- lib/test_boosters/shell.rb
|
|
111
|
+
- lib/test_boosters/split_configuration.rb
|
|
112
112
|
- lib/test_boosters/version.rb
|
|
113
113
|
- test_boosters.gemspec
|
|
114
114
|
- test_data/a.feature
|
|
File without changes
|