Some checks failed
Documentation Validation / validate-docs (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
API Endpoint Tests / test-api-endpoints (push) Has been cancelled
CLI Tests / test-cli (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Package Tests / test-python-packages (map[name:aitbc-agent-sdk path:packages/py/aitbc-agent-sdk]) (push) Has been cancelled
Package Tests / test-python-packages (map[name:aitbc-core path:packages/py/aitbc-core]) (push) Has been cancelled
Package Tests / test-python-packages (map[name:aitbc-crypto path:packages/py/aitbc-crypto]) (push) Has been cancelled
Package Tests / test-python-packages (map[name:aitbc-sdk path:packages/py/aitbc-sdk]) (push) Has been cancelled
Package Tests / test-javascript-packages (map[name:aitbc-sdk-js path:packages/js/aitbc-sdk]) (push) Has been cancelled
Package Tests / test-javascript-packages (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Systemd Sync / sync-systemd (push) Has been cancelled
- Add Code Quality Module section with pre-commit hooks and quality checks - Add Type Checking CI/CD Module section with MyPy workflow and coverage - Update README with code quality achievements and project structure - Migrate FastAPI apps from deprecated on_event to lifespan context manager - Update pyproject.toml files to reference consolidated dependencies - Remove unused app.py import in coordinator-api - Add type hints to agent
59 lines
2.0 KiB
Python
59 lines
2.0 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Quick test to verify code quality tools are working properly
|
|
"""
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
def run_command(cmd, description):
|
|
"""Run a command and return success status"""
|
|
print(f"\n🔍 {description}")
|
|
print(f"Running: {' '.join(cmd)}")
|
|
|
|
try:
|
|
result = subprocess.run(cmd, capture_output=True, text=True, cwd="/opt/aitbc")
|
|
if result.returncode == 0:
|
|
print(f"✅ {description} - PASSED")
|
|
return True
|
|
else:
|
|
print(f"❌ {description} - FAILED")
|
|
print(f"Error output: {result.stderr[:500]}")
|
|
return False
|
|
except Exception as e:
|
|
print(f"❌ {description} - ERROR: {e}")
|
|
return False
|
|
|
|
def main():
|
|
"""Test code quality tools"""
|
|
print("🚀 Testing AITBC Code Quality Setup")
|
|
print("=" * 50)
|
|
|
|
tests = [
|
|
(["/opt/aitbc/venv/bin/black", "--check", "--diff", "apps/coordinator-api/src/app/routers/"], "Black formatting check"),
|
|
(["/opt/aitbc/venv/bin/isort", "--check-only", "apps/coordinator-api/src/app/routers/"], "Isort import check"),
|
|
(["/opt/aitbc/venv/bin/ruff", "check", "apps/coordinator-api/src/app/routers/"], "Ruff linting"),
|
|
(["/opt/aitbc/venv/bin/mypy", "--ignore-missing-imports", "apps/coordinator-api/src/app/routers/"], "MyPy type checking"),
|
|
(["/opt/aitbc/venv/bin/bandit", "-r", "apps/coordinator-api/src/app/routers/", "-f", "json"], "Bandit security check"),
|
|
]
|
|
|
|
results = []
|
|
for cmd, desc in tests:
|
|
results.append(run_command(cmd, desc))
|
|
|
|
# Summary
|
|
passed = sum(results)
|
|
total = len(results)
|
|
|
|
print(f"\n📊 Summary: {passed}/{total} tests passed")
|
|
|
|
if passed == total:
|
|
print("🎉 All code quality checks are working!")
|
|
return 0
|
|
else:
|
|
print("⚠️ Some checks failed - review the output above")
|
|
return 1
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|