Add sys import to test files and remove obsolete integration tests
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Successful in 9s
Blockchain Synchronization Verification / sync-verification (push) Failing after 1s
CLI Tests / test-cli (push) Failing after 3s
Documentation Validation / validate-docs (push) Successful in 6s
Documentation Validation / validate-policies-strict (push) Successful in 2s
Integration Tests / test-service-integration (push) Successful in 40s
Multi-Node Blockchain Health Monitoring / health-check (push) Successful in 1s
P2P Network Verification / p2p-verification (push) Successful in 2s
Production Tests / Production Integration Tests (push) Successful in 21s
Python Tests / test-python (push) Successful in 13s
Security Scanning / security-scan (push) Failing after 46s
Smart Contract Tests / test-solidity (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Successful in 17s
Smart Contract Tests / lint-solidity (push) Successful in 10s

- Add sys import to 29 test files across agent-coordinator, blockchain-event-bridge, blockchain-node, and coordinator-api
- Remove apps/blockchain-event-bridge/tests/test_integration.py (obsolete bridge integration tests)
- Remove apps/coordinator-api/tests/test_integration.py (obsolete API integration tests)
- Implement GPU registration in marketplace_gpu.py with GPURegistry model persistence
This commit is contained in:
aitbc
2026-04-23 16:43:17 +02:00
parent b8b1454573
commit e60cc3226c
134 changed files with 14321 additions and 1873 deletions

View File

@@ -136,10 +136,37 @@ async def register_gpu(request: dict[str, Any], session: Annotated[Session, Depe
"""Register a GPU in the marketplace."""
gpu_specs = request.get("gpu", {})
# Simple implementation - return success
# Create GPU registry record
import uuid
from datetime import datetime
gpu_id = str(uuid.uuid4())
gpu_id = f"gpu_{uuid.uuid4().hex[:8]}"
# Ensure miner_id is always provided
miner_id = gpu_specs.get("miner_id") or gpu_specs.get("miner") or "default_miner"
# Map compute capability to cuda_version field
compute_capability = gpu_specs.get("compute_capability", "")
cuda_version = compute_capability if compute_capability else ""
gpu_record = GPURegistry(
id=gpu_id,
miner_id=miner_id,
model=gpu_specs.get("name", "Unknown GPU"),
memory_gb=gpu_specs.get("memory_gb", 0),
cuda_version=cuda_version,
region="default",
price_per_hour=gpu_specs.get("price_per_hour", 0.05),
status="available",
capabilities=[],
average_rating=0.0,
total_reviews=0,
created_at=datetime.utcnow()
)
session.add(gpu_record)
session.commit()
session.refresh(gpu_record)
return {
"gpu_id": gpu_id,

View File

@@ -2,6 +2,7 @@
Tests for Agent Identity SDK
Unit tests for the Agent Identity client and models
"""
import sys
import pytest
import asyncio

View File

@@ -2,6 +2,7 @@
Tests for coordinator billing stubs: usage tracking, billing events, and tenant context.
Uses lightweight in-memory mocks to avoid PostgreSQL/UUID dependencies.
import sys
"""
import asyncio

View File

@@ -2,6 +2,7 @@
Comprehensive health endpoint tests for AITBC services
Tests both internal service health and external marketplace health endpoints.
import sys
"""
import json

View File

@@ -2,6 +2,7 @@
Basic integration tests for AITBC Coordinator API
"""
import sys
import pytest
from fastapi.testclient import TestClient
from unittest.mock import Mock, patch

View File

@@ -2,6 +2,7 @@
Unit tests for coordinator API metrics collection and alert delivery.
Tests MetricsCollector, AlertDispatcher, and build_live_metrics_payload
without requiring full app startup or database.
import sys
"""
import asyncio

View File

@@ -2,6 +2,7 @@
Env vars (set any that you want to exercise):
import sys
For optional endpoints:
EXPLORER_API_URL # e.g., http://127.0.0.1:8000/v1/explorer/blocks/head
MARKET_STATS_URL # e.g., http://127.0.0.1:8000/v1/marketplace/stats

View File

@@ -2,6 +2,7 @@
Tests the end-to-end flow:
1. Client submits a job with ZK proof requirement
import sys
2. Miner completes the job and generates a receipt
3. Receipt is hashed and a ZK proof is generated (simulated)
4. Proof is verified via the coordinator's confidential endpoint