diff --git a/ai-hub/integration_tests/conftest.py b/ai-hub/integration_tests/conftest.py index 9d90e8c..e6a9a5d 100644 --- a/ai-hub/integration_tests/conftest.py +++ b/ai-hub/integration_tests/conftest.py @@ -224,3 +224,17 @@ def run_around_tests(setup_mesh_environment): """Ensure setup runs for all tests.""" yield + +def pytest_addoption(parser): + parser.addoption( + "--runslow", action="store_true", default=False, help="run slow tests" + ) + +def pytest_collection_modifyitems(config, items): + if config.getoption("--runslow"): + # --runslow given in cli: do not skip slow tests + return + skip_slow = pytest.mark.skip(reason="need --runslow option to run") + for item in items: + if "slow" in item.keywords: + item.add_marker(skip_slow) diff --git a/ai-hub/integration_tests/test_agents.py b/ai-hub/integration_tests/test_agents.py index 93f5ebe..ea64992 100644 --- a/ai-hub/integration_tests/test_agents.py +++ b/ai-hub/integration_tests/test_agents.py @@ -9,6 +9,7 @@ uid = os.getenv("SYNC_TEST_USER_ID", "") return {"X-User-ID": uid} +@pytest.mark.slow def test_agent_lifecycle_and_api_coverage(): """ Test suite covering Agent API endpoints: @@ -111,6 +112,7 @@ # Cleanup Node client.delete(f"{BASE_URL}/nodes/admin/{node_id}", params={"admin_id": admin_id}) +@pytest.mark.slow def test_agent_webhook_trigger(): """ Test Agent Webhook Triggering: @@ -199,6 +201,7 @@ client.delete(f"{BASE_URL}/agents/{instance_id}", headers=_headers()) client.delete(f"{BASE_URL}/nodes/admin/{node_id}", params={"admin_id": admin_id}) +@pytest.mark.slow def test_agent_metrics_reset(): """ Test Agent Metrics Tracking and Reset: diff --git a/ai-hub/integration_tests/test_coworker_flow.py b/ai-hub/integration_tests/test_coworker_flow.py index 7fb716c..298374c 100644 --- a/ai-hub/integration_tests/test_coworker_flow.py +++ b/ai-hub/integration_tests/test_coworker_flow.py @@ -80,6 +80,7 @@ if instance_id: client.delete(f"{BASE_URL}/agents/{instance_id}", headers=_headers()) +@pytest.mark.slow def test_coworker_sc3_limit_check(): """ SC-3 (Limit Check): @@ -148,6 +149,7 @@ if instance_id: client.delete(f"{BASE_URL}/agents/{instance_id}", headers=_headers()) +@pytest.mark.slow def test_coworker_sc2_rework_loop(): """ SC-2 (The Rework Loop): @@ -205,6 +207,7 @@ finally: if instance_id: client.delete(f"{BASE_URL}/agents/{instance_id}", headers=_headers()) +@pytest.mark.slow def test_coworker_sc4_context_compaction(): """ SC-4 (Context Compaction): diff --git a/ai-hub/integration_tests/test_coworker_full_journey.py b/ai-hub/integration_tests/test_coworker_full_journey.py index 71d9b25..e915d5e 100644 --- a/ai-hub/integration_tests/test_coworker_full_journey.py +++ b/ai-hub/integration_tests/test_coworker_full_journey.py @@ -9,6 +9,7 @@ uid = os.getenv("SYNC_TEST_USER_ID", "9a333ccd-9c3f-432f-a030-7b1e1284a436") return {"X-User-ID": uid} +@pytest.mark.slow def test_coworker_full_journey(): """ CO-WORKER FULL JOURNEY INTEGRATION TEST: diff --git a/ai-hub/integration_tests/test_file_sync.py b/ai-hub/integration_tests/test_file_sync.py index 353ed1f..7a31bdb 100644 --- a/ai-hub/integration_tests/test_file_sync.py +++ b/ai-hub/integration_tests/test_file_sync.py @@ -537,6 +537,7 @@ pytest.skip(f"Could not restart {container}: {result.stderr}") +@pytest.mark.slow class TestNodeResync: """ Case 10: node reconnect / workspace resync after container restart. @@ -606,6 +607,7 @@ # LARGE FILE TESTS (20 MB, multi-chunk) # ══════════════════════════════════════════════════════════════════════════════ +@pytest.mark.slow class TestLargeFileSync: """Cases 5–8: 20 MB file create + delete in both directions.""" @@ -768,6 +770,7 @@ class TestGigabyteFileSync: """Tests synchronizing a 1GB file across the mesh via DD CLI tool.""" + @pytest.mark.slow def test_case_1gb_sync_from_client_to_server_and_node( self, sync_client, swarm_session ): diff --git a/ai-hub/integration_tests/test_node_registration.py b/ai-hub/integration_tests/test_node_registration.py index a176b20..8fddb40 100644 --- a/ai-hub/integration_tests/test_node_registration.py +++ b/ai-hub/integration_tests/test_node_registration.py @@ -16,6 +16,7 @@ import time @pytest.mark.skipif(os.getenv("SKIP_DOCKER_NODES", "false").lower() == "true", reason="Node Lifecycle integration test requires Docker to spawn nodes imperatively.") +@pytest.mark.slow def test_node_full_lifecycle_and_api_coverage(): user_id = _get_user_id() node_id = f"test-integration-node-{uuid.uuid4().hex[:8]}" diff --git a/ai-hub/integration_tests/test_parallel_coworker.py b/ai-hub/integration_tests/test_parallel_coworker.py index 930302c..cc30e5c 100644 --- a/ai-hub/integration_tests/test_parallel_coworker.py +++ b/ai-hub/integration_tests/test_parallel_coworker.py @@ -8,6 +8,7 @@ uid = os.getenv("SYNC_TEST_USER_ID", "") return {"X-User-ID": uid} +@pytest.mark.slow def test_parallel_rubric_generation(): """ Verifies that rubric generation and main agent execution happen in parallel. diff --git a/ai-hub/pytest.ini b/ai-hub/pytest.ini index 3515664..b1de605 100644 --- a/ai-hub/pytest.ini +++ b/ai-hub/pytest.ini @@ -5,4 +5,5 @@ tests integration_tests markers = - requires_nodes: marker for integration tests that require live agent nodes \ No newline at end of file + requires_nodes: marker for integration tests that require live agent nodes + slow: marker for slow integration tests (LLM calls, large file sync) \ No newline at end of file