Add get_failing_from_run db api method

This commit adds a new db api method to return a list of test_run
objects that failed for a given run_id. This is needed for adding a
subunit2sql based repository in testrepository.

Change-Id: Ib4a283fc3abeae1ecfc74995c2ad85564b06671a
This commit is contained in:
Matthew Treinish 2014-08-02 21:29:36 -04:00
parent 950357bd9f
commit 3b2d1494e0

View File

@ -175,6 +175,13 @@ def get_all_test_runs():
return query.all()
def get_failing_from_run(run_id, session=None):
session = session or get_session()
query = db_utils.model_query(models.TestRun, session).filter_by(
run_id=run_id, status='fail')
return query.all()
def get_test_by_id(id, session=None):
session = session or get_session()
test = db_utils.model_query(models.Test, session).filter_by(