From: Zack Cerza Date: Thu, 3 Mar 2022 21:08:57 +0000 (-0700) Subject: task.tests: Use job_status module X-Git-Tag: 1.2.0~196^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=35d1b0e734c90b53883c79dbf411a45601d1b068;p=teuthology.git task.tests: Use job_status module Previously this task had an embarrassing "status=fail, success=true" bug. Signed-off-by: Zack Cerza --- diff --git a/teuthology/task/tests/__init__.py b/teuthology/task/tests/__init__.py index a510a4a1c..088e84483 100644 --- a/teuthology/task/tests/__init__.py +++ b/teuthology/task/tests/__init__.py @@ -14,6 +14,8 @@ An example:: import logging import pytest +from teuthology.job_status import set_status + log = logging.getLogger(__name__) @@ -92,12 +94,12 @@ def task(ctx, config): plugins=[TeuthologyContextPlugin(ctx, config)] ) except Exception: - log.exception("Saw failure running pytest") - ctx.summary["status"] = "dead" + log.exception("Saw non-test failure!") + set_status(ctx.summary, "dead") else: if status == 0: log.info("OK. All tests passed!") - ctx.summary["status"] = "pass" + set_status(ctx.summary, "pass") else: log.error("FAIL. Saw test failures...") - ctx.summary["status"] = "fail" + set_status(ctx.summary, "fail")