Skip to content

Conversation

@TheovanKraay
Copy link
Member

Pull Request Template

Description

This PR adds CI/CD pipeline support for the vNext emulator (preview), enabling automated validation of the .NET SDK against the next-generation Azure Cosmos DB emulator.

Key Changes

Pipeline Configuration:

  • Added azure-pipelines-vnext-emulator.yml - Daily scheduled pipeline (2 AM UTC) for vNext emulator validation
  • Added templates/emulator-vnext-setup.yml - Template for vNext emulator setup
  • Pipeline runs independently and does NOT block PRs (validation only)

vNext Emulator Support:

  • HTTP Protocol Support: Added COSMOSDBEMULATOR_ENDPOINT environment variable support to override default HTTPS endpoint
    • vNext emulator uses HTTP (http://localhost:8081/) instead of HTTPS
    • Maintains backward compatibility with legacy emulator (HTTPS via settings.json)
  • Gateway Mode Enforcement: Added AZURE_COSMOS_EMULATOR_CONNECTION_MODE environment variable
    • Forces all tests to use Gateway mode (vNext limitation - no Direct mode support)
    • Applied across all test creation methods in TestCommon.cs

Test Infrastructure Updates:

  • Modified ConfigurationManager.cs: Environment variable now overrides settings.json for endpoint configuration
  • Updated TestCommon.cs: All CreateCollectionAsync methods respect Gateway mode environment variable
  • Added throughput capping (≤10000 RU/s) when in Gateway mode to accommodate vNext single-partition limitation
  • Updated QueryTests.cs and RoutingGatewayCosmosItemIdEncodingTests.cs for vNext compatibility

Test Results (Initial Validation)

Overall: 36 tests passing out of 225 tested (16% pass rate)

Category Passed Total Pass Rate
ChangeFeed 21 61 34.4%
ClientTelemetryEmulator 8 21 38.1%
Query 4 78 5.1%
Batch 2 50 4.0%
ReadFeed 1 15 6.7%

Excluded Tests: MultiPartition and CrossPartition tests excluded due to vNext single-partition constraint

vNext Emulator Limitations

The vNext emulator has significant differences from the legacy emulator:

  • Protocol: HTTP only (no HTTPS/SSL)
  • Connection Mode: Gateway only (no Direct mode)
  • Partitioning: Single partition containers only
  • Feature Set: Limited compared to legacy emulator (explains low pass rates)

Trigger Options

  • Daily Schedule: Runs automatically at 2 AM UTC
  • Manual: Via Azure Pipelines UI
  • PR Comment: /azp run vnext-emulator (for on-demand testing)

Backward Compatibility

All changes maintain full backward compatibility:

  • Legacy emulator tests unchanged (use HTTPS from settings.json by default)
  • vNext emulator tests use environment variable override (opt-in)
  • No breaking changes to existing test infrastructure
  • Regular PR validation unaffected

Documentation

Comprehensive documentation available in OneDrive:
C:\Users\thvankra\OneDrive - Microsoft\cosmos-db-pm\sdk\vnext SDK\vNext-SDK-Test-Status.md

Includes:

  • Complete test results breakdown
  • How to run vNext tests locally
  • Known limitations and issues
  • Improvement roadmap
  • Risk assessment

Type of change

  • New feature (non-breaking change which adds functionality)

Closing issues

N/A - This adds new vNext emulator validation infrastructure without closing specific issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant