Files
aitbc/apps/blockchain-node/tests/test_observability_dashboards.py
aitbc e60cc3226c
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 test files and remove obsolete integration tests
- 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
2026-04-23 16:43:17 +02:00

41 lines
1.2 KiB
Python
Executable File

"""Tests for the observability dashboard helpers."""
from __future__ import annotations
import sys
import json
from pathlib import Path
from aitbc_chain.observability.dashboards import generate_default_dashboards
from aitbc_chain.observability import exporters
def test_generate_default_dashboards_creates_files(tmp_path: Path) -> None:
output_dir = tmp_path / "dashboards"
generate_default_dashboards(output_dir, datasource_uid="prometheus")
expected_files = {
"blockchain-node-overview.json",
"coordinator-overview.json",
}
actual_files = {path.name for path in output_dir.glob("*.json")}
assert actual_files == expected_files
for file_path in output_dir.glob("*.json"):
with file_path.open("r", encoding="utf-8") as handle:
payload = json.load(handle)
assert payload["uid"] in {"aitbc-coordinator", "aitbc-node"}
assert payload["title"].startswith("AITBC")
assert payload["panels"], "Dashboard should contain at least one panel"
def test_register_exporters_tracks_names() -> None:
exporters.REGISTERED_EXPORTERS.clear()
exporters.register_exporters(["prometheus", "loki"])
assert exporters.REGISTERED_EXPORTERS == ["prometheus", "loki"]