From 426526c692fecd520b1946f362e148d043c61441 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Wed, 29 Oct 2014 17:12:15 +0000 Subject: Echo stderr of subcommands that do network IO when --verbose is used Morph can appear to hang in situations where it is actually waiting on a slow network operation. This change gives users a way to see the output of the subcommands that are doing the network IO (either 'wget', 'git clone' or 'git remote update'). The status information goes onto stderr, because that is where the subcommands write it. Morph tends to put its status output on stdout, but (a) some commands are machine-parsed, such as `serialise-artifact` and (b) it's tricky to get Git to put status output on stdout. --- morphlib/localrepocache_tests.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'morphlib/localrepocache_tests.py') diff --git a/morphlib/localrepocache_tests.py b/morphlib/localrepocache_tests.py index 22b5ea54..3cc4f07f 100644 --- a/morphlib/localrepocache_tests.py +++ b/morphlib/localrepocache_tests.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2013 Codethink Limited +# Copyright (C) 2012-2014 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,6 +26,11 @@ import morphlib class FakeApplication(object): + def __init__(self): + self.settings = { + 'verbose': True + } + def status(self, msg): pass @@ -53,7 +58,7 @@ class LocalRepoCacheTests(unittest.TestCase): self.lrc._mkdtemp = self.fake_mkdtemp self._mkdtemp_count = 0 - def fake_git(self, args, cwd=None): + def fake_git(self, args, **kwargs): if args[0] == 'clone': self.assertEqual(len(args), 5) remote = args[3] @@ -112,7 +117,7 @@ class LocalRepoCacheTests(unittest.TestCase): self.lrc.cache_repo(self.repourl) def test_fails_to_cache_when_remote_does_not_exist(self): - def fail(args): + def fail(args, **kwargs): self.lrc.fs.makedir(args[4]) raise cliapp.AppException('') self.lrc._git = fail -- cgit v1.2.1