From 9f9ea3bb3bc9a65f921c6b6842765eb9ec880572 Mon Sep 17 00:00:00 2001 From: UncleCode Date: Fri, 25 Jul 2025 17:31:52 +0800 Subject: [PATCH] chore: Clean up test artifacts and disable test workflow --- ...-release.yml => test-release.yml.disabled} | 0 test_release.py | 83 ------------------- 2 files changed, 83 deletions(-) rename .github/workflows/{test-release.yml => test-release.yml.disabled} (100%) delete mode 100755 test_release.py diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml.disabled similarity index 100% rename from .github/workflows/test-release.yml rename to .github/workflows/test-release.yml.disabled diff --git a/test_release.py b/test_release.py deleted file mode 100755 index cec90824..00000000 --- a/test_release.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python3 -"""Test script for verifying Test PyPI and Docker releases""" - -import subprocess -import sys - -def test_pypi(): - print("=== Testing Test PyPI Package ===") - print("1. Creating virtual environment...") - subprocess.run([sys.executable, "-m", "venv", "test_env"], check=True) - - print("2. Installing from Test PyPI...") - pip_cmd = "./test_env/bin/pip" if sys.platform != "win32" else "test_env\\Scripts\\pip" - subprocess.run([ - pip_cmd, "install", "-i", "https://test.pypi.org/simple/", - "--extra-index-url", "https://pypi.org/simple/", # For dependencies - "crawl4ai==0.7.1" - ], check=True) - - print("3. Testing import...") - python_cmd = "./test_env/bin/python" if sys.platform != "win32" else "test_env\\Scripts\\python" - result = subprocess.run([ - python_cmd, "-c", - "from crawl4ai import AsyncWebCrawler; print('โœ… Import successful!'); print(f'Version: {__import__(\"crawl4ai\").__version__}')" - ], capture_output=True, text=True) - print(result.stdout) - if result.returncode != 0: - print(f"โŒ Error: {result.stderr}") - return False - - print("4. Cleaning up...") - import shutil - shutil.rmtree("test_env") - print("โœ… Test PyPI package test passed!\n") - return True - -def test_docker(): - print("=== Testing Docker Image ===") - print("1. Pulling test image...") - subprocess.run(["docker", "pull", "unclecode/crawl4ai:test-0.7.1"], check=True) - - print("2. Running version check...") - result = subprocess.run([ - "docker", "run", "--rm", "unclecode/crawl4ai:test-0.7.1", - "python", "-c", "import crawl4ai; print(f'Version: {crawl4ai.__version__}')" - ], capture_output=True, text=True) - print(result.stdout) - - print("3. Testing crawl4ai-doctor command...") - result = subprocess.run([ - "docker", "run", "--rm", "unclecode/crawl4ai:test-0.7.1", - "crawl4ai-doctor" - ], capture_output=True, text=True) - print(result.stdout[:500] + "..." if len(result.stdout) > 500 else result.stdout) - - print("โœ… Docker image test passed!\n") - return True - -if __name__ == "__main__": - print("๐Ÿงช Testing Crawl4AI Release Artifacts\n") - - pypi_ok = False - docker_ok = False - - try: - pypi_ok = test_pypi() - except Exception as e: - print(f"โŒ Test PyPI test failed: {e}") - - try: - docker_ok = test_docker() - except Exception as e: - print(f"โŒ Docker test failed: {e}") - - print("\n๐Ÿ“Š Summary:") - print(f"Test PyPI: {'โœ… Passed' if pypi_ok else 'โŒ Failed'}") - print(f"Docker Hub: {'โœ… Passed' if docker_ok else 'โŒ Failed'}") - - if pypi_ok and docker_ok: - print("\n๐ŸŽ‰ All tests passed! Ready for production release.") - else: - print("\nโš ๏ธ Some tests failed. Please fix before production release.") - sys.exit(1) \ No newline at end of file