diff options
author | Lars Wirzenius <liw@liw.fi> | 2015-07-16 15:41:54 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2015-07-16 15:41:54 +0300 |
commit | f7f0e7bd90445cf8dc8b234618f07a46596c8364 (patch) | |
tree | 52c312b7b0b9c87a4182be23546cf5a7d03093d8 /obbench | |
parent | 519fe2422eced2df7e91d87fd50e7ab9b688ebb9 (diff) | |
download | obnam-benchmarks-f7f0e7bd90445cf8dc8b234618f07a46596c8364.tar.gz |
Allow obnam_config per-benchmark as well
Diffstat (limited to 'obbench')
-rwxr-xr-x | obbench | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -56,7 +56,7 @@ class ObnamBenchmarker(cliapp.Application): checkout = self.get_treeish(spec, treeish, tempdir) self.prepare_obnam(checkout) for benchmark in spec.get('benchmarks', []): - result = self.run_one_benchmark(benchmark, tempdir, checkout) + result = self.run_one_benchmark(spec, benchmark, tempdir, checkout) self.save_result(spec, benchmark, result) def get_treeish(self, spec, treeish, tempdir): @@ -70,14 +70,14 @@ class ObnamBenchmarker(cliapp.Application): def prepare_obnam(self, checkout): cliapp.runcmd(['python', 'setup.py', 'build_ext', '-i'], cwd=checkout) - def run_one_benchmark(self, benchmark, tempdir, checkout): + def run_one_benchmark(self, spec, benchmark, tempdir, checkout): self.logger.msg('Running benchmark %s' % benchmark['name']) with self.logger: result = BenchmarkResult() result.collect_info_from_spec(benchmark) result.collect_info_from_checkout(checkout) - config = self.create_obnam_config(benchmark, tempdir) + config = self.create_obnam_config(spec, benchmark, tempdir) live = self.create_live_dir(tempdir) for step in benchmark.get('steps', []): @@ -85,7 +85,7 @@ class ObnamBenchmarker(cliapp.Application): step, tempdir, checkout, config, live, result) return result - def create_obnam_config(self, spec, tempdir): + def create_obnam_config(self, spec, benchmark, tempdir): config = os.path.join(tempdir, 'obnam.conf') with open(config, 'w') as f: f.write('[config]\n') @@ -93,6 +93,8 @@ class ObnamBenchmarker(cliapp.Application): f.write('root = %s\n' % self.get_live_data(tempdir)) for key, value in spec.get('obnam_config', {}).items(): f.write('%s = %s\n' % (key, value)) + for key, value in benchmark.get('obnam_config', {}).items(): + f.write('%s = %s\n' % (key, value)) return config def get_live_data(self, tempdir): |