Skip to content

[Test] End-to-end integration test against live IICP mesh (blocked on W-011) #2

@RobLe3

Description

@RobLe3

Summary

All current tests are unit tests with respx mocks. No integration test exercises a real IICP node. This issue tracks the work to add one once a node with a publicly-routable endpoint is registered.

Current blocker

GET /api/v1/discover returns endpoint: "http://localhost:8080/..." for all registered nodes (W-011 — adapter registered with non-internet-routable public_endpoint). submit() and chat() will fail with a connection error until at least one node registers with a real public endpoint.

What to add (once blocker is cleared)

# tests/test_integration.py  (skip if IICP_INTEGRATION_TEST not set)
@pytest.mark.skipif(not os.getenv("IICP_INTEGRATION_TEST"), reason="requires live node")
@pytest.mark.asyncio
async def test_live_discover():
    client = IicpClient(ClientConfig(directory_url="https://iicp.network/api"))
    nodes = await client.discover_async("urn:iicp:intent:llm:chat:v1")
    assert len(nodes.nodes) > 0
    assert nodes.nodes[0].endpoint.startswith("http")

@pytest.mark.skipif(not os.getenv("IICP_INTEGRATION_TEST"), reason="requires live node")
@pytest.mark.asyncio
async def test_live_chat():
    client = IicpClient()
    response = await client.chat_async(
        messages=[{"role": "user", "content": "Reply with exactly: IICP OK"}]
    )
    assert response.choices[0].message.content

Acceptance criteria

  • W-011 cleared (at least one node with a routable endpoint)
  • tests/test_integration.py added with live discover + chat tests
  • CI optionally runs integration tests when IICP_INTEGRATION_TEST=1 secret is set

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions