From bce1a8666b949d2290cf09b5ee31c8934b32e57f Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sun, 25 Nov 2012 13:21:22 -0800 Subject: inserting stuff...but SLOWLY (45 seconds for oglc! eeeeesh.) --- framework/database.py | 6 ++++++ programs/run.py | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/framework/database.py b/framework/database.py index ad0f93b..5e9e5d1 100644 --- a/framework/database.py +++ b/framework/database.py @@ -58,3 +58,9 @@ class ResultDatabase: cursor = self.connection.cursor() date = int(time.time()) cursor.execute('INSERT INTO runs VALUES(?,?,?,?)', (date, name, driver, sysinfo)) + return date + + def addPlaceholderResult(self, run, testName): + cursor = self.connection.cursor() + cursor.execute('INSERT INTO results(run_id, test_name) VALUES(?,?)', + (run, testName)) diff --git a/programs/run.py b/programs/run.py index e0cbb99..c1f4a34 100755 --- a/programs/run.py +++ b/programs/run.py @@ -79,9 +79,12 @@ def main(argv, config): db = ResultDatabase(config) # Create test run in database - db.createRun(args.name, 'driver', 'system') + runID = db.createRun(args.name, 'driver', 'system') # Populate results with "not run yet" + for test in tests.keys(): + db.addPlaceholderResult(runID, test) + # Resume if __name__ == '__main__': -- cgit v1.2.3