refactor: restructure test suite

- Remove tests/production/ directory (JWT auth, production monitoring, etc.)
- Remove tests/staking/ directory
- Remove tests/services/test_staking_service.py
- Remove tests/phase1/ directory
- Remove tests/load_test.py
- Add tests/verification/ directory with 20+ new test files
- Add tests/load/locustfile.py for load testing
- Add tests/security/test_confidential_transactions.py
- Add tests/integration/test_working_integration.py
- Update docs/ for minimum Python version and paths
This commit is contained in:
aitbc
2026-04-21 21:15:27 +02:00
parent cdba253fb2
commit 14e2d96870
45 changed files with 10425 additions and 693 deletions

View File

@@ -0,0 +1,63 @@
#!/usr/bin/env python3
"""
Test script for host GPU miner
"""
import subprocess
import httpx
# Test GPU
print("Testing GPU access...")
result = subprocess.run(['nvidia-smi', '--query-gpu=name', '--format=csv,noheader,nounits'],
capture_output=True, text=True)
if result.returncode == 0:
print(f"✅ GPU detected: {result.stdout.strip()}")
else:
print("❌ GPU not accessible")
# Test Ollama
print("\nTesting Ollama...")
try:
response = httpx.get("http://localhost:11434/api/tags", timeout=5)
if response.status_code == 200:
models = response.json().get('models', [])
print(f"✅ Ollama running with {len(models)} models")
for m in models[:3]: # Show first 3 models
print(f" - {m['name']}")
else:
print("❌ Ollama not responding")
except Exception as e:
print(f"❌ Ollama error: {e}")
# Test Coordinator
print("\nTesting Coordinator...")
try:
response = httpx.get("http://127.0.0.1:8000/v1/health", timeout=5)
if response.status_code == 200:
print("✅ Coordinator is accessible")
else:
print("❌ Coordinator not responding")
except Exception as e:
print(f"❌ Coordinator error: {e}")
# Test Ollama inference
print("\nTesting Ollama inference...")
try:
response = httpx.post(
"http://localhost:11434/api/generate",
json={
"model": "llama3.2:latest",
"prompt": "Say hello",
"stream": False
},
timeout=10
)
if response.status_code == 200:
result = response.json()
print(f"✅ Inference successful: {result.get('response', '')[:50]}...")
else:
print("❌ Inference failed")
except Exception as e:
print(f"❌ Inference error: {e}")
print("\n✅ All tests completed!")