-
Notifications
You must be signed in to change notification settings - Fork 3
Update result analyzer and remaining changes #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,12 +99,23 @@ def generate_text_report(analysis: Dict[str, Any], output_path: str): | |
| lines.append("-" * 80) | ||
| for test in failed_tests: | ||
| lines.append(f"\n{test['name']}") | ||
| failure_type = test.get("failure_type", "UNKNOWN") | ||
| lines.append(f" Type: {failure_type}") | ||
| lines.append(f" Tags: {', '.join(test['tags'])}") | ||
| lines.append(f" Duration: {test['duration']:.2f}s") | ||
| if "error" in test: | ||
| error_preview = test["error"][:200] | ||
| lines.append(f" Error: {error_preview}...") | ||
|
|
||
| # Skipped tests | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Skipped is already printed above |
||
| skipped_tests = [t for t in analysis["tests"] if t["outcome"] == "SKIPPED"] | ||
| if skipped_tests: | ||
| lines.append("") | ||
| lines.append("SKIPPED TESTS") | ||
| lines.append("-" * 80) | ||
| for test in skipped_tests: | ||
| lines.append(f" {test['name']}") | ||
|
|
||
| lines.append("") | ||
| lines.append("=" * 80) | ||
|
|
||
|
|
@@ -128,4 +139,40 @@ def print_summary(analysis: Dict[str, Any]): | |
| print(f"Passed: {summary['passed']} ({summary['pass_rate']}%)") | ||
| print(f"Failed: {summary['failed']}") | ||
| print(f"Skipped: {summary['skipped']}") | ||
| print("=" * 60) | ||
|
|
||
| # By tag | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we are already printing out the analysis by tag in line 84 |
||
| by_tag = analysis.get("by_tag", {}) | ||
| if by_tag: | ||
| print("\nResults by Tag:") | ||
| print("-" * 60) | ||
| sorted_tags = sorted(by_tag.items(), key=lambda x: x[1]["pass_rate"]) | ||
| for tag, stats in sorted_tags: | ||
| print(f" {tag:<30s} | {stats['passed']:>3}/{stats['total']:>3} passed ({stats['pass_rate']:>5.1f}%)") | ||
|
|
||
| # Failed tests | ||
| failed_tests = [t for t in analysis["tests"] if t["outcome"] == "FAIL"] | ||
| if failed_tests: | ||
| # Count by failure_type | ||
| from collections import Counter | ||
| type_counts = Counter(t.get("failure_type", "UNKNOWN") for t in failed_tests) | ||
|
|
||
| print(f"\nFailed Tests ({len(failed_tests)}):") | ||
| print("-" * 60) | ||
| for ft, count in sorted(type_counts.items()): | ||
| print(f"\n {ft} ({count}):") | ||
| for test in failed_tests: | ||
| if test.get("failure_type", "UNKNOWN") == ft: | ||
| name = test["name"].split("::")[-1] | ||
| print(f" {name}") | ||
|
|
||
| # Skipped tests | ||
| skipped_tests = [t for t in analysis["tests"] if t["outcome"] == "SKIPPED"] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. skipped was already computed and printed above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 There seems to be a lot of overlap between generate_text_report and print_summary. Do we need both functions? |
||
| if skipped_tests: | ||
| print(f"\nSkipped Tests ({len(skipped_tests)}):") | ||
| print("-" * 60) | ||
| for test in skipped_tests: | ||
| name = test["name"].split("::")[-1] | ||
| print(f" {name}") | ||
|
|
||
| print("=" * 60 + "\n") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """Collection management tests.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we write some test for this to understand that the failure extraction is working correctly as expected