Skip to Content
ContributeBackendTest Run Status

Test Run Status

Test run status reflects execution completion, not assertion results. A run is Completed even if every test failed its metrics, as long as the tests executed.

Status values

RunStatus (tasks/enums.py):

StatusMeaning
QueuedCreated, waiting for a worker to pick it up.
ProgressCurrently executing.
CompletedAll tests executed (execution_errors == 0), regardless of pass/fail.
PartialSome tests executed, some couldn’t (0 < execution_errors < total_tests).
FailedNo tests in the run, or all tests errored (execution_errors == total_tests).
CancelledExecution was cancelled.

Queued, Progress, and Cancelled are set by the execution lifecycle. Completed, Partial, and Failed are the terminal states computed from results.

Determination logic

When execution finishes, the collect_results task runs TestRunProcessor (tasks/execution/result_processor.py), which aggregates stored test results and calls determine_overall_status:

status-determination-logic.py
if total_tests == 0:
    status = "Failed"        # no tests
elif execution_errors == 0:
    status = "Completed"     # all executed
elif execution_errors == total_tests:
    status = "Failed"        # all errored
else:
    status = "Partial"       # mixed

The same call returns the email status used in the run-summary notification:

OutcomeRun statusEmail status
All executed, none failedCompletedsuccess
All executed, some failedCompletedfailed
Some couldn’t executePartialpartial
No tests, or all erroredFailedfailed

Execution errors

An execution error means a test couldn’t run — an endpoint/HTTP or connection failure, a code error, or missing/empty metrics (status Error). Tests that ran but failed their assertions (is_successful: false) are not execution errors; they count as failed tests in a Completed run.

Statistics

Per-test pass/fail/error counts come from the stored test result status, not from re-parsing test_metrics. get_test_statistics (result_processor.py) joins TestResult.status and buckets each via the TEST_RESULT_STATUS_* mappings in app/constants.py. See Test Result Status for how that status is set and why it is the source of truth.

Implementation files

FilePurpose
tasks/execution/result_processor.pyStatus determination and statistics
tasks/enums.pyRunStatus enum
app/constants.pyStatus category mappings
notifications/email/templates/test_execution_summary.html.jinja2Email template