diff --git a/py/test/rsession/hostmanage.py b/py/test/rsession/hostmanage.py index 34ffcff6a..49e2444f8 100644 --- a/py/test/rsession/hostmanage.py +++ b/py/test/rsession/hostmanage.py @@ -115,6 +115,10 @@ class HostManager(object): hosts = self.config.getvalue("dist_hosts") hosts = [HostInfo(x) for x in hosts] self.hosts = hosts + roots = self.config.getvalue_pathlist("dist_rsync_roots") + if roots is None: + roots = [self.config.topdir] + self.roots = roots def prepare_gateways(self): dist_remotepython = self.config.getvalue("dist_remotepython") @@ -124,14 +128,11 @@ class HostManager(object): def init_rsync(self, reporter): # send each rsync root - roots = self.config.getvalue_pathlist("dist_rsync_roots") ignores = self.config.getvalue_pathlist("dist_rsync_ignore") - if roots is None: - roots = [self.config.topdir] self.prepare_gateways() for host in self.hosts: - reporter(repevent.HostRSyncRoots(host, roots)) - for root in roots: + reporter(repevent.HostRSyncRoots(host, self.roots)) + for root in self.roots: rsync = HostRSync(ignores=ignores) destrelpath = root.relto(self.config.topdir) for host in self.hosts: diff --git a/py/test/rsession/repevent.py b/py/test/rsession/repevent.py index 5f8653c8e..078038036 100644 --- a/py/test/rsession/repevent.py +++ b/py/test/rsession/repevent.py @@ -88,8 +88,10 @@ class HostRSyncRootReady(ReportEvent): self.root = root class TestStarted(ReportEvent): - def __init__(self, hosts): + def __init__(self, hosts, topdir, roots): self.hosts = hosts + self.topdir = topdir + self.roots = roots self.timestart = time.time() class TestFinished(ReportEvent): diff --git a/py/test/rsession/reporter.py b/py/test/rsession/reporter.py index 6275c5b01..b82cea745 100644 --- a/py/test/rsession/reporter.py +++ b/py/test/rsession/reporter.py @@ -82,6 +82,11 @@ class AbstractReporter(object): self.hosts_to_rsync = len(item.hosts) self.out.sep("=", txt) self.timestart = item.timestart + self.out.write("Root directory: %s\n" % item.topdir) + roots = [str(i.relto(item.topdir)) for i in item.roots] + self.out.write("To rsync:\n") + for root in roots: + self.out.write(" => %s\n" % root) def report_RsyncFinished(self, item): self.timersync = item.time diff --git a/py/test/rsession/rsession.py b/py/test/rsession/rsession.py index bcd40559d..cb0557c2e 100644 --- a/py/test/rsession/rsession.py +++ b/py/test/rsession/rsession.py @@ -132,7 +132,8 @@ class RSession(AbstractSession): hm.hosts, RemoteReporter) reporter, checkfun = self.wrap_reporter(reporter) - reporter(repevent.TestStarted(hm.hosts)) + reporter(repevent.TestStarted(hm.hosts, self.config.topdir, + hm.roots)) try: nodes = hm.setup_hosts(reporter) @@ -186,7 +187,7 @@ class LSession(AbstractSession): hosts, LocalReporter, args[0]) reporter, checkfun = self.wrap_reporter(reporter) - reporter(repevent.TestStarted(hosts)) + reporter(repevent.TestStarted(hosts, self.config.topdir, [])) colitems = self.config.getcolitems() reporter(repevent.RsyncFinished()) diff --git a/py/test/rsession/testing/test_reporter.py b/py/test/rsession/testing/test_reporter.py index 0861e11f6..0cb4882b6 100644 --- a/py/test/rsession/testing/test_reporter.py +++ b/py/test/rsession/testing/test_reporter.py @@ -142,7 +142,7 @@ class AbstractTestReporter(object): rootcol = py.test.collect.Directory(tmpdir) host = HostInfo('localhost') r = self.reporter(config, [host]) - r.report(repevent.TestStarted([host])) + r.report(repevent.TestStarted([host], config.topdir, ["a"])) r.report(repevent.RsyncFinished()) list(rootcol._tryiter(reporterror=lambda x : AbstractSession.reporterror(r.report, x))) r.report(repevent.TestFinished()) @@ -160,7 +160,7 @@ class AbstractTestReporter(object): config = py.test.config._reparse([str(tmpdir)]) hosts = [HostInfo(i) for i in ["host1", "host2", "host3"]] r = self.reporter(config, hosts) - r.report(repevent.TestStarted(hosts)) + r.report(repevent.TestStarted(hosts, config.topdir, ["a", "b", "c"])) for host in hosts: r.report(repevent.HostRSyncRoots(host, ["a", "b", "c"])) for host in hosts: diff --git a/py/test/rsession/testing/test_rest.py b/py/test/rsession/testing/test_rest.py index b55af3b54..1d757c3ae 100644 --- a/py/test/rsession/testing/test_rest.py +++ b/py/test/rsession/testing/test_rest.py @@ -66,8 +66,9 @@ class TestRestUnits(object): assert stdout.getvalue() == '::\n\n localhost: READY\n\n' def test_report_TestStarted(self): - event = repevent.TestStarted(hosts=[HostInfo('localhost'), - HostInfo('foo.com')]) + event = repevent.TestStarted([HostInfo('localhost'), + HostInfo('foo.com')], + "aa", ["a", "b"]) reporter.report(event) assert stdout.getvalue() == """\ ===========================================