Cosmos: live tests fail due to empty containers (missing seed data)
- Dominant language
- C#
- Stars
- 3.7k
- Forks
- 624
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 220
Description
## 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`):
```json
{ "status": 200, "message": "Success",
"results": { "sampleSize": 0, "properties": [] } }
```
`cosmos_database_container_item_text-search` (container `TextItems`):
```json
{ "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](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6555615&view=results)
Contributor guide
Research direction
Start with Azure.Mcp.Tools.Cosmos.Tests.CosmosCommandTests and the eight named failing tests, then inspect the live-test setup for the ToDoList/Items and TextItems containers. Determine whether setup can seed the expected documents and vector data, or whether tests should detect missing seed data. Done means the live tests pass reliably in both seeded and unseeded environments without treating empty responses as data failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- databases, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100