Skip to content

Cosmos: live tests fail due to empty containers (missing seed data) #3032

Description

@conniey

Summary

All Cosmos live tests that read documents fail because the queried containers return empty result sets. The service responds correctly (200 Success) — there is simply no seed data in the live account/containers, so data assertions fail. This is a test-data / environment issue, not a code defect.

Failing live tests

Azure.Mcp.Tools.Cosmos.Tests.CosmosCommandTests (8):

  • Should_infer_container_schema
  • Should_text_search_documents
  • Should_text_search_documents_with_select_properties
  • Should_vector_search_documents
  • Should_vector_search_documents_with_select_properties
  • Should_list_recent_items
  • Should_get_item_by_id
  • Should_get_item_by_id_with_partition_key

Evidence

cosmos_database_container_schema_infer (database ToDoList, container Items):

{ "status": 200, "message": "Success",
  "results": { "sampleSize": 0, "properties": [] } }

cosmos_database_container_item_text-search (container TextItems):

{ "status": 200, "message": "Success", "results": { "items": [] } }
Assert.Contains() Failure — Set: []  Not found: "text-1"

Analysis

Every failing call returns 200 Success with empty payloads (sampleSize: 0, empty items/properties). The test containers (ToDoList / Items / TextItems) contain no documents in the live environment.

Suggested fix

  • Seed the Cosmos test containers as part of live-test setup (documents including the expected text-1 item and vector data), or
  • Gate these tests on the presence of seed data so an unseeded environment doesn't produce false failures.

Source

CI live-test run for Azure.Mcp.Tools.Cosmos: buildId 6555615

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions