def start_new_test(db, repository, delay):
"""
Function to start a new test based on kvm table.
"""
from run import log
finished_tests = db.query(TestProgress.test_id).filter(
TestProgress.status.in_([TestStatus.canceled, TestStatus.completed])
).subquery()
test = Test.query.filter(
and_(Test.id.notin_(finished_tests))
).order_by(Test.id.asc()).first()
if test is None:
return
elif test.platform is TestPlatform.windows:
kvm_processor_windows(db, repository, delay)
elif test.platform is TestPlatform.linux:
kvm_processor_linux(db, repository, delay)
else:
log.error("Unsupported CI platform: {platform}".format(
platform=test.platform))
return
评论列表
文章目录