Don't create subunit files on disk, rather just extract them out of the master file.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 4 Dec 2010 14:54:23 +0000 (15:54 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 4 Dec 2010 14:54:23 +0000 (15:54 +0100)
buildfarm/build.py
tools/fix.py

index 4108ac0..e5993ef 100644 (file)
@@ -329,10 +329,7 @@ class Build(object):
 
     def read_subunit(self):
         """read the test output as subunit"""
-        try:
-            return open_opt_compressed_file(self.basename+".subunit")
-        except IOError:
-            raise NoTestOutput()
+        return StringIO("".join(extract_test_output(self.read_log())))
 
     def read_log(self):
         """read full log file"""
@@ -549,16 +546,6 @@ class BuildResultStore(object):
         os.link(build.basename+".log", new_basename+".log")
         if os.path.exists(build.basename+".err"):
             os.link(build.basename+".err", new_basename+".err")
-        try:
-            subunit_output = extract_test_output(build.read_log())
-        except NoTestOutput:
-            pass
-        else:
-            f = bz2.BZ2File(new_basename+".subunit.bz2", 'w')
-            try:
-                f.writelines(subunit_output)
-            finally:
-                f.close()
         new_build = StormBuild(new_basename, build.tree, build.host,
             build.compiler, rev)
         new_build.checksum = build.log_checksum()
index b02782c..272e16d 100755 (executable)
@@ -62,19 +62,4 @@ for build in store.find(StormBuild, StormBuild.host_id == None):
         print "Unable to find host %s" % e.name
 
 
-for build in store.find(StormBuild, StormBuild.basename != None):
-    subunit_path = build.basename + ".subunit"
-    if os.path.exists(subunit_path) or os.path.exists(subunit_path+".bz2"):
-        continue
-    try:
-        test_output = "".join(extract_test_output(build.read_log()))
-    except (LogFileMissing, NoTestOutput):
-        continue
-    print "Writing subunit file for %r" % build
-    f = bz2.BZ2File(subunit_path+".bz2", 'w')
-    try:
-        f.write(test_output)
-    finally:
-        f.close()
-
 buildfarm.commit()