From b04b9ee7aa55f63b48dc9cf58e04d36d366e6848 Mon Sep 17 00:00:00 2001 From: Kushagra Thapar Date: Tue, 20 Dec 2022 15:04:47 -0800 Subject: [PATCH] Updated compute gateway encoding test (#32663) * Updated compute gateway encoding test * Removed enableaad as it is on by default now --- .../templates/stages/cosmos-sdk-client.yml | 2 +- sdk/cosmos/azure-cosmos/docs/setup.md | 2 +- .../cosmos/CosmosItemIdEncodingTest.java | 42 +++++++++---------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/eng/pipelines/templates/stages/cosmos-sdk-client.yml b/eng/pipelines/templates/stages/cosmos-sdk-client.yml index 2f5db7b84a24d..54eaf6aad7767 100644 --- a/eng/pipelines/templates/stages/cosmos-sdk-client.yml +++ b/eng/pipelines/templates/stages/cosmos-sdk-client.yml @@ -80,7 +80,7 @@ stages: PreSteps: - template: /eng/common/pipelines/templates/steps/cosmos-emulator.yml parameters: - StartParameters: '/noexplorer /noui /enablepreview /EnableSqlComputeEndpoint /disableratelimiting /enableaadauthentication /partitioncount=50 /consistency=Strong' + StartParameters: '/noexplorer /noui /enablepreview /EnableSqlComputeEndpoint /disableratelimiting /partitioncount=50 /consistency=Strong' - powershell: | $Key = 'C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==' $password = ConvertTo-SecureString -String $Key -Force -AsPlainText diff --git a/sdk/cosmos/azure-cosmos/docs/setup.md b/sdk/cosmos/azure-cosmos/docs/setup.md index 97b998812948a..1596dea1f4966 100644 --- a/sdk/cosmos/azure-cosmos/docs/setup.md +++ b/sdk/cosmos/azure-cosmos/docs/setup.md @@ -92,7 +92,7 @@ Emulator Integration tests are with test group `emulator`, labeled in the code a Latest version of Azure Cosmos DB Emulator can be downloaded and installed from [here](https://learn.microsoft.com/azure/cosmos-db/local-emulator) Our CI pipelines start Azure Cosmos DB Emulator with these parameters. It is highly recommended to use these for local development and testing. ```shell -/enablepreview /EnableSqlComputeEndpoint /disableratelimiting /enableaadauthentication /partitioncount=50 /consistency=Strong +/enablepreview /EnableSqlComputeEndpoint /disableratelimiting /partitioncount=50 /consistency=Strong ``` Other test groups are meant to be tested against Azure Cosmos DB production account, but can also be tested against Emulator. There are multiple different test groups like `groups = {"simple", "long", "direct", "multi-region", "multi-master"}`. For example, `CosmosItemTest` is a simple group test which can be run against Azure Cosmos DB production account, as well as against emulator. diff --git a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosItemIdEncodingTest.java b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosItemIdEncodingTest.java index 4006e4e16dfaf..8a9634c2b51df 100644 --- a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosItemIdEncodingTest.java +++ b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosItemIdEncodingTest.java @@ -44,7 +44,7 @@ public CosmosItemIdEncodingTest(CosmosClientBuilder clientBuilder) { super(clientBuilder.contentResponseOnWriteEnabled(true)); } - @BeforeClass(groups = {"simple"}, timeOut = SETUP_TIMEOUT) + @BeforeClass(groups = {"simple", "emulator"}, timeOut = SETUP_TIMEOUT) public void before_CosmosItemTest() { assertThat(this.client).isNull(); this.client = getClientBuilder().buildClient(); @@ -52,13 +52,13 @@ public void before_CosmosItemTest() { container = client.getDatabase(asyncContainer.getDatabase().getId()).getContainer(asyncContainer.getId()); } - @AfterClass(groups = {"simple"}, timeOut = SHUTDOWN_TIMEOUT, alwaysRun = true) + @AfterClass(groups = {"simple", "emulator"}, timeOut = SHUTDOWN_TIMEOUT, alwaysRun = true) public void afterClass() { assertThat(this.client).isNotNull(); this.client.close(); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void plainVanillaId() { TestScenario scenario = new TestScenario( "PlainVanillaId", @@ -85,7 +85,7 @@ public void plainVanillaId() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void containerIdWithUnicodeCharacter() { TestScenario scenario = new TestScenario( "ContainerIdWithUnicodeé±€", @@ -112,7 +112,7 @@ public void containerIdWithUnicodeCharacter() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idWithWhitespaces() { TestScenario scenario = new TestScenario( "IdWithWhitespaces", @@ -139,7 +139,7 @@ public void idWithWhitespaces() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idStartingWithWhitespace() { TestScenario scenario = new TestScenario( "IdStartingWithWhitespace", @@ -166,7 +166,7 @@ public void idStartingWithWhitespace() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idStartingWithWhitespaces() { TestScenario scenario = new TestScenario( "IdStartingWithWhitespaces", @@ -193,7 +193,7 @@ public void idStartingWithWhitespaces() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idEndingWithWhitespace() { TestScenario scenario = new TestScenario( "IdEndingWithWhitespace", @@ -220,7 +220,7 @@ public void idEndingWithWhitespace() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idEndingWithWhitespaces() { TestScenario scenario = new TestScenario( "IdEndingWithWhitespaces", @@ -247,7 +247,7 @@ public void idEndingWithWhitespaces() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idWithUnicodeCharacters() { TestScenario scenario = new TestScenario( "IdWithUnicodeCharacters", @@ -274,7 +274,7 @@ public void idWithUnicodeCharacters() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idWithAllowedSpecialCharacters() { TestScenario scenario = new TestScenario( "IdWithAllowedSpecialCharacters", @@ -301,7 +301,7 @@ public void idWithAllowedSpecialCharacters() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idWithBase64EncodedIdCharacters() { String base64EncodedId = "BQE1D3PdG4N4bzU9TKaCIM3qc0TVcZ2/Y3jnsRfwdHC1ombkX3F1dot/SG0/UTq9AbgdX3kOWoP6qL6lJqWeKgV3zwWWPZO/t5X0ehJzv9LGkWld07LID2rhWhGT6huBM6Q="; String safeBase64EncodedId = base64EncodedId.replace("/", "-"); @@ -331,7 +331,7 @@ public void idWithBase64EncodedIdCharacters() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idEndingWithPercentEncodedWhitespace() { TestScenario scenario = new TestScenario( "IdEndingWithPercentEncodedWhitespace", @@ -358,7 +358,7 @@ public void idEndingWithPercentEncodedWhitespace() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idWithPercentEncodedSpecialChar() { TestScenario scenario = new TestScenario( "IdWithPercentEncodedSpecialChar", @@ -385,7 +385,7 @@ public void idWithPercentEncodedSpecialChar() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idWithDisallowedCharQuestionMark() { TestScenario scenario = new TestScenario( "IdWithDisallowedCharQuestionMark", @@ -413,7 +413,7 @@ public void idWithDisallowedCharQuestionMark() { } @Ignore("Throws IllegalArgumentException instead of CosmosException") - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idWithDisallowedCharForwardSlash() { TestScenario scenario = new TestScenario( "IdWithDisallowedCharForwardSlash", @@ -440,7 +440,7 @@ public void idWithDisallowedCharForwardSlash() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idWithDisallowedCharBackSlash() { TestScenario scenario = new TestScenario( "IdWithDisallowedCharBackSlash", @@ -467,7 +467,7 @@ public void idWithDisallowedCharBackSlash() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idWithDisallowedCharPoundSign() { TestScenario scenario = new TestScenario( "IdWithDisallowedCharPoundSign", @@ -494,7 +494,7 @@ public void idWithDisallowedCharPoundSign() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idWithCarriageReturn() { TestScenario scenario = new TestScenario( "IdWithCarriageReturn", @@ -521,7 +521,7 @@ public void idWithCarriageReturn() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idWithTab() { TestScenario scenario = new TestScenario( "IdWithTab", @@ -548,7 +548,7 @@ public void idWithTab() { this.executeTestCase(scenario); } - @Test(groups = { "simple" }, timeOut = TIMEOUT) + @Test(groups = { "simple", "emulator" }, timeOut = TIMEOUT) public void idWithLineFeed() { TestScenario scenario = new TestScenario( "IdWithLineFeed",