From 540736b493541dd4791d78b62a9e8be983598aa2 Mon Sep 17 00:00:00 2001 From: fijal Date: Tue, 6 Feb 2007 19:57:14 +0100 Subject: [PATCH] [svn r38022] be a bit more verbose before rsync. --HG-- branch : trunk --- py/test/rsession/hostmanage.py | 7 +++---- py/test/rsession/repevent.py | 2 +- py/test/rsession/reporter.py | 4 +++- py/test/rsession/rest.py | 3 +++ py/test/rsession/testing/test_reporter.py | 2 +- py/test/rsession/testing/test_rest.py | 2 +- py/test/rsession/web.py | 2 +- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/py/test/rsession/hostmanage.py b/py/test/rsession/hostmanage.py index 49e2444f8..68547359e 100644 --- a/py/test/rsession/hostmanage.py +++ b/py/test/rsession/hostmanage.py @@ -120,18 +120,17 @@ class HostManager(object): roots = [self.config.topdir] self.roots = roots - def prepare_gateways(self): + def prepare_gateways(self, reporter): dist_remotepython = self.config.getvalue("dist_remotepython") for host in self.hosts: host.initgateway(python=dist_remotepython) + reporter(repevent.HostGatewayReady(host, self.roots)) host.gw.host = host def init_rsync(self, reporter): # send each rsync root ignores = self.config.getvalue_pathlist("dist_rsync_ignore") - self.prepare_gateways() - for host in self.hosts: - reporter(repevent.HostRSyncRoots(host, self.roots)) + self.prepare_gateways(reporter) for root in self.roots: rsync = HostRSync(ignores=ignores) destrelpath = root.relto(self.config.topdir) diff --git a/py/test/rsession/repevent.py b/py/test/rsession/repevent.py index 078038036..d2bfa67dc 100644 --- a/py/test/rsession/repevent.py +++ b/py/test/rsession/repevent.py @@ -77,7 +77,7 @@ class HostRSyncing(ReportEvent): def __init__(self, host): self.host = host -class HostRSyncRoots(ReportEvent): +class HostGatewayReady(ReportEvent): def __init__(self, host, roots): self.host = host self.roots = roots diff --git a/py/test/rsession/reporter.py b/py/test/rsession/reporter.py index b82cea745..a014b9288 100644 --- a/py/test/rsession/reporter.py +++ b/py/test/rsession/reporter.py @@ -60,8 +60,10 @@ class AbstractReporter(object): print "%10s: RSYNC ==> %s" % (item.host.hostname[:10], item.host.relpath) - def report_HostRSyncRoots(self, item): + def report_HostGatewayReady(self, item): self.to_rsync[item.host] = len(item.roots) + self.out.write("%10s: gateway initialised (PYTHONPATH = %s)\n"\ + % (item.host.hostname, item.host.gw_remotepath)) def report_HostRSyncRootReady(self, item): self.to_rsync[item.host] -= 1 diff --git a/py/test/rsession/rest.py b/py/test/rsession/rest.py index a20f4ad6e..b4c4f7b81 100644 --- a/py/test/rsession/rest.py +++ b/py/test/rsession/rest.py @@ -63,6 +63,9 @@ class RestReporter(AbstractReporter): def report_ImmediateFailure(self, item): pass + def report_HostGatewayReady(self, item): + self.to_rsync[item.host] = len(item.roots) + def report_ItemStart(self, event): item = event.item if isinstance(item, py.test.collect.Module): diff --git a/py/test/rsession/testing/test_reporter.py b/py/test/rsession/testing/test_reporter.py index 0cb4882b6..90eaf04a8 100644 --- a/py/test/rsession/testing/test_reporter.py +++ b/py/test/rsession/testing/test_reporter.py @@ -162,7 +162,7 @@ class AbstractTestReporter(object): r = self.reporter(config, hosts) r.report(repevent.TestStarted(hosts, config.topdir, ["a", "b", "c"])) for host in hosts: - r.report(repevent.HostRSyncRoots(host, ["a", "b", "c"])) + r.report(repevent.HostGatewayReady(host, ["a", "b", "c"])) for host in hosts: for root in ["a", "b", "c"]: r.report(repevent.HostRSyncRootReady(host, root)) diff --git a/py/test/rsession/testing/test_rest.py b/py/test/rsession/testing/test_rest.py index 1d757c3ae..e93f6ee75 100644 --- a/py/test/rsession/testing/test_rest.py +++ b/py/test/rsession/testing/test_rest.py @@ -60,7 +60,7 @@ class TestRestUnits(object): def test_report_HostRSyncRootReady(self): h = HostInfo('localhost') reporter.hosts_to_rsync = 1 - reporter.report(repevent.HostRSyncRoots(h, ["a"])) + reporter.report(repevent.HostGatewayReady(h, ["a"])) event = repevent.HostRSyncRootReady(h, "a") reporter.report(event) assert stdout.getvalue() == '::\n\n localhost: READY\n\n' diff --git a/py/test/rsession/web.py b/py/test/rsession/web.py index 2991b6f88..9d71ef2e6 100644 --- a/py/test/rsession/web.py +++ b/py/test/rsession/web.py @@ -303,7 +303,7 @@ class ExportedMethods(BasicExternal): def _host_ready(self, event): self.pending_events.put(event) - def report_HostRSyncRoots(self, item): + def report_HostGatewayReady(self, item): self.to_rsync[item.host] = len(item.roots) def report_HostRSyncRootReady(self, item):