Spaces:
Running on Zero
Running on Zero
| # ===================================================== | |
| # Apckeyl Framework | |
| # Version 1.6 | |
| # control_plane_test_report.py | |
| # ===================================================== | |
| """ | |
| Unified Control Plane Test Report. | |
| Version 1.6 | |
| """ | |
| from run_control_plane_tests import main | |
| # ===================================================== | |
| # Generate Report | |
| # ===================================================== | |
| def generate_report(): | |
| report = main() | |
| output = [] | |
| output.append( | |
| "============================================================" | |
| ) | |
| output.append( | |
| "APCKEYL FRAMEWORK" | |
| ) | |
| output.append( | |
| "Unified Control Plane Test Report" | |
| ) | |
| output.append( | |
| "Version 1.6" | |
| ) | |
| output.append( | |
| "============================================================" | |
| ) | |
| output.append("") | |
| output.append( | |
| f"Overall Result: {report['status']}" | |
| ) | |
| output.append( | |
| f"Total Tests: {report['total']}" | |
| ) | |
| output.append( | |
| f"Passed: {report['passed']}" | |
| ) | |
| output.append( | |
| f"Failed: {report['failed']}" | |
| ) | |
| output.append("") | |
| output.append( | |
| "============================================================" | |
| ) | |
| output.append( | |
| "TEST DETAILS" | |
| ) | |
| output.append( | |
| "============================================================" | |
| ) | |
| output.append("") | |
| for result in report["results"]: | |
| full_name = ( | |
| f"{result['module']}.{result['test']}" | |
| ) | |
| status = result["status"] | |
| output.append( | |
| f"[{status}] {full_name}" | |
| ) | |
| if result["error"] is not None: | |
| output.append( | |
| f" Error: {result['error']}" | |
| ) | |
| output.append("") | |
| output.append( | |
| "============================================================" | |
| ) | |
| output.append( | |
| f"RESULT: {report['status']}" | |
| ) | |
| output.append( | |
| "============================================================" | |
| ) | |
| return "\n".join(output) | |
| # ===================================================== | |
| # Compatibility Function | |
| # ===================================================== | |
| def generate_text_report(): | |
| return generate_report() | |
| # ===================================================== | |
| # Main Report Function | |
| # ===================================================== | |
| def main_report(): | |
| return generate_text_report() | |
| # ===================================================== | |
| # Direct Execution | |
| # ===================================================== | |
| if __name__ == "__main__": | |
| print( | |
| generate_text_report() | |
| ) | |
| # ===================================================== | |
| # End of File | |
| # ===================================================== |