Conversation
…ironment variables Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Search repository for COSMOSDB_KEY configuration setting usage
Make Cosmos DB tests read COSMOSDB_ENDPOINT and COSMOSDB_KEY from environment variables
Feb 22, 2026
crickman
approved these changes
Feb 22, 2026
…nvention Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>
Copilot
AI
changed the title
.NET: Make Cosmos DB tests read COSMOSDB_ENDPOINT and COSMOSDB_KEY from environment variables
Make Cosmos DB tests read COSMOSDB_ENDPOINT and COSMOSDB_KEY from environment variables
Feb 22, 2026
crickman
approved these changes
Feb 22, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables Cosmos DB tests to respect environment variables set by the CI workflow, which were previously ignored due to hardcoded connection settings. The changes align the test classes with the CI configuration while maintaining backward compatibility for local development.
Changes:
- Converted hardcoded Cosmos DB connection constants to read from
COSMOSDB_ENDPOINTandCOSMOSDB_KEYenvironment variables with fallback to original default values - Renamed fields from
EmulatorEndpoint/EmulatorKeytos_emulatorEndpoint/s_emulatorKeyfollowing the codebase's static field naming convention
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosCheckpointStoreTests.cs |
Updated to read Cosmos DB connection settings from environment variables, renamed fields to follow s_ prefix convention, updated all 2 usages |
dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosChatHistoryProviderTests.cs |
Updated to read Cosmos DB connection settings from environment variables, renamed fields to follow s_ prefix convention, updated all 4 usages |
peibekwe
approved these changes
Feb 23, 2026
alliscode
approved these changes
Feb 23, 2026
This was referenced Feb 27, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
The CI workflow sets
COSMOSDB_ENDPOINTandCOSMOSDB_KEYenvironment variables for Cosmos DB emulator tests, but both test classes ignored them entirely — using hardcodedprivate const stringvalues instead. The workflow configuration was dead.Description
EmulatorEndpointandEmulatorKeyfromprivate const stringtoprivate static readonly stringin bothCosmosCheckpointStoreTestsandCosmosChatHistoryProviderTests, reading from env vars with the original hardcoded values as fallbacks.s_prefix convention for static fields (s_emulatorEndpoint,s_emulatorKey).No behavioral change locally; in CI the workflow-supplied values now take effect.
Contribution Checklist