semaphore_test_boosters 1.0.2 → 1.1.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: 761bccbbc970b3f32927078ef6896514a77e8593
4
- data.tar.gz: 7cc8fb8108863de9874e6ee69ccea98f021dde29
3
+ metadata.gz: de11355f9b3609986d8302b9bc0619371bd28ef2
4
+ data.tar.gz: 142b0c79b6ff473d3743df0da109287f200778b5
5
5
  SHA512:
6
- metadata.gz: ddd635e918b87531ac1ef847258b1d28fdd2d40044565b922d802d3fddf776fdea34fd4231fe1adbedad3d41d6472a48fe36a5066d47b0d24e8628d32e3e7531
7
- data.tar.gz: 36413a6d1148bdaca1d27968c91cf3f839826c50356659f059f2dd1e64b9cdbc4ef4c6fb731fe6ef13de737c3ffd5eaf0cbca3e15147c4b4805db79482776651
6
+ metadata.gz: bf7b88817b12d5716046646cd1fd2c6f613deba3b27ac1a8c228d050724a91dae8bb13d3b2c8620bf892a36d36bc75291e307b6efe9c4cae5f7e0ee68f43e063
7
+ data.tar.gz: 666f07b3aa17dc5eeece0777f6cbfde7bba6552dd1f75295a14bf4780eec7b7f45f713cd0eb532615941ddffc212c76639aff40b1778812da48cfe755c3c68d7
@@ -9,7 +9,7 @@ module Semaphore
9
9
  class CucumberBooster
10
10
  def initialize(thread_index)
11
11
  @thread_index = thread_index
12
- @report_path = ENV["REPORT_PATH"] || "#{ENV["HOME"]}/cucumber_report.json"
12
+ @cucumber_split_configuration_path = ENV["CUCUMBER_SPLIT_CONFIGURATION_PATH"] || "#{ENV["HOME"]}/cucumber_split_configuration.json"
13
13
  @spec_path = ENV["SPEC_PATH"] || "features"
14
14
  end
15
15
 
@@ -41,21 +41,21 @@ module Semaphore
41
41
 
42
42
  def select
43
43
  with_fallback do
44
- feature_report = JSON.parse(File.read(@report_path))
45
- thread_count = feature_report.count
46
- thread = feature_report[@thread_index]
44
+ file_distribution = JSON.parse(File.read(@cucumber_split_configuration_path))
45
+ thread_count = file_distribution.count
46
+ thread = file_distribution[@thread_index]
47
47
 
48
48
  all_features = Dir["#{@spec_path}/**/*.feature"].sort
49
- all_known_features = feature_report.map { |t| t["files"] }.flatten.sort
49
+ all_known_features = file_distribution.map { |t| t["files"] }.flatten.sort
50
50
 
51
51
  all_leftover_features = all_features - all_known_features
52
- thread_leftover_features = LeftoverFiles::select(all_leftover_features, thread_count, @thread_index)
52
+ thread_leftover_features = LeftoverFiles.select(all_leftover_features, thread_count, @thread_index)
53
53
  thread_features = all_features & thread["files"].sort
54
54
  features_to_run = thread_features + thread_leftover_features
55
55
 
56
- Semaphore::display_files("This thread features:", thread_features)
57
- Semaphore::display_title_and_count("All leftover features:", all_leftover_features)
58
- Semaphore::display_files("This thread leftover features:", thread_leftover_features)
56
+ Semaphore.display_files("This thread features:", thread_features)
57
+ Semaphore.display_title_and_count("All leftover features:", all_leftover_features)
58
+ Semaphore.display_files("This thread leftover features:", thread_leftover_features)
59
59
 
60
60
  features_to_run
61
61
  end
@@ -73,7 +73,7 @@ module Semaphore
73
73
 
74
74
  error += %{Exception: #{e.message}}
75
75
 
76
- Semaphore::log(error)
76
+ Semaphore.log(error)
77
77
 
78
78
  raise
79
79
  end
@@ -9,6 +9,7 @@ module Semaphore
9
9
  class RspecBooster
10
10
  def initialize(thread_index)
11
11
  @thread_index = thread_index
12
+ @rspec_split_configuration_path = ENV["RSPEC_SPLIT_CONFIGURATION_PATH"] || "#{ENV["HOME"]}/rspec_split_configuration.json"
12
13
  @report_path = ENV["REPORT_PATH"] || "#{ENV["HOME"]}/rspec_report.json"
13
14
  @spec_path = ENV["SPEC_PATH"] || "spec"
14
15
  end
@@ -19,7 +20,7 @@ module Semaphore
19
20
  specs_to_run = select
20
21
 
21
22
  if specs_to_run.empty?
22
- puts "No spec files in this thread!"
23
+ puts "No spec files in this thread!"
23
24
  else
24
25
  exit_code = run_command(specs_to_run.join(" "))
25
26
  end
@@ -38,26 +39,26 @@ module Semaphore
38
39
  puts "========================= Running Rspec =========================="
39
40
  puts
40
41
 
41
- Semaphore::execute("bundle exec rspec #{options} #{specs}")
42
+ Semaphore.execute("bundle exec rspec #{options} #{specs}")
42
43
  end
43
44
 
44
45
  def select
45
46
  with_fallback do
46
- rspec_report = JSON.parse(File.read(@report_path))
47
- thread_count = rspec_report.count
48
- thread = rspec_report[@thread_index]
47
+ file_distribution = JSON.parse(File.read(@rspec_split_configuration_path))
48
+ thread_count = file_distribution.count
49
+ thread = file_distribution[@thread_index]
49
50
 
50
51
  all_specs = Dir["#{@spec_path}/**/*_spec.rb"].sort
51
- all_known_specs = rspec_report.map { |t| t["files"] }.flatten.sort
52
+ all_known_specs = file_distribution.map { |t| t["files"] }.flatten.sort
52
53
 
53
54
  all_leftover_specs = all_specs - all_known_specs
54
- thread_leftover_specs = LeftoverFiles::select(all_leftover_specs, thread_count, @thread_index)
55
+ thread_leftover_specs = LeftoverFiles.select(all_leftover_specs, thread_count, @thread_index)
55
56
  thread_specs = all_specs & thread["files"].sort
56
57
  specs_to_run = thread_specs + thread_leftover_specs
57
58
 
58
- Semaphore::display_files("This thread specs:", thread_specs)
59
- Semaphore::display_title_and_count("All leftover specs:", all_leftover_specs)
60
- Semaphore::display_files("This thread leftover specs:", thread_leftover_specs)
59
+ Semaphore.display_files("This thread specs:", thread_specs)
60
+ Semaphore.display_title_and_count("All leftover specs:", all_leftover_specs)
61
+ Semaphore.display_files("This thread leftover specs:", thread_leftover_specs)
61
62
 
62
63
  specs_to_run
63
64
  end
@@ -69,14 +70,13 @@ module Semaphore
69
70
  rescue StandardError => e
70
71
  error = %{
71
72
  WARNING: An error detected while parsing the test boosters report file.
72
- WARNING: All tests will be executed on the first thread.
73
+ WARNING: All tests will be executed on the first thread.\n
73
74
  }
74
75
 
75
- puts error
76
-
77
- error += %{Exception: #{e.message}}
76
+ error += %{Exception: #{e.message}\n#{e.backtrace.join("\n")}}
78
77
 
79
- Semaphore::log(error)
78
+ puts error
79
+ Semaphore.log(error)
80
80
 
81
81
  raise
82
82
  end
@@ -1,3 +1,3 @@
1
1
  module TestBoosters
2
- VERSION = "1.0.2"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semaphore_test_boosters
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MAINTAINER Rendered Text
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-06 00:00:00.000000000 Z
11
+ date: 2017-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semaphore_cucumber_booster_config