class Roby::App::TestServer

DRuby server for a client/server scheme in autotest

The client side is implemented in {TestReporter}

Note that the idea and a big chunk of the implementation has been taken from the minitest-server plugin. The main differences is that it accounts for load errors (exceptions that happen outside of minitest itself) and is using DRoby's marshalling for exceptions

Attributes

manager[R]

The autorespawn manager

@return [Autorespawn::Manager]

server_id[R]

A value that allows to identify this server uniquely

Usually the server PID

Public Class Methods

new(server_id, manager = DRoby::Marshal.new(auto_create_plans: true)) click to toggle source
# File lib/roby/app/test_server.rb, line 123
def initialize(server_id, manager = DRoby::Marshal.new(auto_create_plans: true))
    @server_id = server_id
    @manager = manager
end
path(pid = Process.pid) click to toggle source
# File lib/roby/app/test_server.rb, line 36
def self.path(pid = Process.pid)
    "drbunix:#{Dir.tmpdir}/minitest.#{pid}"
end
start(id) click to toggle source
# File lib/roby/app/test_server.rb, line 113
def self.start(id)
    server = new(id)
    DRb.start_service path, server
    server
end
stop() click to toggle source
# File lib/roby/app/test_server.rb, line 119
def self.stop
    DRb.stop_service
end

Public Instance Methods

discovery_finished(pid) click to toggle source
# File lib/roby/app/test_server.rb, line 132
def discovery_finished(pid)
    run_hook :on_discovery_finished, pid
end
discovery_start(pid) click to toggle source
# File lib/roby/app/test_server.rb, line 128
def discovery_start(pid)
    run_hook :on_discovery_start, pid
end
exception(pid, e) click to toggle source
# File lib/roby/app/test_server.rb, line 136
def exception(pid, e)
    run_hook :on_exception, pid, manager.local_object(e)
end
test_finished(pid) click to toggle source
# File lib/roby/app/test_server.rb, line 153
def test_finished(pid)
    run_hook :on_test_finished, pid
end
test_method(pid, file, klass, method) click to toggle source
# File lib/roby/app/test_server.rb, line 144
def test_method(pid, file, klass, method)
    run_hook :on_test_method, pid, file, klass, method
end
test_result(pid, file, klass, method, fails, assertions, time) click to toggle source
# File lib/roby/app/test_server.rb, line 148
def test_result(pid, file, klass, method, fails, assertions, time)
    run_hook :on_test_result, pid, file, klass, method,
        manager.local_object(fails), assertions, time
end
test_start(pid) click to toggle source
# File lib/roby/app/test_server.rb, line 140
def test_start(pid)
    run_hook :on_test_start, pid
end