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] Emulator: Fixes upgrades to internal emulator #4879

Merged
merged 20 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all 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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM c
WHERE STARTSWITH(c.statement, 'The quick brown fox jumps over the lazy dog', false)]]></Query>
</Input>
<Output>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"\/statement\/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"/statement/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
</Output>
</Result>
<Result>
Expand All @@ -18,7 +18,7 @@ FROM c
WHERE STARTSWITH(c['Η γρήγορη καφέ αλεπού πηδάει πάνω από το τεμπέλικο ÏƑκυλί'], 's', false)]]></Query>
</Input>
<Output>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"\/\"Η γρήγορη καφέ αλεπού πηδάει πάνω από το τεμπέλικο ÏƑκυλί\"\/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"/\"Η γρήγορη καφέ αλεπού πηδάει πάνω από το τεμπέλικο ÏƑκυλί\"/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
</Output>
</Result>
<Result>
Expand All @@ -27,7 +27,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αÎ
<Query><![CDATA[SELECT VALUE STARTSWITH(r['ı'], 's', false) FROM root r]]></Query>
</Input>
<Output>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"\/ı\/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
</Output>
</Result>
<Result>
Expand All @@ -36,7 +36,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αÎ
<Query><![CDATA[SELECT VALUE STARTSWITH(r['ZZZzzz'], 's', true) FROM root r]]></Query>
</Input>
<Output>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"\/ZZZzzz\/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"/ZZZzzz/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
</Output>
</Result>
<Result>
Expand All @@ -45,7 +45,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αÎ
<Query><![CDATA[SELECT VALUE STARTSWITH(r[' !"!@#$%^&*()<>?:"{}|ßÁŒÆ12ếàưỏốởặ'], 's', true) FROM root r]]></Query>
</Input>
<Output>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"\/\" !\\\"!@#$%^&*()<>?:\\\"{}|ßÁŒÆ12ếàưỏốởặ\"\/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"/\" !\\\"!@#$%^&*()<>?:\\\"{}|ßÁŒÆ12ếàưỏốởặ\"/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
</Output>
</Result>
<Result>
Expand All @@ -54,7 +54,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αÎ
<Query><![CDATA[SELECT VALUE STARTSWITH(r['Der schnelle Braunfuchs springt über den faulen Hund'], 's', true) FROM root r]]></Query>
</Input>
<Output>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"\/\"Der schnelle Braunfuchs springt über den faulen Hund\"\/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"/\"Der schnelle Braunfuchs springt über den faulen Hund\"/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
</Output>
</Result>
<Result>
Expand All @@ -63,7 +63,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αÎ
<Query><![CDATA[SELECT VALUE STARTSWITH(r['Η γρήγορη καφέ αλεπού πηδάει πάνω από το τεμπέλικο σκυλί'], 's', true) FROM root r]]></Query>
</Input>
<Output>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"\/\"Η γρήγορη καφέ αλεπού πηδάει πάνω από το τεμπέλικο σκυλί\"\/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"/\"Η γρήγορη καφέ αλεπού πηδάει πάνω από το τεμπέλικο σκυλί\"/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
</Output>
</Result>
<Result>
Expand All @@ -72,7 +72,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αÎ
<Query><![CDATA[SELECT VALUE STARTSWITH(r['الثعلب البني السريع يقفز فوق الكلب الكسول'], 's', true) FROM root r]]></Query>
</Input>
<Output>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"\/\"الثعلب البني السريع يقفز فوق الكلب الكسول\"\/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"/\"الثعلب البني السريع يقفز فوق الكلب الكسول\"/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
</Output>
</Result>
<Result>
Expand All @@ -81,7 +81,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αÎ
<Query><![CDATA[SELECT VALUE STARTSWITH(r['Быстрая коричневая лиса прыгает через ленивую собаку'], 's', true) FROM root r]]></Query>
</Input>
<Output>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"\/\"Быстрая коричневая лиса прыгает через ленивую собаку\"\/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"/\"Быстрая коричневая лиса прыгает через ленивую собаку\"/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
</Output>
</Result>
<Result>
Expand All @@ -90,7 +90,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αÎ
<Query><![CDATA[SELECT VALUE STARTSWITH(r['素早く茶色のキツネが怠惰な犬を飛び越えます'], 's', true) FROM root r]]></Query>
</Input>
<Output>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"\/素早く茶色のキツネが怠惰な犬を飛び越えます\/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"/素早く茶色のキツネが怠惰な犬を飛び越えます/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
</Output>
</Result>
<Result>
Expand All @@ -99,7 +99,7 @@ WHERE STARTSWITH(c['Η γρήγορη καφέ αÎ
<Query><![CDATA[SELECT VALUE STARTSWITH(r['तेज, भूरी लोमडी आलसी कुत्ते के उपर कूद गई'], 's', true) FROM root r]]></Query>
</Input>
<Output>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"\/\"तेज, भूरी लोमडी आलसी कुत्ते के उपर कूद गई\"\/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
<IndexMetric><![CDATA[{"UtilizedIndexes":{"SingleIndexes":[{"IndexSpec":"/\"तेज, भूरी लोमडी आलसी कुत्ते के उपर कूद गई\"/?"}],"CompositeIndexes":[]},"PotentialIndexes":{"SingleIndexes":[],"CompositeIndexes":[]}}]]></IndexMetric>
</Output>
</Result>
</Results>
Original file line number Diff line number Diff line change
Expand Up @@ -2349,7 +2349,7 @@ await containerInternal.PatchItemAsync<ToDoActivity>(
catch (CosmosException ex)
{
Assert.AreEqual(HttpStatusCode.BadRequest, ex.StatusCode);
Assert.IsTrue(ex.Message.Contains(@"For Operation(1): Add Operation can only create a child object of an existing node(array or object) and cannot create path recursively, no path found beyond: 'nonExistentParent'. Learn more: https:\/\/aka.ms\/cosmosdbpatchdocs"), ex.Message);
Assert.IsTrue(ex.Message.Contains(@"For Operation(1): Add Operation can only create a child object of an existing node(array or object) and cannot create path recursively, no path found beyond: 'nonExistentParent'. Learn more: https://aka.ms/cosmosdbpatchdocs"), ex.Message);
CosmosItemTests.ValidateCosmosException(ex);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ private void ValidateJsonSerializationFormatReadFeed(DocumentClient client, Docu
headers.Add(HttpConstants.HttpHeaders.ContentSerializationFormat, ContentSerializationFormat.CosmosBinary.ToString());
response = ReadDocumentFeedRequestAsync(client, collection.ResourceId, headers).Result;
Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, "Invalid status code");
Assert.IsTrue(response.ResponseBody.ReadByte() < HeadersValidationTests.BinarySerializationByteMarkValue);
//Assert.AreEqual(JsonSerializationFormat.Binary, response.ResponseBody.ReadByte());
Assert.AreEqual((int)JsonSerializationFormat.Binary, response.ResponseBody.ReadByte());
}

private void ValidateJsonSerializationFormatQuery(DocumentClient client, DocumentCollection collection)
Expand Down
6 changes: 3 additions & 3 deletions templates/emulator-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

steps:
- pwsh: |
Write-Host "Downloading Cosmos Emulator - $env:EMULATORMSIURL" -ForegroundColor green
Invoke-WebRequest "$env:EMULATORMSIURL" -OutFile "$env:temp\azure-cosmosdb-emulator.msi"
Write-Host "Downloading Cosmos Emulator - https://aka.ms/cosmosdbemulator-internal" -ForegroundColor green
Invoke-WebRequest https://aka.ms/cosmosdbemulator-internal -OutFile "$env:temp\azure-cosmosdb-emulator.msi"
Write-Host "Finished Downloading Cosmos Emulator - $env:temp\azure-cosmosdb-emulator.msi" -ForegroundColor green
dir "$env:temp"
Expand Down Expand Up @@ -39,7 +39,7 @@ steps:
for ($j=0; $j -lt 3; $j++) {
Write-Host "Attempt $j"
Start-Process "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" "/NoExplorer /NoUI /DisableRateLimiting /PartitionCount=10 /Consistency=Strong /EnablePreview /EnableSqlComputeEndpoint" -Verb RunAs
Start-Process "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" "/NoExplorer /NoUI /DisableRateLimiting /PartitionCount=10 /Consistency=Strong /EnablePreview /EnableSqlComputeEndpoint /overrides=enablePreviousImageForDeleteInFFCF:true;" -Verb RunAs
for ($i=0; $i -lt (3+2*$j); $i++) {
$status = Get-CosmosDbEmulatorStatus
Write-Host "Cosmos DB Emulator Status: $status"
Expand Down
Loading