Skip to main content
Glama

TimeLooker MCP Server

run_all_tests.pyโ€ข6.1 kB
#!/usr/bin/env python3 """ Comprehensive test runner for TimeLooker MCP Server. Runs all available tests including x402 integration and API tests. """ import sys import os sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from src.utils.logging_config import setup_logging logger = setup_logging(__name__) def run_all_tests(): """Run all available tests.""" print("๐Ÿงช COMPREHENSIVE TEST SUITE") print("=" * 60) print("Running all TimeLooker tests...") print("=" * 60) success_count = 0 total_tests = 0 # 1. Search Quality Tests print("\n1๏ธโƒฃ SEARCH QUALITY TESTS") print("-" * 30) try: from quick_quality_test import quick_search_test quick_search_test() success_count += 1 logger.info("โœ… Search quality tests passed") except Exception as e: logger.error(f"โŒ Search quality tests failed: {e}") total_tests += 1 # 2. X402 Payment Integration Tests print("\n2๏ธโƒฃ X402 PAYMENT INTEGRATION TESTS") print("-" * 30) try: from test_x402_integration import run_x402_tests if run_x402_tests(): success_count += 1 logger.info("โœ… X402 integration tests passed") else: logger.error("โŒ X402 integration tests failed") except Exception as e: logger.error(f"โŒ X402 integration tests failed: {e}") total_tests += 1 # 3. API Integration Tests print("\n3๏ธโƒฃ API INTEGRATION TESTS") print("-" * 30) try: from test_api_integration import run_api_integration_tests if run_api_integration_tests(): success_count += 1 logger.info("โœ… API integration tests passed") else: logger.error("โŒ API integration tests failed") except Exception as e: logger.error(f"โŒ API integration tests failed: {e}") total_tests += 1 # 4. Lambda Function Tests print("\n4๏ธโƒฃ LAMBDA FUNCTION TESTS") print("-" * 30) try: from test_lambda import LambdaTester tester = LambdaTester() # Test create task event create_event = { "action": "create_task", "task_description": "Test monitoring task", "frequency_minutes": 60, "runtime_minutes": 1440, "recipient_email": "test@example.com" } result = tester.invoke_lambda(create_event, "Test create task") if result and "task_id" in result.get("body", ""): success_count += 1 logger.info("โœ… Lambda function tests passed") else: logger.error("โŒ Lambda function tests failed") except Exception as e: logger.error(f"โŒ Lambda function tests failed: {e}") total_tests += 1 # Summary print("\n" + "=" * 60) print("๐Ÿ TEST SUMMARY") print("=" * 60) print(f"Tests passed: {success_count}/{total_tests}") if success_count == total_tests: print("๐ŸŽ‰ ALL TESTS PASSED!") logger.info("All tests completed successfully") return True else: print(f"โš ๏ธ {total_tests - success_count} test(s) failed") logger.warning(f"{total_tests - success_count} test(s) failed") return False def run_specific_test_category(): """Run a specific category of tests.""" print("๐ŸŽฏ SPECIFIC TEST CATEGORIES") print("=" * 40) print("1. Search Quality Tests Only") print("2. X402 Payment Tests Only") print("3. API Integration Tests Only") print("4. Lambda Function Tests Only") print("5. All Tests (recommended)") print("0. Exit") choice = input("\nSelect test category (0-5): ").strip() if choice == "1": from quick_quality_test import quick_search_test quick_search_test() elif choice == "2": from test_x402_integration import run_x402_tests run_x402_tests() elif choice == "3": from test_api_integration import run_api_integration_tests run_api_integration_tests() elif choice == "4": from test_lambda import LambdaTester tester = LambdaTester() print("Running basic lambda function test...") # Add basic lambda test here elif choice == "5": return run_all_tests() elif choice == "0": print("๐Ÿ‘‹ Goodbye!") return True else: print("โŒ Invalid choice") return False def main(): """Main function.""" print("Welcome to the TimeLooker Test Suite!") print("\n๐Ÿ“‹ Available Options:") print("โ€ข Run all tests (comprehensive)") print("โ€ข Run specific test categories") print("โ€ข View test documentation") while True: print("\n" + "=" * 40) print("1. Run All Tests") print("2. Run Specific Test Category") print("3. View Test Documentation") print("0. Exit") choice = input("\nSelect option (0-3): ").strip() if choice == "1": success = run_all_tests() break elif choice == "2": success = run_specific_test_category() break elif choice == "3": print("\n๐Ÿ“– TEST DOCUMENTATION") print("=" * 30) print("โ€ข Search Quality Tests: Validate search result quality and duplicate detection") print("โ€ข X402 Payment Tests: Test payment integration flows (mocked)") print("โ€ข API Integration Tests: Test FastAPI endpoints and database integration") print("โ€ข Lambda Function Tests: Test AWS Lambda compatibility") print("\n๐Ÿ’ก For interactive testing, use: python run_quality_tests.py") continue elif choice == "0": print("๐Ÿ‘‹ Goodbye!") success = True break else: print("โŒ Invalid option") continue return success if __name__ == "__main__": success = main() sys.exit(0 if success else 1)

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fortnightly-devs/mcp-x402-task-scheduler'

If you have feedback or need assistance with the MCP directory API, please join our Discord server