-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Update cosmos emulator tests to include vnext #47605
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
base: main
Are you sure you want to change the base?
Update cosmos emulator tests to include vnext #47605
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates Cosmos emulator tests to include vnext emulator support by introducing configurable connection modes (Direct/Gateway) and enabling previously ignored vector and full-text index tests. The changes consolidate test execution across emulator variants through new data provider patterns.
Key changes:
- Adds
CONNECTION_MODESconfiguration to support parameterized testing with Direct and Gateway connection modes - Enables Vector and FullText index tests by removing
@Ignoreannotations - Introduces new
emulatorClientBuildersdata providers to replace various test-specific data providers
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/TestConfigurations.java |
Adds CONNECTION_MODES configuration property for test parameterization |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java |
Removes @ignore annotation, adds Factory with emulatorClientBuilders, and uses injected client builder |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java |
Adds connectionModes field, parseConnectionModes method, and new emulatorClientBuilders data providers; removes simpleClientBuildersWithoutRetryOnThrottledRequests |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/FullTextIndexTest.java |
Removes @ignore annotation, adds Factory with emulatorClientBuilders, and uses injected client builder |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/FullFidelityChangeFeedTest.java |
Updates data provider from simpleClientBuildersWithDirectTcp to emulatorClientBuilders |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/DocumentCrudTest.java |
Updates data provider from clientBuildersWithDirect to emulatorClientBuilders |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/DocumentClientResourceLeakTest.java |
Updates data provider from simpleClientBuildersWithDirect to emulatorClientBuilders |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/CollectionCrudTest.java |
Updates data provider from clientBuildersWithDirect to emulatorClientBuilders |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/throughputControl/sdk/ThroughputControlGroupConfigConfigurationTests.java |
Updates data provider from clientBuildersWithSessionConsistency to emulatorClientBuilders |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/TestSuiteBase.java |
Adds connectionModes field, parseConnectionModes method, and emulatorClientBuilders data providers; removes unused ITestContext import |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/MetadataThrottlingRetryPolicyTest.java |
Updates data provider from simpleClientBuildersWithoutRetryOnThrottledRequests to emulatorClientBuildersWithoutRetryOnThrottledRequests |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/MalformedResponseTests.java |
Updates data provider from clientBuildersWithSessionConsistency to emulatorClientBuilders |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/EmulatorVNextWithHttpTest.java |
Updates data provider and adds "emulator" group to BeforeClass, AfterClass, and Test annotations |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/DistributedClientTest.java |
Updates data provider from clientBuildersWithDirect to emulatorClientBuilders |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/CosmosItemWriteRetriesTest.java |
Updates data provider from clientBuildersWithDirectTcpSession to emulatorClientBuilders |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/CosmosItemContentResponseOnWriteTest.java |
Updates data provider and changes test group from "fast" to "emulator" |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/CosmosDiagnosticsE2ETest.java |
Updates data provider from clientBuildersWithDirectSession to emulatorClientBuilders |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/CosmosDatabaseContentResponseOnWriteTest.java |
Updates data provider from clientBuildersWithDirectTcpWithContentResponseOnWriteDisabled to emulatorClientBuildersContentResponseOnWriteEnabledFalse |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/CosmosContainerContentResponseOnWriteTest.java |
Updates data provider from clientBuildersWithDirectTcpWithContentResponseOnWriteDisabled to emulatorClientBuildersContentResponseOnWriteEnabledFalse |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/CosmosContainerChangeFeedTest.java |
Updates data provider from simpleClientBuildersWithDirect to emulatorClientBuilders |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/ChangeFeedContinuationTokenUtilsTests.java |
Updates data provider from simpleClientBuildersWithDirect to emulatorClientBuilders |
eng/pipelines/templates/stages/cosmos-emulator-vnext-matrix.json |
Changes ProfileFlag from "-Pemulator-vnext" to "-Pemulator" to run vnext tests with standard emulator profile |
eng/pipelines/templates/stages/cosmos-emulator-matrix.json |
Adds CONNECTION_MODES configuration to enable both Direct and Gateway mode testing |
Comments suppressed due to low confidence (1)
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java:1320
- The data provider
simpleClientBuildersWithoutRetryOnThrottledRequestsis being removed fromrx/TestSuiteBase.java, but it is still being used byThroughputControlTests.javain theimplementation/throughputControlpackage. This will cause test compilation or runtime failures. The test should be updated to useemulatorClientBuildersWithoutRetryOnThrottledRequestsinstead.
@DataProvider
public static Object[][] simpleGatewayClient() {
return new Object[][] {
{ createGatewayRxDocumentClient(ConsistencyLevel.SESSION, false, null, true, true) }
};
}
private static Object[][] simpleClientBuildersWithDirect(
| import org.testng.annotations.AfterClass; | ||
| import org.testng.annotations.BeforeClass; | ||
| import org.testng.annotations.Factory; | ||
| import org.testng.annotations.Ignore; |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import for org.testng.annotations.Ignore is no longer needed since the @ignore annotation has been removed from the class. This unused import should be removed to keep the code clean.
| import org.testng.annotations.Ignore; |
| import org.testng.annotations.AfterClass; | ||
| import org.testng.annotations.BeforeClass; | ||
| import org.testng.annotations.Factory; | ||
| import org.testng.annotations.Ignore; |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import for org.testng.annotations.Ignore is no longer needed since the @ignore annotation has been removed from the class. This unused import should be removed to keep the code clean.
| import org.testng.annotations.Ignore; |
|
/azp run java - cosmos |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run java - cosmos |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This pull request updates the Cosmos DB Java SDK emulator test infrastructure to standardize and expand test coverage across different connection modes and test configurations. The main changes involve switching test data providers to new, more comprehensive variants and updating pipeline matrix templates to support both Direct and Gateway connection modes. Additionally, test group annotations are aligned to better reflect the intended test environments.
Test Data Provider Standardization and Expansion:
emulatorClientBuildersor related data providers, replacing older, more specific ones (e.g.,clientBuildersWithDirect,clientBuildersWithDirectTcpSession, etc.), ensuring tests run with a broader and more consistent set of emulator configurations. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Test Group and Annotation Adjustments:
"fast"to"emulator"inCosmosItemContentResponseOnWriteTestand added"emulator"toEmulatorVNextWithHttpTestto clarify test intent and environment, and ensure correct test execution grouping. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Pipeline Matrix Enhancements:
DirectandGatewayconnection modes in the Cosmos emulator integration test matrix templates, broadening test coverage across connection types.ProfileFlagin the vNext emulator matrix to use-Pemulatorfor consistency.Test Suite Base Improvements:
connectionModesfield inTestSuiteBase, defaulting toGatewayif unspecified, and updated initialization logic to parse connection modes from configuration, improving flexibility and backward compatibility. [1] [2] [3]These changes collectively ensure more robust, flexible, and consistent emulator-based test coverage for the Cosmos DB Java SDK.Introduces new emulatorClientBuilders data providers to replace various test-specific data providers