Files
aitbc/apps/coordinator-api/tests/services
aitbc 3897bcbf24
Some checks failed
CLI Tests / test-cli (push) Failing after 4s
Deploy to Testnet / deploy-testnet (push) Successful in 1m40s
Documentation Validation / validate-docs (push) Failing after 12s
Documentation Validation / validate-policies-strict (push) Successful in 4s
Integration Tests / test-service-integration (push) Successful in 2m42s
Package Tests / Python package - aitbc-agent-sdk (push) Failing after 34s
Package Tests / Python package - aitbc-core (push) Successful in 27s
Package Tests / Python package - aitbc-crypto (push) Successful in 13s
Package Tests / Python package - aitbc-sdk (push) Successful in 16s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 8s
Package Tests / JavaScript package - aitbc-token (push) Successful in 18s
Python Tests / test-python (push) Failing after 50s
Security Scanning / security-scan (push) Failing after 43s
Multi-Node Stress Testing / stress-test (push) Successful in 12s
Cross-Node Transaction Testing / transaction-test (push) Successful in 9s
refactor: move version to separate module and improve logging
- Created aitbc/_version.py with centralized version definition
- Updated aitbc/__init__.py to import __version__ from _version module
- Updated constants.py to use __version__ for PACKAGE_VERSION
- Replaced print() calls with logger in decorators.py, events.py, queue_manager.py, and state.py
- Added logger initialization using get_logger(__name__) in config.py, decorators.py, events.py, queue_manager.py, and state.py
- Added cli/commands
2026-05-11 20:12:01 +02:00
..

Service Tests README

Test Structure

This directory contains tests for the modularized service components:

Advanced RL Tests (test_advanced_rl/)

  • test_agents.py - Tests for PPO, SAC, and RainbowDQN neural network agents
  • test_engine.py - Tests for the AdvancedReinforcementLearningEngine

Requirements:

  • PyTorch (torch)
  • Full AITBC environment with domain models
  • pytest-asyncio for async tests

Certification Tests (test_certification/)

  • test_certification_system.py - Tests for CertificationSystem
  • test_partnership_manager.py - Tests for PartnershipManager
  • test_badge_system.py - Tests for BadgeSystem

Requirements:

  • Full AITBC environment with domain models
  • aitbc package for logging
  • pytest-asyncio for async tests

Multi-Modal Fusion Tests (test_multi_modal_fusion/)

  • test_neural_modules.py - Tests for CrossModalAttention, MultiModalTransformer, AdaptiveModalityWeighting
  • test_fusion_engine.py - Tests for MultiModalFusionEngine

Requirements:

  • PyTorch (torch)
  • NumPy (numpy)
  • Full AITBC environment with domain models
  • pytest-asyncio for async tests

Running Tests

Prerequisites

Ensure you have the full AITBC environment set up with all dependencies:

cd /opt/aitbc
source venv/bin/activate  # or use your preferred environment

Install additional dependencies

pip install torch pytest-asyncio

Run tests with proper PYTHONPATH

cd /opt/aitbc/apps/coordinator-api
PYTHONPATH=/opt/aitbc/apps/coordinator-api/src:/opt/aitbc python3 -m pytest tests/services/ -v

Run specific test suites

# Advanced RL tests (requires torch)
PYTHONPATH=/opt/aitbc/apps/coordinator-api/src:/opt/aitbc python3 -m pytest tests/services/test_advanced_rl/ -v

# Certification tests
PYTHONPATH=/opt/aitbc/apps/coordinator-api/src:/opt/aitbc python3 -m pytest tests/services/test_certification/ -v

# Multi-modal fusion tests (requires torch)
PYTHONPATH=/opt/aitbc/apps/coordinator-api/src:/opt/aitbc python3 -m pytest tests/services/test_multi_modal_fusion/ -v

Test Coverage

These tests were created as part of the service modularization effort (Phase 2-3 of the refactoring plan). They provide:

  • Unit tests for neural network components (advanced_rl, multi_modal_fusion)
  • Integration tests for certification, partnership, and badge systems
  • Coverage of key methods and initialization logic

The tests use mocking where appropriate to isolate components and test individual functionality.

Current Status

  • Test files created for all modularized components
  • Test structure follows pytest best practices
  • ⚠️ Tests require full AITBC environment to run (expected for integration tests)
  • ⚠️ PyTorch-dependent tests require torch installation

Future Improvements

  • Add CI/CD integration for automated test running
  • Increase test coverage to 100% as per Phase 3 goals
  • Add performance benchmarks for neural network components
  • Add property-based tests where applicable