From 9f5c9b2fd43c2f9f74c4f79d386ae00600dd1bf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Mon, 27 Mar 2023 11:00:31 +0200 Subject: [PATCH] Improved setup.md instructions based on my setup experience. (#34211) --- sdk/cosmos/azure-cosmos/docs/setup.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sdk/cosmos/azure-cosmos/docs/setup.md b/sdk/cosmos/azure-cosmos/docs/setup.md index 1596dea1f4966..66392b6c6b3be 100644 --- a/sdk/cosmos/azure-cosmos/docs/setup.md +++ b/sdk/cosmos/azure-cosmos/docs/setup.md @@ -79,10 +79,27 @@ Set target bytecode version for the project azure-cosmos in IntelliJ Preferences Setup Azure Cosmos DB Emulator by following [this instruction](https://docs.microsoft.com/azure/cosmos-db/local-emulator). Then please export the emulator's SSL certificates and install them in the JVM trust stores on your development machine following [this instruction](https://learn.microsoft.com/azure/cosmos-db/local-emulator-export-ssl-certificates). +For running the SDK unit tests use follogwing start options for the emulator: +PS C:\Program Files\Azure Cosmos DB Emulator> .\CosmosDB.Emulator.exe /enablepreview /EnableSqlComputeEndpoint /disableratelimiting /partitioncount=50 /consistency=Strong + +For installing the keys on windows following power shell script (running as administrator) can be used: +``` +Push-Location -Path $env:JAVA_HOME + +gci -recurse cert:\LocalMachine\My | ? FriendlyName -eq DocumentDbEmulatorCertificate | Export-Certificate -Type cer -FilePath cosmos_emulator.cer +keytool -cacerts -delete -alias cosmos_emulator -storepass changeit +keytool -cacerts -importcert -alias cosmos_emulator -storepass changeit -file cosmos_emulator.cer +del cosmos_emulator.cer + +Pop-Location +``` + ### Running Unit Tests Unit tests are tests with group "unit" and can be run from IntelliJ directly without needing any Azure Cosmos DB Account or Emulator support. To run them, right click on any unit test class and run them. To test this, run `ClientConfigDiagnosticsTest` from IntelliJ IDE directly. +Note: When running the Azure Cosmos DB Emulator in a virtual machine you may receive timeouts. If that happens increase the number of cores and improve the I/O performance of the VM. + ### Running Integration Tests Azure Cosmos Java SDK has different Integration tests which can be run with Azure Cosmos Emulator or Azure Cosmos DB production Account.