diff --git a/cli/aitbc_cli/commands/simulate.py b/cli/aitbc_cli/commands/simulate.py index d1313510..e64fd8fa 100644 --- a/cli/aitbc_cli/commands/simulate.py +++ b/cli/aitbc_cli/commands/simulate.py @@ -16,11 +16,13 @@ import os sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) try: - from utils import output, setup_logging + from utils import output, error, setup_logging from config import get_config except ImportError: def output(msg, format_type): click.echo(msg) + def error(msg): + click.echo(f"Error: {msg}") def setup_logging(verbose, debug): return "INFO" def get_config(config_file=None, role=None): diff --git a/scripts/testing/test_edge_advanced.sh b/scripts/testing/test_edge_advanced.sh index 6c930a2d..7fc464d1 100755 --- a/scripts/testing/test_edge_advanced.sh +++ b/scripts/testing/test_edge_advanced.sh @@ -73,7 +73,7 @@ log_info "Starting edge advanced CLI integration tests" log_info "Edge API URL: $EDGE_URL" # Island advanced operations -run_test "Island leave" "aitbc edge island leave --island-id test_island_123" "true" +run_test "Island leave" "aitbc edge island leave test_island_123" "true" run_test "Island bridge" "aitbc edge island bridge --source island_a --target island_b" "true" @@ -120,7 +120,7 @@ run_test "Metrics get" "aitbc edge metrics get_metric --metric-id metric_123" "t run_test "Metrics delete" "aitbc edge metrics delete_metric --metric-id metric_123" "true" # Error handling tests (should handle gracefully) -run_test "Island leave nonexistent" "aitbc edge island leave --island-id nonexistent_island" "false" +run_test "Island leave nonexistent" "aitbc edge island leave nonexistent_island" "false" run_test "GPU get nonexistent" "aitbc edge gpu get_gpu --gpu-id nonexistent_gpu" "false" diff --git a/tests/conftest.py b/tests/conftest.py index 7181114f..ba5b2d43 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -9,6 +9,7 @@ from pathlib import Path # Configure Python path for test discovery project_root = Path(__file__).parent.parent sys.path.insert(0, str(project_root)) +sys.path.insert(0, str(project_root / "tests")) # Import fixtures from dedicated fixture files # Common fixtures (environment setup, data generators)