[Internal] Pipelines: Fixes Multi-Region CI pipeline to include env variable (#4363)
* Fixes Multi-Region CI pipeline to include env variable * fixed space * added validation test * string conversion * temp * temp2 * Update Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com> * Update Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com> * changed env location * temp * test * space * remove env * possible fix * test fix * clean up * changed enviroment variable get * test * test fix * ensure multiregion tests do not run with regular emulator tests --------- Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
This commit is contained in:
Родитель
dbdf8064f5
Коммит
75a2e5f98a
|
@ -924,6 +924,18 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests
|
|||
Type clientMessageHandlerType = cosmosClient.ClientContext.DocumentClient.httpClient.HttpMessageHandler.GetType();
|
||||
Assert.AreEqual(socketHandlerType, clientMessageHandlerType);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[TestCategory("MultiRegion")]
|
||||
public async Task MultiRegionAccountTest()
|
||||
{
|
||||
string connectionString = TestCommon.GetMultiRegionConnectionString();
|
||||
Assert.IsFalse(string.IsNullOrEmpty(connectionString), "Connection String Not Set");
|
||||
using CosmosClient cosmosClient = new CosmosClient(connectionString);
|
||||
Assert.IsNotNull(cosmosClient);
|
||||
AccountProperties properties = await cosmosClient.ReadAccountAsync();
|
||||
Assert.IsNotNull(properties);
|
||||
}
|
||||
|
||||
public static IReadOnlyList<string> GetActiveConnections()
|
||||
{
|
||||
|
|
|
@ -73,6 +73,11 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests
|
|||
return (endpoint, authKey);
|
||||
}
|
||||
|
||||
internal static string GetMultiRegionConnectionString()
|
||||
{
|
||||
return Cosmos.ConfigurationManager.GetEnvironmentVariable<string>("COSMOSDB_MULTI_REGION", string.Empty);
|
||||
}
|
||||
|
||||
internal static CosmosClientBuilder GetDefaultConfiguration(
|
||||
bool useCustomSeralizer = true,
|
||||
bool validatePartitionKeyRangeCalls = false,
|
||||
|
|
|
@ -50,6 +50,7 @@ jobs:
|
|||
BuildConfiguration: Release
|
||||
Arguments: $(ReleaseArguments)
|
||||
VmImage: $(VmImage)
|
||||
MultiRegionConnectionString: $(COSMOSDB_MULTI_REGION)
|
||||
|
||||
- template: templates/build-internal.yml
|
||||
parameters:
|
||||
|
|
|
@ -5,12 +5,13 @@ parameters:
|
|||
Arguments: ''
|
||||
VmImage: '' # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops
|
||||
OS: 'Windows'
|
||||
EmulatorPipeline1Arguments: ' --filter "TestCategory!=Quarantine & TestCategory!=Functional & TestCategory!=ClientTelemetryRelease & TestCategory!=LongRunning & (TestCategory=ClientTelemetryEmulator|TestCategory=Query|TestCategory=ReadFeed|TestCategory=Batch|TestCategory=ChangeFeed)" --verbosity normal '
|
||||
EmulatorPipeline2Arguments: ' --filter "TestCategory!=Quarantine & TestCategory!=Functional & TestCategory!=ClientTelemetryRelease & TestCategory!=ClientTelemetryEmulator & TestCategory!=Query & TestCategory!=ReadFeed & TestCategory!=Batch & TestCategory!=ChangeFeed & TestCategory!=LongRunning" --verbosity normal '
|
||||
EmulatorPipeline1Arguments: ' --filter "TestCategory!=Quarantine & TestCategory!=Functional & TestCategory!=ClientTelemetryRelease & TestCategory!=LongRunning & TestCategory!=MultiRegion & (TestCategory=ClientTelemetryEmulator|TestCategory=Query|TestCategory=ReadFeed|TestCategory=Batch|TestCategory=ChangeFeed)" --verbosity normal '
|
||||
EmulatorPipeline2Arguments: ' --filter "TestCategory!=Quarantine & TestCategory!=Functional & TestCategory!=ClientTelemetryRelease & TestCategory!=ClientTelemetryEmulator & TestCategory!=Query & TestCategory!=ReadFeed & TestCategory!=Batch & TestCategory!=ChangeFeed & TestCategory!=LongRunning & TestCategory!=MultiRegion" --verbosity normal '
|
||||
EmulatorPipeline3Arguments: ' --filter "TestCategory=MultiRegion" --verbosity normal '
|
||||
EmulatorPipeline1CategoryListName: ' Client Telemetry, Query, ChangeFeed, ReadFeed, Batch ' # Divided in 2 categories to run them in parallel and reduce the PR feedback time
|
||||
EmulatorPipeline2CategoryListName: ' Others '
|
||||
EmulatorPipeline3CategoryListName: ' MultiRegion '
|
||||
MultiRegionConnectionString : ''
|
||||
|
||||
jobs:
|
||||
- job:
|
||||
|
@ -236,3 +237,5 @@ jobs:
|
|||
nugetConfigPath: NuGet.config
|
||||
publishTestResults: true
|
||||
testRunTitle: Microsoft.Azure.Cosmos.EmulatorTests
|
||||
env:
|
||||
COSMOSDB_MULTI_REGION: ${{ parameters.MultiRegionConnectionString }}
|
||||
|
|
Загрузка…
Ссылка в новой задаче