+def report(conn, build, commit, run, test, result, diff):
+ if conn:
+ if not build:
+ build = ''
+ if not commit:
+ commit = ''
+ sql = "INSERT INTO results(test,result,run,time,duration,build,commitid) VALUES('" + test.replace('test_', '', 1) + "', '" + result + "', " + str(run) + ", " + str(time.time()) + ", " + str(diff.total_seconds()) + ", '" + build + "', '" + commit + "')"
+ try:
+ conn.execute(sql)
+ conn.commit()
+ except Exception, e:
+ print "sqlite: " + str(e)
+ print "sql: " + sql
+