Skip to content

Commit

Permalink
Updated compute gateway encoding test (Azure#32663)
Browse files Browse the repository at this point in the history
* Updated compute gateway encoding test

* Removed enableaad as it is on by default now
  • Loading branch information
kushagraThapar authored Dec 20, 2022
1 parent 527b28b commit b04b9ee
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion eng/pipelines/templates/stages/cosmos-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sdk/cosmos/azure-cosmos/docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@ 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();
CosmosAsyncContainer asyncContainer = getSharedMultiPartitionCosmosContainer(this.client.asyncClient());
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",
Expand All @@ -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鱀",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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("/", "-");
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit b04b9ee

Please sign in to comment.