diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..2441a469 --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +# Atomizer Configuration Example +# Copy this file to .env and fill in your API keys + +# Anthropic API Key for LLM Mode +# Get your key from: https://console.anthropic.com/ +ANTHROPIC_API_KEY=your-api-key-here diff --git a/monitor_e2e.py b/monitor_e2e.py new file mode 100644 index 00000000..0a8dfc92 --- /dev/null +++ b/monitor_e2e.py @@ -0,0 +1,46 @@ +""" +Monitor E2E test progress in real-time + +Run this in a separate terminal to see live updates +""" +import subprocess +import sys +from pathlib import Path + +# Load API key from .env +env_vars = {} +env_file = Path(".env") +if env_file.exists(): + with open(env_file) as f: + for line in f: + line = line.strip() + if line and not line.startswith('#') and '=' in line: + key, value = line.split('=', 1) + env_vars[key.strip()] = value.strip() + +if 'ANTHROPIC_API_KEY' not in env_vars: + print("[FAIL] No API key found in .env") + sys.exit(1) + +print("[OK] API key loaded") +print() +print("=" * 80) +print("RUNNING E2E TEST - LIVE OUTPUT") +print("=" * 80) +print() + +# Run test with live output (not in background) +python_exe = "c:/Users/antoi/anaconda3/envs/test_env/python.exe" +test_script = Path(__file__).parent / "tests" / "test_phase_3_2_e2e.py" + +# Set environment and run +import os +os.environ.update(env_vars) + +# Run with unbuffered output so we see it live +result = subprocess.run( + [python_exe, "-u", str(test_script)], + env=os.environ +) + +sys.exit(result.returncode) diff --git a/run_e2e_test.bat b/run_e2e_test.bat new file mode 100644 index 00000000..fb2c9ff5 --- /dev/null +++ b/run_e2e_test.bat @@ -0,0 +1,3 @@ +@echo off +set ANTHROPIC_API_KEY=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 +"c:/Users/antoi/anaconda3/envs/test_env/python.exe" tests/test_phase_3_2_e2e.py diff --git a/run_e2e_with_env.py b/run_e2e_with_env.py new file mode 100644 index 00000000..1114957f --- /dev/null +++ b/run_e2e_with_env.py @@ -0,0 +1,43 @@ +""" +Helper script to run E2E test with API key from .env file + +This script loads the ANTHROPIC_API_KEY from .env and runs the E2E test. +""" +import os +import sys +import subprocess +from pathlib import Path + +# Load .env file +env_file = Path(__file__).parent / ".env" + +if env_file.exists(): + print("Loading API key from .env file...") + with open(env_file) as f: + for line in f: + line = line.strip() + if line and not line.startswith('#') and '=' in line: + key, value = line.split('=', 1) + os.environ[key.strip()] = value.strip() + + if 'ANTHROPIC_API_KEY' in os.environ: + print(f"[OK] API key loaded: {os.environ['ANTHROPIC_API_KEY'][:20]}...") + else: + print("[FAIL] No ANTHROPIC_API_KEY found in .env") + sys.exit(1) +else: + print(f"[FAIL] .env file not found at {env_file}") + print("\nPlease create a .env file with your API key:") + print("ANTHROPIC_API_KEY=your-key-here") + sys.exit(1) + +# Run the E2E test +print("\nRunning E2E test...") +print("=" * 80) +print() + +python_exe = "c:/Users/antoi/anaconda3/envs/test_env/python.exe" +test_script = Path(__file__).parent / "tests" / "test_phase_3_2_e2e.py" + +result = subprocess.run([python_exe, str(test_script)]) +sys.exit(result.returncode)