From ed1ba6cd741f195afe78b35eb63b4ae28e44e1f3 Mon Sep 17 00:00:00 2001 From: CI-DEV <154627941+IlumCI@users.noreply.github.com> Date: Fri, 1 Aug 2025 20:55:02 +0300 Subject: [PATCH] Update and rename file to test_docker.py --- scripts/docker/file | 1 - scripts/docker/test_docker.py | 66 +++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) delete mode 100644 scripts/docker/file create mode 100644 scripts/docker/test_docker.py diff --git a/scripts/docker/file b/scripts/docker/file deleted file mode 100644 index 8b137891..00000000 --- a/scripts/docker/file +++ /dev/null @@ -1 +0,0 @@ - diff --git a/scripts/docker/test_docker.py b/scripts/docker/test_docker.py new file mode 100644 index 00000000..70e9060b --- /dev/null +++ b/scripts/docker/test_docker.py @@ -0,0 +1,66 @@ + +#!/usr/bin/env python3 +""" +Test script to verify Swarms installation in Docker container. +""" + +import sys +from typing import Dict, Any + +def test_swarms_import() -> Dict[str, Any]: + """ + Test that swarms can be imported and basic functionality works. + + Returns: + Dict[str, Any]: Test results + """ + try: + import swarms + print(f" Swarms imported successfully. Version: {swarms.__version__}") + + # Test basic functionality + from swarms import Agent + print(" Agent class imported successfully") + + return { + "status": "success", + "version": swarms.__version__, + "message": "Swarms package is working correctly" + } + + except ImportError as e: + print(f" Failed to import swarms: {e}") + return { + "status": "error", + "error": str(e), + "message": "Swarms package import failed" + } + except Exception as e: + print(f" Unexpected error: {e}") + return { + "status": "error", + "error": str(e), + "message": "Unexpected error occurred" + } + +def main() -> None: + """Main function to run tests.""" + print(" Testing Swarms Docker Image...") + print("=" * 50) + + # Test Python version + print(f"Python version: {sys.version}") + + # Test swarms import + result = test_swarms_import() + + print("=" * 50) + if result["status"] == "success": + print(" All tests passed! Docker image is working correctly.") + sys.exit(0) + else: + print(" Tests failed! Please check the Docker image.") + sys.exit(1) + +if __name__ == "__main__": + main()