Class: TestBoosters::Cucumber::Thread
- Inherits:
-
Object
- Object
- TestBoosters::Cucumber::Thread
- Defined in:
- lib/test_boosters/cucumber/thread.rb
Instance Attribute Summary collapse
-
#files_from_split_configuration ⇒ Object
readonly
Returns the value of attribute files_from_split_configuration.
-
#leftover_files ⇒ Object
readonly
Returns the value of attribute leftover_files.
Instance Method Summary collapse
- #all_files ⇒ Object
- #cucumber_command ⇒ Object
- #display_thread_info ⇒ Object
-
#initialize(files_from_split_configuration, leftover_files) ⇒ Thread
constructor
A new instance of Thread.
- #report_path ⇒ Object
-
#run ⇒ Object
:reek:TooManyStatements { max_statements: 10 }.
- #run_cucumber ⇒ Object
- #run_cucumber_config ⇒ Object
- #upload_report ⇒ Object
Constructor Details
#initialize(files_from_split_configuration, leftover_files) ⇒ Thread
Returns a new instance of Thread.
8 9 10 11 |
# File 'lib/test_boosters/cucumber/thread.rb', line 8 def initialize(files_from_split_configuration, leftover_files) @files_from_split_configuration = files_from_split_configuration @leftover_files = leftover_files end |
Instance Attribute Details
#files_from_split_configuration ⇒ Object (readonly)
Returns the value of attribute files_from_split_configuration.
5 6 7 |
# File 'lib/test_boosters/cucumber/thread.rb', line 5 def files_from_split_configuration @files_from_split_configuration end |
#leftover_files ⇒ Object (readonly)
Returns the value of attribute leftover_files.
6 7 8 |
# File 'lib/test_boosters/cucumber/thread.rb', line 6 def leftover_files @leftover_files end |
Instance Method Details
#all_files ⇒ Object
57 58 59 |
# File 'lib/test_boosters/cucumber/thread.rb', line 57 def all_files @all_files ||= files_from_split_configuration + leftover_files end |
#cucumber_command ⇒ Object
61 62 63 |
# File 'lib/test_boosters/cucumber/thread.rb', line 61 def cucumber_command "bundle exec cucumber #{all_files.join(" ")}" end |
#display_thread_info ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/test_boosters/cucumber/thread.rb', line 32 def display_thread_info TestBoosters::Shell.display_files( "Known specs for this thread", files_from_split_configuration) TestBoosters::Shell.display_files( "Leftover specs for this thread", leftover_files) end |
#report_path ⇒ Object
65 66 67 |
# File 'lib/test_boosters/cucumber/thread.rb', line 65 def report_path @report_path ||= ENV["REPORT_PATH"] || "#{ENV["HOME"]}/cucumber_report.json" end |
#run ⇒ Object
:reek:TooManyStatements { max_statements: 10 }
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/test_boosters/cucumber/thread.rb', line 14 def run if all_files.empty? puts("No files to run in this thread!") return 0 end run_cucumber_config display_thread_info exit_status = run_cucumber upload_report exit_status end |
#run_cucumber ⇒ Object
48 49 50 51 |
# File 'lib/test_boosters/cucumber/thread.rb', line 48 def run_cucumber TestBoosters::Shell.display_title("Running Cucumber") TestBoosters::Shell.execute(cucumber_command) end |
#run_cucumber_config ⇒ Object
42 43 44 45 46 |
# File 'lib/test_boosters/cucumber/thread.rb', line 42 def run_cucumber_config CucumberBoosterConfig::Injection.new(Dir.pwd, report_path).run puts "-------------------------------------------------------" puts end |
#upload_report ⇒ Object
53 54 55 |
# File 'lib/test_boosters/cucumber/thread.rb', line 53 def upload_report TestBoosters::InsightsUploader.upload("cucumber", report_path) end |