Skip to content

Conversation

@rogerbarreto
Copy link
Member

Motivation and Context

Cosmos DB Unit Tests do not fail fast when the environment is not configured.

This change solves this making the whole project skip at once for non-configured environments.

This change also skip Emulator running in every single pipeline when no CosmosDB code related was changed, improving execution the time.

…skip in pipeline when no CosmosDB changes happened
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements fast-fail behavior for Cosmos DB unit tests when the emulator is not available and optimizes CI pipeline execution by conditionally starting the Cosmos DB emulator only when CosmosDB-related code changes are detected.

Key changes:

  • Added SkipIfEmulatorNotAvailable() calls in test initialization to enable fast skipping when the emulator is not configured
  • Introduced path filtering for CosmosDB changes to conditionally start the emulator in CI pipelines
  • Added COSMOS_EMULATOR_AVAILABLE environment variable to signal emulator availability to tests

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosCheckpointStoreTests.cs Added fast-skip check in InitializeAsync() and removed unnecessary using Xunit; statement
dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosChatMessageStoreTests.cs Added fast-skip check in InitializeAsync() and removed unnecessary using Xunit; statement
.github/workflows/dotnet-build-and-test.yml Added CosmosDB path filter, conditional emulator startup, and COSMOS_EMULATOR_AVAILABLE environment variable configuration

@rogerbarreto rogerbarreto added this pull request to the merge queue Dec 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants