Some checks failed
Self-hosted runner (nightly-past-ci-caller) / Get number (push) Has been cancelled
Self-hosted runner (nightly-past-ci-caller) / TensorFlow 2.11 (push) Has been cancelled
Self-hosted runner (nightly-past-ci-caller) / TensorFlow 2.10 (push) Has been cancelled
Self-hosted runner (nightly-past-ci-caller) / TensorFlow 2.9 (push) Has been cancelled
Self-hosted runner (nightly-past-ci-caller) / TensorFlow 2.8 (push) Has been cancelled
Self-hosted runner (nightly-past-ci-caller) / TensorFlow 2.7 (push) Has been cancelled
Self-hosted runner (nightly-past-ci-caller) / TensorFlow 2.6 (push) Has been cancelled
Self-hosted runner (nightly-past-ci-caller) / TensorFlow 2.5 (push) Has been cancelled
Self-hosted runner (benchmark) / Benchmark (aws-g5-4xlarge-cache) (push) Has been cancelled
Build documentation / build (push) Has been cancelled
Build documentation / build_other_lang (push) Has been cancelled
CodeQL Security Analysis / CodeQL Analysis (push) Has been cancelled
New model PR merged notification / Notify new model (push) Has been cancelled
PR CI / pr-ci (push) Has been cancelled
Slow tests on important models (on Push - A10) / Get all modified files (push) Has been cancelled
Secret Leaks / trufflehog (push) Has been cancelled
Update Transformers metadata / build_and_package (push) Has been cancelled
Slow tests on important models (on Push - A10) / Model CI (push) Has been cancelled
Check Tiny Models / Check tiny models (push) Has been cancelled
Self-hosted runner (Intel Gaudi3 scheduled CI caller) / Model CI (push) Has been cancelled
Self-hosted runner (Intel Gaudi3 scheduled CI caller) / Pipeline CI (push) Has been cancelled
Self-hosted runner (Intel Gaudi3 scheduled CI caller) / Example CI (push) Has been cancelled
Self-hosted runner (Intel Gaudi3 scheduled CI caller) / DeepSpeed CI (push) Has been cancelled
Self-hosted runner (Intel Gaudi3 scheduled CI caller) / Trainer/FSDP CI (push) Has been cancelled
Nvidia CI - Flash Attn / Setup (push) Has been cancelled
Nvidia CI - Flash Attn / Model CI (push) Has been cancelled
Nvidia CI / Setup (push) Has been cancelled
Nvidia CI / Model CI (push) Has been cancelled
Nvidia CI / Torch pipeline CI (push) Has been cancelled
Nvidia CI / Example CI (push) Has been cancelled
Nvidia CI / Trainer/FSDP CI (push) Has been cancelled
Nvidia CI / DeepSpeed CI (push) Has been cancelled
Nvidia CI / Quantization CI (push) Has been cancelled
Nvidia CI / Kernels CI (push) Has been cancelled
Doctests / Setup (push) Has been cancelled
Doctests / Call doctest jobs (push) Has been cancelled
Doctests / Send results to webhook (push) Has been cancelled
Extras Smoke Test / Get supported Python versions (push) Has been cancelled
Extras Smoke Test / Test extras on Python ${{ matrix.python-version }} (push) Has been cancelled
Extras Smoke Test / Check Slack token availability (push) Has been cancelled
Extras Smoke Test / Notify failures to Slack (push) Has been cancelled
Self-hosted runner (AMD scheduled CI caller) / Trigger Scheduled AMD CI (push) Has been cancelled
Stale Bot / Close Stale Issues (push) Has been cancelled
72 lines
2.5 KiB
Python
72 lines
2.5 KiB
Python
import argparse
|
|
import re
|
|
|
|
|
|
def parse_pytest_output(file_path):
|
|
skipped_tests = {}
|
|
skipped_count = 0
|
|
with open(file_path, 'r', encoding='utf-8') as file:
|
|
for line in file:
|
|
match = re.match(r'^SKIPPED \[(\d+)\] (tests/.*): (.*)$', line)
|
|
if match:
|
|
skipped_count += 1
|
|
test_file, test_line, reason = match.groups()
|
|
skipped_tests[reason] = skipped_tests.get(reason, []) + [(test_file, test_line)]
|
|
for k,v in sorted(skipped_tests.items(), key=lambda x:len(x[1])):
|
|
print(f"{len(v):4} skipped because: {k}")
|
|
print("Number of skipped tests:", skipped_count)
|
|
|
|
def parse_pytest_failure_output(file_path):
|
|
failed_tests = {}
|
|
failed_count = 0
|
|
with open(file_path, 'r', encoding='utf-8') as file:
|
|
for line in file:
|
|
match = re.match(r'^FAILED (tests/.*) - (.*): (.*)$', line)
|
|
if match:
|
|
failed_count += 1
|
|
_, error, reason = match.groups()
|
|
failed_tests[reason] = failed_tests.get(reason, []) + [error]
|
|
for k,v in sorted(failed_tests.items(), key=lambda x:len(x[1])):
|
|
print(f"{len(v):4} failed because `{v[0]}` -> {k}")
|
|
print("Number of failed tests:", failed_count)
|
|
if failed_count>0:
|
|
exit(1)
|
|
|
|
def parse_pytest_errors_output(file_path):
|
|
print(file_path)
|
|
error_tests = {}
|
|
error_count = 0
|
|
with open(file_path, 'r', encoding='utf-8') as file:
|
|
for line in file:
|
|
match = re.match(r'^ERROR (tests/.*) - (.*): (.*)$', line)
|
|
if match:
|
|
error_count += 1
|
|
_, test_error, reason = match.groups()
|
|
error_tests[reason] = error_tests.get(reason, []) + [test_error]
|
|
for k,v in sorted(error_tests.items(), key=lambda x:len(x[1])):
|
|
print(f"{len(v):4} errored out because of `{v[0]}` -> {k}")
|
|
print("Number of errors:", error_count)
|
|
if error_count>0:
|
|
exit(1)
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("--file", help="file to parse")
|
|
parser.add_argument("--skip", action="store_true", help="show skipped reasons")
|
|
parser.add_argument("--fail", action="store_true", help="show failed tests")
|
|
parser.add_argument("--errors", action="store_true", help="show failed tests")
|
|
args = parser.parse_args()
|
|
|
|
if args.skip:
|
|
parse_pytest_output(args.file)
|
|
|
|
if args.fail:
|
|
parse_pytest_failure_output(args.file)
|
|
|
|
if args.errors:
|
|
parse_pytest_errors_output(args.file)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|