Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Internal] Pipelines: Fixes Multi-Region CI pipeline to include env variable #4363

Merged
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,19 @@ public void PooledConnectionLifetimeTest()
Type clientMessageHandlerType = cosmosClient.ClientContext.DocumentClient.httpClient.HttpMessageHandler.GetType();
Assert.AreEqual(socketHandlerType, clientMessageHandlerType);
}

[TestMethod]
[TestCategory("MultiRegion")]
public async Task MultiRegionAccountTest()
{
string connectionString = TestCommon.GetMultiRegionConnectionString();
Assert.IsNotNull(connectionString);
Assert.Fail(connectionString[..10]);
using CosmosClient cosmosClient = new CosmosClient(connectionString);
Assert.IsNotNull(cosmosClient);
AccountProperties properties = await cosmosClient.ReadAccountAsync();
Assert.IsNotNull(properties);
}

public static IReadOnlyList<string> GetActiveConnections()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ internal static (string endpoint, string authKey) GetAccountInfo()
return (endpoint, authKey);
}

internal static string GetMultiRegionConnectionString()
{
string connectionString = (string)Environment.GetEnvironmentVariable("COSMOSDB_MULTI_REGION");
return connectionString;
}

internal static CosmosClientBuilder GetDefaultConfiguration(
bool useCustomSeralizer = true,
bool validatePartitionKeyRangeCalls = false,
Expand Down
2 changes: 2 additions & 0 deletions templates/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,5 @@ jobs:
nugetConfigPath: NuGet.config
publishTestResults: true
testRunTitle: Microsoft.Azure.Cosmos.EmulatorTests
env:
COSMOSDB_MULTI_REGION: $(COSMOS_DB_MULTI_REGION) # Real Account Connection String used for multi-region tests while running as part of ci pipline
Loading