if __name__ == '__main__': if len(sys.argv) < 3: print "This script will generate profiles for all revisions for a testcase." print "Usage: python generate_profile_batch.py configFile testcase" sys.exit(0) config = loadConfig(sys.argv[1]) # revision = sys.argv[2] testcase = sys.argv[2] helper = SessionHelper(config) # get all revisions in the database for this testcase revs = helper.getAllRevisions(testcase) # build profiles for all revisions for r in revs: # load all sessions for this revision and testcase sessions = helper.loadFromDatabase(r, testcase) if len(sessions) == 0: print "No sessions found." sys.exit(0) p = Profile(r, testcase, config) for s in sessions: print "adding session to profile for %s " % r p.addSession(s) profileHelper = ProfileHelper(config)
def getAllRevisions(): s = SessionHelper(config) revs = s.getAllRevisions(config['testname']) return revs