Files
Atomizer/archive/scripts/run_e2e_with_env.py
Anto01 2b3573ec42 feat: Add AtomizerField training data export and intelligent model discovery
Major additions:
- Training data export system for AtomizerField neural network training
- Bracket stiffness optimization study with 50+ training samples
- Intelligent NX model discovery (auto-detect solutions, expressions, mesh)
- Result extractors module for displacement, stress, frequency, mass
- User-generated NX journals for advanced workflows
- Archive structure for legacy scripts and test outputs
- Protocol documentation and dashboard launcher

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 12:01:50 -05:00

44 lines
1.3 KiB
Python

"""
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)