Module: BigBench::Bot

Defined in:
lib/bigbench/bot.rb

Overview

A bot is used for remote testing. It is running in the background of a machine and waits for tests to run. If you want to run a test with a cluster of 20 machines, simply set them all up and start the bot with:

bigbench start bot [REDIS_RUL_WITH_PORT REDIS_PASSWORD]

A bot will automatically check for a new test every minute. If a new test is available it runs the test and reports its results back to the redis. After that it goes into listening mode again.

Class Method Summary collapse

Class Method Details

.check_test!Object

Checks if there is a new test waiting on the store.

If yes, it loads this test and executes it. After it has finished it writes its trackings to the stores tracking array.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/bigbench/bot.rb', line 18

def self.check_test!
  return unless BigBench::Store.running?
  
  BigBench::Output.bot_received_test_instructions
  @id = SecureRandom.hex(16) if @id.nil?
  
  BigBench.config.mode = :bot
  BigBench.load_test!(BigBench::Store.test)
  
  BigBench::Store.bot_is_working(@id)
  BigBench.run!
  BigBench.write_trackings_to_store!
  BigBench::Store.bot_stopped_working(@id)
end