def METHOD_NAME(job):
    if not job.step_results.exists():
        return
    passed = 0
    failed = 0
    skipped = 0
    for s in job.step_results.all():
        output = "\n".join(s.clean_output().split("<br/>"))
        matches = re.findall(r'>(?P<passed>\d+) passed<.*, .*>(?P<skipped>\d+) skipped<.*, .*>(?P<failed>\d+) failed',
                output, flags=re.IGNORECASE)
        for match in matches:
            passed += int(match[0])
            failed += int(match[2])
            skipped += int(match[1])
    job.test_stats.all().delete()
    if passed or failed or skipped:
        models.JobTestStatistics.objects.create(job=job, passed=passed, failed=failed, skipped=skipped)