summaryrefslogtreecommitdiff
path: root/tests/base.py
diff options
context:
space:
mode:
authorJoshua Hesketh <josh@nitrotech.org>2014-10-29 17:42:59 +1100
committerJoshua Hesketh <josh@nitrotech.org>2014-12-02 13:23:23 +1100
commitd5d7a21ed0b147f160bd3c15cfdf23ebb7eca38d (patch)
treeda915f72a2e9b8750b7d2e935622e745c333b8c7 /tests/base.py
parent3e3deef7b81baf88cd1ebc744f5e7342ab97b72c (diff)
downloadturbo-hipster-d5d7a21ed0b147f160bd3c15cfdf23ebb7eca38d.tar.gz
Improve how jobs log
Improve the logging for jobs in turbo-hipster so that if something fails in a plugin (for example the db migration checks) it is logged and uploaded appropriately. This causes multiple logs per job. Change-Id: I01e73ea418defbc0c1abd3b2b4357a816ddf99c3
Diffstat (limited to 'tests/base.py')
-rw-r--r--tests/base.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/base.py b/tests/base.py
index a79b535..d4ff9da 100644
--- a/tests/base.py
+++ b/tests/base.py
@@ -66,17 +66,21 @@ class TestWithGearman(testtools.TestCase):
self.config = yaml.safe_load(config_stream)
# Set all of the working dirs etc to a writeable temp dir
- temp_path = self.useFixture(fixtures.TempDir()).path
+ self.temp_path = self.useFixture(fixtures.TempDir()).path
for config_dir in ['debug_log', 'jobs_working_dir', 'git_working_dir',
'pip_download_cache']:
if config_dir in self.config:
if self.config[config_dir][0] == '/':
self.config[config_dir] = self.config[config_dir][1:]
- self.config[config_dir] = os.path.join(temp_path,
+ self.config[config_dir] = os.path.join(self.temp_path,
self.config[config_dir])
if self.config['publish_logs']['type'] == 'local':
if self.config['publish_logs']['path'][0] == '/':
self.config['publish_logs']['path'] = \
self.config['publish_logs']['path'][1:]
self.config['publish_logs']['path'] = os.path.join(
- temp_path, self.config[config_dir])
+ self.temp_path, self.config['publish_logs']['path'])
+
+ if not os.path.isdir(
+ os.path.dirname(self.config['publish_logs']['path'])):
+ os.makedirs(os.path.dirname(self.config['publish_logs']['path']))