def finish_test(results, repo, ref):
base_repo = redis.get("source:" + repo).decode("utf-8")
l = redis.lock(base_repo)
l.local.token = results[0][0]
print("releasing lock " + base_repo)
try:
l.release()
except redis.exceptions.LockError:
print("lock already released")
test_config_ok = True
tests_ok = True
for result in results:
test_config_ok = test_config_ok and result[1]
tests_ok = tests_ok and result[2]
if not test_config_ok:
final_status(repo, ref, "error", "An error occurred while running the tests.")
elif not tests_ok:
final_status(repo, ref, "failure", "One or more tests failed.")
else:
final_status(repo, ref, "success", "All tests passed.")
评论列表
文章目录