summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2014-03-02 12:02:01 +0000
committerLars Wirzenius <liw@liw.fi>2014-03-02 12:02:01 +0000
commit6fd018aea573b115aac31cb2ea3bad216345003b (patch)
tree4a71fe0813753c8ecf0e85eadde4a2c9782ba8f3
parent7355288c75ef4c06548942a2ef546b1b6d815bab (diff)
downloadobnam-6fd018aea573b115aac31cb2ea3bad216345003b.tar.gz
Store Obnam version info in benchmark.json
-rwxr-xr-xobnam-benchmark16
-rwxr-xr-xobnam-benchmark-summary2
2 files changed, 15 insertions, 3 deletions
diff --git a/obnam-benchmark b/obnam-benchmark
index cd4d70d0..291fc6ac 100755
--- a/obnam-benchmark
+++ b/obnam-benchmark
@@ -298,10 +298,12 @@ class ObnamBenchmarkRunner(cliapp.Application):
benchmark_class.add_settings(self.settings)
def process_args(self, args):
- result_obj = {}
results_dir = self.create_results_dir()
self.store_settings_in_results(results_dir)
- result_obj['system-info'] = self.get_system_info_dict()
+ result_obj = {
+ 'system-info': self.get_system_info_dict(),
+ 'versions': self.get_version_info_dict(),
+ }
srctree = self.prepare_source_tree()
@@ -339,6 +341,16 @@ class ObnamBenchmarkRunner(cliapp.Application):
'uname': platform.uname(),
}
+ def get_version_info_dict(self):
+ treeish = self.settings['obnam-treeish']
+ sha1 = cliapp.runcmd(['git', 'show-ref', treeish]).split()[0]
+ describe = cliapp.runcmd(['git', 'describe', treeish]).strip()
+ return {
+ 'obnam-treeish': treeish,
+ 'obnam-sha1': sha1,
+ 'obnam-version': describe,
+ }
+
def prepare_source_tree(self):
srctree = tempfile.mkdtemp()
self.extract_sources_from_git(srctree)
diff --git a/obnam-benchmark-summary b/obnam-benchmark-summary
index 6d6de8f0..0480c209 100755
--- a/obnam-benchmark-summary
+++ b/obnam-benchmark-summary
@@ -66,7 +66,7 @@ class ObnamBenchmarkSummary(cliapp.Application):
}
def get_obnam_version(self, obj):
- return 'FIXME'
+ return obj['versions']['obnam-version']
def get_empty_files_speed(self, obj):
count = self.get_empty_files_count(obj)