Module: Backend::Test::Tasks

Defined in:
test/tasks.rb

Overview

Module that holds methods for running the different parts of the backend server

Instance Method Summary collapse

Instance Method Details

#run_admin(args) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
# File 'test/tasks.rb', line 41

def run_admin(args)
  Rails.logger.debug 'run admin'
  ret = -1
  perlopts = "-I#{Rails.root}/../backend -I#{Rails.root}/../backend/build"
  IO.popen("cd #{backend_config}; exec perl #{perlopts} ./bs_admin #{args}") do |io|
    io.each { |line| Rails.logger.debug("bs_admin: #{line.strip.chomp}") if line.present? }
    io.close
    ret = $CHILD_STATUS
  end
  ret
end

#run_deltastoreObject



32
33
34
35
36
37
38
39
# File 'test/tasks.rb', line 32

def run_deltastore
  Rails.logger.debug 'run deltastore'
  perlopts = "-I#{Rails.root}/../backend -I#{Rails.root}/../backend/build"
  IO.popen("cd #{backend_config}; exec perl #{perlopts} ./bs_deltastore --testmode") do |io|
    # just for waiting until deltastore finishes
    io.each { |line| Rails.logger.debug("deltastore: #{line.strip.chomp}") if line.present? }
  end
end

#run_dispatcherObject



14
15
16
17
18
19
20
21
# File 'test/tasks.rb', line 14

def run_dispatcher
  Rails.logger.debug 'run dispatcher'
  perlopts = "-I#{Rails.root}/../backend -I#{Rails.root}/../backend/build"
  IO.popen("cd #{backend_config}; exec perl #{perlopts} ./bs_dispatch --testmode") do |io|
    # just for waiting until dispatcher finishes
    io.each { |line| Rails.logger.debug("dispatcher: #{line.strip.chomp}") if line.present? }
  end
end

#run_publisherObject



23
24
25
26
27
28
29
30
# File 'test/tasks.rb', line 23

def run_publisher
  Rails.logger.debug 'run publisher'
  perlopts = "-I#{Rails.root}/../backend -I#{Rails.root}/../backend/build"
  IO.popen("cd #{backend_config}; exec perl #{perlopts} ./bs_publish --testmode") do |io|
    # just for waiting until publisher finishes
    io.each { |line| Rails.logger.debug("publisher: #{line.strip.chomp}") if line.present? }
  end
end

#run_scheduler(arch) ⇒ Object



5
6
7
8
9
10
11
12
# File 'test/tasks.rb', line 5

def run_scheduler(arch)
  Rails.logger.debug "RUN_SCHEDULER #{arch}"
  perlopts = "-I#{Rails.root}/../backend -I#{Rails.root}/../backend/build"
  IO.popen("cd #{backend_config}; exec perl #{perlopts} ./bs_sched --testmode #{arch}") do |io|
    # just for waiting until scheduler finishes
    io.each { |line| Rails.logger.debug("scheduler(#{arch}): #{line.strip.chomp}") if line.present? }
  end
end