From 437702354d12672ee38e40f6469c5de5ca5498dd Mon Sep 17 00:00:00 2001 From: Rohit Ranjan <90008725+RohitRanjanMS@users.noreply.github.com> Date: Fri, 21 Feb 2025 14:21:50 -0800 Subject: [PATCH] - --- .../CosmosDB/CosmosDBEndToEndTestsBase.cs | 12 +++++------- .../CosmosDB/CosmosDBNodeEndToEndTests.cs | 10 +++++----- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/test/WebJobs.Script.Tests.Integration/CosmosDB/CosmosDBEndToEndTestsBase.cs b/test/WebJobs.Script.Tests.Integration/CosmosDB/CosmosDBEndToEndTestsBase.cs index 1e98e195f8..5030c7b283 100644 --- a/test/WebJobs.Script.Tests.Integration/CosmosDB/CosmosDBEndToEndTestsBase.cs +++ b/test/WebJobs.Script.Tests.Integration/CosmosDB/CosmosDBEndToEndTestsBase.cs @@ -29,11 +29,9 @@ protected async Task CosmosDBTriggerToBlobTest() // Waiting for the Processor to acquire leases await Task.Delay(10000); - //await Fixture.InitializeDocumentClient(); Fixture.InitializeCosmosClient(); bool collectionsCreated = await Fixture.CreateDocumentCollections(); - var resultBlob = Fixture.TestOutputContainer.GetBlockBlobReference("cosmosdbtriggere2e-completed"); await resultBlob.DeleteIfExistsAsync(); @@ -51,7 +49,7 @@ protected async Task CosmosDBTriggerToBlobTest() await Fixture.DeleteDocumentCollections(); } - Assert.False(string.IsNullOrEmpty(result)); + Assert.False(string.IsNullOrEmpty(result)); } protected async Task CosmosDBTest() @@ -111,7 +109,7 @@ public override void ConfigureScriptHost(IWebJobsBuilder webJobsBuilder) "CosmosDBOut" }; }); - } + } public void InitializeCosmosClient() { @@ -121,19 +119,19 @@ public void InitializeCosmosClient() CosmosClient = new CosmosClient(connectionString); } } - + public async Task CreateDocumentCollections() { bool willCreateCollection = false; Database database = await CosmosClient.CreateDatabaseIfNotExistsAsync("ItemDb"); - ContainerProperties itemCollectionProperties = new ContainerProperties("ItemCollection", "/_partitionKey"); + ContainerProperties itemCollectionProperties = new ContainerProperties("ItemCollection", "/id"); ContainerResponse itemCollectionResponse = await database.CreateContainerIfNotExistsAsync( itemCollectionProperties, throughput: 400); willCreateCollection = itemCollectionResponse.StatusCode == System.Net.HttpStatusCode.Created; - ContainerProperties leasesCollectionProperties = new ContainerProperties("leases", "/_partitionKey"); + ContainerProperties leasesCollectionProperties = new ContainerProperties("leases", "/id"); await database.CreateContainerIfNotExistsAsync( leasesCollectionProperties, throughput: 400); diff --git a/test/WebJobs.Script.Tests.Integration/CosmosDB/CosmosDBNodeEndToEndTests.cs b/test/WebJobs.Script.Tests.Integration/CosmosDB/CosmosDBNodeEndToEndTests.cs index 88fe57ea77..4925dfc02d 100644 --- a/test/WebJobs.Script.Tests.Integration/CosmosDB/CosmosDBNodeEndToEndTests.cs +++ b/test/WebJobs.Script.Tests.Integration/CosmosDB/CosmosDBNodeEndToEndTests.cs @@ -20,11 +20,11 @@ public Task CosmosDBTrigger() return CosmosDBTriggerToBlobTest(); } - //[Fact] - //public Task CosmosDB() - //{ - // return CosmosDBTest(); - //} + [Fact] + public Task CosmosDB() + { + return CosmosDBTest(); + } public class TestFixture : CosmosDBTestFixture {