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"""
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()
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()