Sha256: 7f81401281034d21ccefe3e4f45a02d39dd6234339efefcc39dd4caa39b495e8

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

module Stella::Engine
  module Functional
    extend Stella::Engine::Base
    extend self
    
    def run(plan, opts={})
      opts = {
        :hosts        => [],
        :benchmark    => false,
        :repetitions  => 1
      }.merge! opts
      Stella.ld "OPTIONS: #{opts.inspect}"
      Stella.li2 "Hosts: " << opts[:hosts].join(', ') if !opts[:hosts].empty?
      Stella.li plan.pretty
      
      client = Stella::Client.new opts[:hosts].first
      client.add_observer(self)
      client.enable_benchmark_mode if opts[:benchmark]
      
      Stella.li $/, "Starting test...", $/
      Drydock::Screen.flush
      sleep 0.2
      
      plan.usecases.each_with_index do |uc,i|
        desc = (uc.desc || "Usecase ##{i+1}")
        Stella.li ' %-65s '.att(:reverse).bright % [desc]
        Stella.rescue { client.execute uc }
      end
      
      Drydock::Screen.flush
      
      !plan.errors?
    end
    
  end
end

__END__


$ stella verify -p examples/basic/plan.rb http://localhost:3114
$ stella load -p examples/basic/plan.rb http://localhost:3114
$ stella remote-load -p examples/basic/plan.rb http://localhost:3114
$ stella remote-verify -p examples/basic/plan.rb http://localhost:3114

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
solutious-stella-0.7.0.004 lib/stella/engine/functional.rb
stella-0.7.0.004 lib/stella/engine/functional.rb