semaphore_test_boosters 1.6.2 → 1.7.0
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
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2d856d4423e513d330d8ac0e488916dd7086917
|
4
|
+
data.tar.gz: b75f81f4225d010278f15d2c6ac3261833dee343
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 315807874e3dd7792d1bb3c52549667924e6a54974de2b1354c2b714469610a4c8d68813a72d96f076497e0bd1214eca462ad9dee8cdf074fbad9c8b6acdb9e6
|
7
|
+
data.tar.gz: 5040e37162ced1bbb7de4663070d36442e0e236699b2772e685716247ae4503de562054a324da415917eb0675b5c50b9ca451a1ea99bdbced17f092be5497e6d
|
data/.rubocop.yml
CHANGED
@@ -11,24 +11,17 @@ module TestBoosters
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def run
|
14
|
+
TestBoosters::Shell.display_title("Cucumber Booster v#{TestBoosters::VERSION}")
|
14
15
|
display_system_info
|
15
16
|
|
16
|
-
unless split_configuration.valid?
|
17
|
-
puts "[ERROR] The split configuration file is malformed!"
|
18
|
-
|
19
|
-
return 1 # failure exit status
|
20
|
-
end
|
21
|
-
|
22
17
|
threads[@thread_index].run
|
23
18
|
end
|
24
19
|
|
25
20
|
def display_system_info
|
26
|
-
TestBoosters::Shell.display_title("Cucumber Booster v#{TestBoosters::VERSION}")
|
27
|
-
|
28
21
|
TestBoosters::ProjectInfo.display_ruby_version
|
29
22
|
TestBoosters::ProjectInfo.display_bundler_version
|
30
23
|
TestBoosters::ProjectInfo.display_cucumber_version
|
31
|
-
|
24
|
+
TestBoosters::ProjectInfo.display_split_configuration_info(split_configuration)
|
32
25
|
puts
|
33
26
|
end
|
34
27
|
|
@@ -26,5 +26,11 @@ module TestBoosters
|
|
26
26
|
puts "Cucumber Version: #{version}"
|
27
27
|
end
|
28
28
|
|
29
|
+
def display_split_configuration_info(split_configuration)
|
30
|
+
puts "Split configuration present: #{split_configuration.present? ? "yes" : "no"}"
|
31
|
+
puts "Split configuration valid: #{split_configuration.valid? ? "yes" : "no"}"
|
32
|
+
puts "Split configuration file count: #{split_configuration.all_files.size}"
|
33
|
+
end
|
34
|
+
|
29
35
|
end
|
30
36
|
end
|
@@ -11,24 +11,17 @@ module TestBoosters
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def run
|
14
|
+
TestBoosters::Shell.display_title("RSpec Booster v#{TestBoosters::VERSION}")
|
14
15
|
display_system_info
|
15
16
|
|
16
|
-
unless split_configuration.valid?
|
17
|
-
puts "[ERROR] The split configuration file is malformed!"
|
18
|
-
|
19
|
-
return 1 # failure exit status
|
20
|
-
end
|
21
|
-
|
22
17
|
threads[@thread_index].run
|
23
18
|
end
|
24
19
|
|
25
20
|
def display_system_info
|
26
|
-
TestBoosters::Shell.display_title("RSpec Booster v#{TestBoosters::VERSION}")
|
27
|
-
|
28
21
|
TestBoosters::ProjectInfo.display_ruby_version
|
29
22
|
TestBoosters::ProjectInfo.display_bundler_version
|
30
23
|
TestBoosters::ProjectInfo.display_rspec_version
|
31
|
-
|
24
|
+
TestBoosters::ProjectInfo.display_split_configuration_info(split_configuration)
|
32
25
|
puts
|
33
26
|
end
|
34
27
|
|
@@ -5,6 +5,7 @@ module TestBoosters
|
|
5
5
|
|
6
6
|
def initialize(path)
|
7
7
|
@path = path
|
8
|
+
@valid = true
|
8
9
|
end
|
9
10
|
|
10
11
|
def present?
|
@@ -13,9 +14,8 @@ module TestBoosters
|
|
13
14
|
|
14
15
|
def valid?
|
15
16
|
threads # try to load data into memory
|
16
|
-
|
17
|
-
|
18
|
-
false
|
17
|
+
|
18
|
+
@valid
|
19
19
|
end
|
20
20
|
|
21
21
|
def all_files
|
@@ -23,23 +23,41 @@ module TestBoosters
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def files_for_thread(thread_index)
|
26
|
-
threads[thread_index]
|
26
|
+
thread = threads[thread_index]
|
27
|
+
|
28
|
+
thread ? thread.files : []
|
27
29
|
end
|
28
30
|
|
29
31
|
def threads
|
30
|
-
@threads ||= load_data
|
31
|
-
TestBoosters::SplitConfiguration::Thread.new(raw_thread["files"].sort, index)
|
32
|
-
end
|
32
|
+
@threads ||= present? ? load_data : []
|
33
33
|
end
|
34
34
|
|
35
35
|
private
|
36
36
|
|
37
|
+
# :reek:TooManyStatements
|
37
38
|
def load_data
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
@valid = false
|
40
|
+
|
41
|
+
content = JSON.parse(File.read(@path)).map.with_index do |raw_thread, index|
|
42
|
+
TestBoosters::SplitConfiguration::Thread.new(raw_thread.fetch("files").sort, index)
|
42
43
|
end
|
44
|
+
|
45
|
+
@valid = true
|
46
|
+
|
47
|
+
content
|
48
|
+
rescue TypeError, KeyError => ex
|
49
|
+
log_error("Split Configuration has invalid structure", ex)
|
50
|
+
|
51
|
+
[]
|
52
|
+
rescue JSON::ParserError => ex
|
53
|
+
log_error("Split Configuration is not parsable", ex)
|
54
|
+
|
55
|
+
[]
|
56
|
+
end
|
57
|
+
|
58
|
+
def log_error(message, exception)
|
59
|
+
TestBoosters::Logger.error(message)
|
60
|
+
TestBoosters::Logger.error(exception.inspect)
|
43
61
|
end
|
44
62
|
|
45
63
|
end
|