Run all request queueing tests and provide summary
()
| 293 | |
| 294 | |
| 295 | def run_tests(): |
| 296 | """Run all request queueing tests and provide summary""" |
| 297 | print("Request Queueing - Test Suite") |
| 298 | print("=" * 60) |
| 299 | print("Testing request queueing during authentication rotation...") |
| 300 | print("=" * 60) |
| 301 | |
| 302 | # Create test suite |
| 303 | test_classes = [ |
| 304 | TestRequestQueueing, |
| 305 | TestRequestQueueingAsync |
| 306 | ] |
| 307 | |
| 308 | total_tests = 0 |
| 309 | passed_tests = 0 |
| 310 | |
| 311 | for test_class in test_classes: |
| 312 | print(f"\nRunning {test_class.__name__}...") |
| 313 | suite = unittest.TestLoader().loadTestsFromTestCase(test_class) |
| 314 | result = unittest.TextTestRunner(verbosity=2).run(suite) |
| 315 | |
| 316 | total_tests += result.testsRun |
| 317 | passed_tests += result.testsRun - len(result.failures) - len(result.errors) |
| 318 | |
| 319 | if result.failures: |
| 320 | print(f" X Failures: {len(result.failures)}") |
| 321 | for failure in result.failures: |
| 322 | print(f" - {failure[0]}") |
| 323 | if result.errors: |
| 324 | print(f" X Errors: {len(result.errors)}") |
| 325 | for error in result.errors: |
| 326 | print(f" - {error[0]}") |
| 327 | |
| 328 | print("\n" + "=" * 60) |
| 329 | print("Test Summary:") |
| 330 | print(f" Total Tests: {total_tests}") |
| 331 | print(f" Passed: {passed_tests}") |
| 332 | print(f" Success Rate: {(passed_tests/total_tests)*100:.1f}%" if total_tests > 0 else " Success Rate: 0%") |
| 333 | |
| 334 | if passed_tests == total_tests: |
| 335 | print("\nSUCCESS: All tests passed! Request Queueing feature is working correctly.") |
| 336 | print("PASS: Queue count management validated") |
| 337 | print("PASS: Lock state handling confirmed") |
| 338 | print("PASS: Concurrent request processing verified") |
| 339 | print("PASS: Exception handling robustness confirmed") |
| 340 | print("PASS: Async operation testing completed") |
| 341 | else: |
| 342 | print(f"\nFAILURE: {total_tests - passed_tests} test(s) failed. Review the implementation.") |
| 343 | |
| 344 | return passed_tests == total_tests |
| 345 | |
| 346 | |
| 347 | if __name__ == "__main__": |
no test coverage detected