From 53b841f1c5bfec9fa38faa2ef2d3654842fceade Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sun, 25 Nov 2012 14:59:26 -0800 Subject: actually writing results to the database! wooooooo --- framework/database.py | 4 ++++ framework/runner.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/framework/database.py b/framework/database.py index 2404d7d..926e49f 100644 --- a/framework/database.py +++ b/framework/database.py @@ -71,3 +71,7 @@ class ResultDatabase: c = self.connection.cursor() xs = c.execute('SELECT test_name FROM results WHERE run_id = ? AND result IS NULL', [run]) return [x[0] for x in xs] + + def writeResult(self, run, name, command, result): + c = self.connection.cursor() + c.execute('UPDATE results SET command = ?, result = ?, return_code = ?, errors = ?, output = ? WHERE run_id = ? AND test_name = ? AND result IS NULL', (' '.join(command), result['status'], result['exitcode'], result['err'], result['out'], run, name)) diff --git a/framework/runner.py b/framework/runner.py index e52d73f..ecfc198 100644 --- a/framework/runner.py +++ b/framework/runner.py @@ -33,6 +33,8 @@ def resume(db, config, args, tests, runID): name, test = data result = test.run(timeout) + + db.writeResult(runID, name, test.command, result) print(name + ':', result['status']) todo = [(name, tests[name]) for name in placeholders] -- cgit v1.2.3