### Home Classes Methods

### In Files

- lib/stella/testplan.rb

### Parent

Storable

### Methods

- #checkup?
- #cust
- #destroy!
- #duration
- #errors?
- #host
- #hostid
- #id
- #init
- #monitor?
- #owner?
- #postprocess
- #preprocess
- #run
- #runid

### Included Modules

- Gibbler::Complex
- Familia
- Familia::Stamps
- Stella::Common::PrivacyMethods

### Files

- LICENSE.txt
- TODO

### Class/Module Index

Quicksearch

- Stella
- Stella::API
- Stella::API::Unauthorized
- Stella::Asserts
- Stella::CLI
- Stella::Client
- Stella::Common
- Stella::Common::PrivacyMethods
- Stella::ET
- Stella::Engine
- Stella::Engine::Base
- Stella::Engine::Base::ClassMethods
- Stella::Engine::Checkup
- Stella::EventTemplate
- Stella::ForcedRedirect
- Stella::HTTPError
- Stella::Log
- Stella::Log::HTTP
- Stella::PageError
- Stella::RT
- Stella::RepeatRequest
- Stella::Report
- Stella::Report::Content
- Stella::Report::Content::ReportMethods
- Stella::Report::Errors
- Stella::Report::Errors::ReportMethods
- Stella::Report::Headers
- Stella::Report::Metrics
- Stella::Report::Metrics::ReportMethods
- Stella::Report::Plugin
- Stella::Report::Plugin::ClassMethods
- Stella::Report::Statuses
- Stella::Report::Statuses::ReportMethods
- Stella::RequestError
- Stella::RequestTemplate
- Stella::Session
- Stella::StringTemplate
- Stella::TP
- Stella::Testplan
- Stella::Testplan::ClassMethods
- Stella::TestplanQuit
- Stella::Testrun
- Stella::TimeoutError
- Stella::UC
- Stella::Usecase
- Stella::Usecase::ClassMethods
- Stella::UsecaseError
- Stella::UsecaseFail
- Stella::Utils
- Stella::VERSION
- Addressable
- Addressable::URI
- Time
- Time::Units
- Array
- DefaultTestplan
- Float
- Hash
- MatchData
- MetricsPack
- Numeric
- Object
- OpenStruct
- StellaBehavior
- StellaError
- String
- Symbol
- Thread

No matching classes.

# Stella::Testrun

### Attributes

statuses[R]
plan[R]

### Public Instance Methods

checkup?() click to toggle source

    # File lib/stella/testplan.rb, line 438
    def checkup?
      @mode == :checkup
    end

cust() click to toggle source

    # File lib/stella/testplan.rb, line 462
    def cust
      @cust ||= Customer.from_redis @custid
      @cust || Customer.anonymous
    end

destroy!() click to toggle source

    # File lib/stella/testplan.rb, line 444
    def destroy!
      VendorInfo.global.checkups.remove self
      host.checkups.remove self if host
      plan.checkups.remove self if plan
      cust.checkups.remove self if cust
      super
    end

duration() click to toggle source

    # File lib/stella/testplan.rb, line 398
    def duration
      return 0 unless @stime
      (@etime || Stella.now) - @stime
    end

errors?() click to toggle source

    # File lib/stella/testplan.rb, line 402
    def errors?
      @report && @report.errors?
    end

host() click to toggle source

    # File lib/stella/testplan.rb, line 466
    def host
      @host ||= plan.host if plan
      @host
    end

hostid() click to toggle source

    # File lib/stella/testplan.rb, line 425
    def hostid
      # NOTE: This method is needed only until May 30 or so.
      # (there was an issue where incidents were not including a hostid)
      @hostid || (plan.nil? ? nil : plan.hostid)
    end

id() click to toggle source

    # File lib/stella/testplan.rb, line 393
    def id
      @id ||= gibbler
      @id
    end

Also aliased as: runid
init(plan=nil, mode=nil, options={}) click to toggle source

    # File lib/stella/testplan.rb, line 386
    def init plan=nil, mode=nil, options={}
      @ctime = Stella.now
      @plan, @mode = plan, mode
      @options = {
      }.merge options
      preprocess
    end

monitor?() click to toggle source

    # File lib/stella/testplan.rb, line 441
    def monitor?
      @mode == :monitor
    end

owner?(obj) click to toggle source

    # File lib/stella/testplan.rb, line 458
    def owner?(obj)
      obj = Customer === obj ? obj.custid : obj
      cust.username?(obj)
    end

postprocess() click to toggle source

    # File lib/stella/testplan.rb, line 415
    def postprocess
      @id &&= Gibbler::Digest.new(@id)
      # Calling plan calls Redis.
      #@privacy = plan.privacy if Stella::Testplan === plan
      if Hash === @report
        @report = Stella::Report.from_hash @report
        @report.runid = runid
      end
      @planid &&= Gibbler::Digest.new(@planid)
    end

preprocess() click to toggle source

    # File lib/stella/testplan.rb, line 405
    def preprocess
      @salt ||= Stella.now.digest.short
      @status ||= :new
      if @plan
        @planid = @plan.id
        @hostid = @plan.hostid
      end
      @options ||= {}
      @privacy ||= false
    end

run(opts={}) click to toggle source

    # File lib/stella/testplan.rb, line 430
    def run opts={}
      raise StellaError.new("No mode") unless Stella::Engine.mode?(@mode)
      engine = Stella::Engine.load(@mode)
      opts.merge! @options
      engine.run self, opts
      save if respond_to? :save
      self.report
    end

runid() click to toggle source
Alias for: id

[Validate]

Generated with the Darkfish Rdoc Generator 2.