Sha256: 742f2914b2810aa302105cd5d4b659bd9f7926d19aa619b2f4a3cd6929f48653

Contents?: true

Size: 1.66 KB

Versions: 3

Compression:

Stored size: 1.66 KB

Contents

namespace :borg do
  [:unit, :functional].each do |t|
    type = t.to_s.sub(/s$/, '')

    desc "Run #{type} tests"
    task t, :count do |t, args|
      Borg.load_environment
      size = args[:count] ? args[:count].to_i : 3
      #Borg.prepare_all_databases(size)
      puts "Running #{type} tests using #{size} processes"
      Borg.run_tests type, size
    end
  end
  
  desc "Request server to run test"
  task :build => :environment do
    # Borg::TestUnit.new().add_to_redis
    # Borg::CucumberRunner.new().add_to_redis
    EM.run {
      Borg::Requestor.make_request
    }
  end

  desc "Start server"
  task :start_server => :environment do
    EM.run {
      puts "Ip is #{Borg::Config.ip} and #{Borg::Config.port}"
      EM.start_server(Borg::Config.ip,Borg::Config.port,Borg::Server)
    }
  end

  desc "Start Client"
  task :start_client => :environment do
    EM.run {
      EM.connect(Borg::Config.ip,Borg::Config.port,Borg::Worker)
    }
  end

  desc "Run unit and functional test"
  task :test do
    Borg::TestUnit.new().run()
  end

  desc "Run cucumber tests"
  task :cucumber do
    Borg::CucumberRunner.new().run()
  end

  
#  desc "Run redis tests"
#  task :redis_test, :count do |t,args|
#    Borg.load_environment('test')
#    size = args[:count] ? args[:count].to_i : 3
#    puts "Running tests using #{size} processes"
#    Borg.run_redis_test(size)
#  end
#
#  desc "Run cucumber parallel test"
#  task :cucumber, :count do |t,args|
#    Borg.load_environment('cucumber')
#    size = args[:count] ? args[:count].to_i : 3
#    puts "Running Cucumber tests using #{size} processes"
#    puts "Using the default profile..."
#    Borg.run_cucumber(size)
#  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
borg-0.0.8 lib/borg/borg_tasks.rake
borg-0.0.7 lib/borg/borg_tasks.rake
borg-0.0.6 lib/borg/borg_tasks.rake