From 6568e6ea7d808f7e95f18926459a58db3cc44421 Mon Sep 17 00:00:00 2001 From: Kushagra Thapar Date: Tue, 3 Mar 2026 08:41:24 -0800 Subject: [PATCH 1/8] Optimize Cosmos CI: reduce PR matrix, increase parallelism, skip shade MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. PR-conditional emulator matrix (16 → 11 jobs): Drops redundant JDK variants for Spark/Kafka in PR builds. Full matrix on main merges. Dropped for PRs (5 jobs, ~5 agent hours saved): - Spark 3.3 Java 11 (keeping Java 8) - Spark 3.4 Java 8 (keeping Java 11) - Spark 3.5/Scala 2.12 Java 8 (keeping Java 17) - Spark 4.0/Scala 2.13 Java 17 (keeping Java 21) - Kafka Java 11 (keeping Java 17) 2. Increase BuildParallelization from 1 to 2 in all stages (Build, TestEmulator, TestVNextEmulator). 3. Skip maven-shade-plugin for non-Spark/non-Kafka emulator jobs: Core emulator, long emulator, and encryption jobs don't need Spark/Kafka uber JARs. Adding -Dshade.skip=true saves ~90s of shade plugin execution per Spark module × 5 modules = ~7-8 min per non-Spark job (5 jobs × 7 min = ~35 min agent time saved). 4. Remove outdated comment about emulator download time. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../stages/cosmos-emulator-matrix-pr.json | 104 ++++++++++++++++++ .../stages/cosmos-emulator-matrix.json | 48 +++++--- .../templates/stages/cosmos-sdk-client.yml | 15 ++- 3 files changed, 145 insertions(+), 22 deletions(-) create mode 100644 eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json new file mode 100644 index 000000000000..ac2d8fc8a270 --- /dev/null +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json @@ -0,0 +1,104 @@ +{ + "displayNames": { + "clean verify": "" + }, + "matrix": { + "Agent": { + "windows-2022": { + "OSVmImage": "env:WINDOWSVMIMAGE", + "Pool": "env:WINDOWSPOOL" + } + }, + "TestGoals": "clean verify", + "EmulatorConfig": { + "Emulator Only Integration Tests Tcp - Java 8": { + "ProfileFlag": "-Pemulator", + "PROTOCOLS": "[\"Tcp\"]", + "DESIRED_CONSISTENCIES": "[\"Session\"]", + "JavaTestVersion": "1.8", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "-Dshade.skip=true" + }, + "Emulator Only Integration Tests Tcp - Java 17": { + "ProfileFlag": "-Pemulator", + "PROTOCOLS": "[\"Tcp\"]", + "DESIRED_CONSISTENCIES": "[\"Strong\"]", + "JavaTestVersion": "1.17", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "-Dshade.skip=true" + }, + "Long Emulator Only Integration Tests Tcp - Java 8": { + "ProfileFlag": "-Plong-emulator", + "PROTOCOLS": "[\"Tcp\"]", + "DESIRED_CONSISTENCIES": "[\"Session\"]", + "JavaTestVersion": "1.8", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "-Dshade.skip=true" + }, + "Long Emulator Only Integration Tests Tcp - Java 17": { + "ProfileFlag": "-Plong-emulator", + "PROTOCOLS": "[\"Tcp\"]", + "DESIRED_CONSISTENCIES": "[\"Strong\"]", + "JavaTestVersion": "1.17", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "-Dshade.skip=true" + }, + "Encryption Emulator Only Integration Tests": { + "ProfileFlag": "-Pencryption-integration", + "PROTOCOLS": "[\"Tcp\"]", + "DESIRED_CONSISTENCIES": "[\"Session\"]", + "JavaTestVersion": "1.8", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "-Dshade.skip=true" + }, + "Spark 3.3 Integration Tests targeting Cosmos Emulator - Java 8'": { + "ProfileFlag": "-Dspark-e2e_3-3", + "PROTOCOLS": "[\"Tcp\"]", + "DESIRED_CONSISTENCIES": "[\"Session\"]", + "JavaTestVersion": "1.8", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" + }, + "Spark 3.4 Integration Tests targeting Cosmos Emulator - Java 11'": { + "ProfileFlag": "-Dspark-e2e_3-4", + "PROTOCOLS": "[\"Tcp\"]", + "DESIRED_CONSISTENCIES": "[\"Session\"]", + "JavaTestVersion": "1.11", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" + }, + "Spark 3.5, Scala 2.12 Integration Tests targeting Cosmos Emulator - Java 17'": { + "ProfileFlag": "-Dspark-e2e_3-5_2-12", + "PROTOCOLS": "[\"Tcp\"]", + "DESIRED_CONSISTENCIES": "[\"Session\"]", + "JavaTestVersion": "1.17", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" + }, + "Spark 3.5, Scala 2.13 Integration Tests targeting Cosmos Emulator - Java 17'": { + "ProfileFlag": "-Dspark-e2e_3-5_2-13", + "PROTOCOLS": "[\"Tcp\"]", + "DESIRED_CONSISTENCIES": "[\"Session\"]", + "JavaTestVersion": "1.17", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" + }, + "Spark 4.0, Scala 2.13 Integration Tests targeting Cosmos Emulator - Java 21'": { + "ProfileFlag": "-Dspark-e2e_4-0_2-13", + "PROTOCOLS": "[\"Tcp\"]", + "DESIRED_CONSISTENCIES": "[\"Session\"]", + "JavaTestVersion": "1.21", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" + }, + "Kafka Integration Tests targeting Cosmos Emulator - Java 17": { + "ProfileFlag": "-Pkafka-emulator", + "PROTOCOLS": "[\"Tcp\"]", + "DESIRED_CONSISTENCIES": "[\"Session\"]", + "JavaTestVersion": "1.17", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" + } + } + } +} diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json index 2823975d5ea8..0320151a8715 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json @@ -13,112 +13,128 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "-Dshade.skip=true" }, "Emulator Only Integration Tests Tcp - Java 17": { "ProfileFlag": "-Pemulator", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Strong\"]", "JavaTestVersion": "1.17", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "-Dshade.skip=true" }, "Long Emulator Only Integration Tests Tcp - Java 8": { "ProfileFlag": "-Plong-emulator", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "-Dshade.skip=true" }, "Long Emulator Only Integration Tests Tcp - Java 17": { "ProfileFlag": "-Plong-emulator", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Strong\"]", "JavaTestVersion": "1.17", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "-Dshade.skip=true" }, "Encryption Emulator Only Integration Tests": { "ProfileFlag": "-Pencryption-integration", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "-Dshade.skip=true" }, "Spark 3.3 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-3", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" }, "Spark 3.3 Integration Tests targeting Cosmos Emulator - Java 11'": { "ProfileFlag": "-Dspark-e2e_3-3", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" }, "Spark 3.4 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-4", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" }, "Spark 3.4 Integration Tests targeting Cosmos Emulator - Java 11'": { "ProfileFlag": "-Dspark-e2e_3-4", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" }, "Spark 3.5, Scala 2.12 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-5_2-12", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" }, "Spark 3.5, Scala 2.12 Integration Tests targeting Cosmos Emulator - Java 17'": { "ProfileFlag": "-Dspark-e2e_3-5_2-12", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.17", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" }, "Spark 3.5, Scala 2.13 Integration Tests targeting Cosmos Emulator - Java 17'": { "ProfileFlag": "-Dspark-e2e_3-5_2-13", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.17", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" }, "Spark 4.0, Scala 2.13 Integration Tests targeting Cosmos Emulator - Java 17'": { "ProfileFlag": "-Dspark-e2e_4-0_2-13", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.17", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" }, "Spark 4.0, Scala 2.13 Integration Tests targeting Cosmos Emulator - Java 21'": { "ProfileFlag": "-Dspark-e2e_4-0_2-13", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.21", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" }, "Kafka Integration Tests targeting Cosmos Emulator - Java 11": { "ProfileFlag": "-Pkafka-emulator", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" }, "Kafka Integration Tests targeting Cosmos Emulator - Java 17": { "ProfileFlag": "-Pkafka-emulator", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.17", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "" } } } diff --git a/eng/pipelines/templates/stages/cosmos-sdk-client.yml b/eng/pipelines/templates/stages/cosmos-sdk-client.yml index 9d2977f14107..3fa48b3363fc 100644 --- a/eng/pipelines/templates/stages/cosmos-sdk-client.yml +++ b/eng/pipelines/templates/stages/cosmos-sdk-client.yml @@ -61,7 +61,7 @@ extends: MatrixReplace: - AZURE_TEST.*=.*/ - .*Version=1.2(1|5)/1.17 - BuildParallelization: 1 + BuildParallelization: 2 TestOptions: '-Punit' - stage: TestEmulator @@ -80,18 +80,21 @@ extends: JobTemplatePath: /eng/pipelines/templates/jobs/live.tests.yml MatrixConfigs: - Name: Cosmos_emulator_integration - Path: eng/pipelines/templates/stages/cosmos-emulator-matrix.json + # Use reduced matrix for PRs (11 jobs) vs full matrix for CI/main (16 jobs) + ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + Path: eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json + ${{ else }}: + Path: eng/pipelines/templates/stages/cosmos-emulator-matrix.json Selection: all GenerateVMJobs: true MatrixFilters: - ${{ parameters.LanguageFilter }} - ${{ parameters.MatrixFilters }} AdditionalParameters: - BuildParallelization: 1 + BuildParallelization: 2 + BuildOptions: '$(BuildOptions)' DisableAzureResourceCreation: true ServiceDirectory: cosmos - # Increased timeout to 120 because of cosmos emulator taking 25-30 mins to download emulator - # Issue filed to improve download speed: https://github.com/Azure/azure-sdk-for-java/issues/12970 TimeoutInMinutes: 120 TestOptions: '$(ProfileFlag) $(AdditionalArgs)' PreSteps: @@ -179,7 +182,7 @@ extends: - ${{ parameters.LanguageFilter }} - ${{ parameters.MatrixFilters }} AdditionalParameters: - BuildParallelization: 1 + BuildParallelization: 2 DisableAzureResourceCreation: true ServiceDirectory: cosmos TimeoutInMinutes: 120 From 76fdc89ae8e96776b06a82d38415d4cdf44b27db Mon Sep 17 00:00:00 2001 From: Kushagra Thapar Date: Tue, 3 Mar 2026 10:42:22 -0800 Subject: [PATCH 2/8] Fix: also skip maven-antrun-plugin when shade is skipped The antrun 03-repack phase expects shade output (native .jnilib/.so files in target/tmp/). When -Dshade.skip=true, the shade output doesn't exist and antrun fails with 'Could not find file'. Add -Dmaven.antrun.skip=true alongside -Dshade.skip=true. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../stages/cosmos-emulator-matrix-pr.json | 10 ++--- .../stages/cosmos-emulator-matrix.json | 45 ++++++++++--------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json index ac2d8fc8a270..13f8bb042669 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json @@ -17,7 +17,7 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "-Dshade.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Emulator Only Integration Tests Tcp - Java 17": { "ProfileFlag": "-Pemulator", @@ -25,7 +25,7 @@ "DESIRED_CONSISTENCIES": "[\"Strong\"]", "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "-Dshade.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Long Emulator Only Integration Tests Tcp - Java 8": { "ProfileFlag": "-Plong-emulator", @@ -33,7 +33,7 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "-Dshade.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Long Emulator Only Integration Tests Tcp - Java 17": { "ProfileFlag": "-Plong-emulator", @@ -41,7 +41,7 @@ "DESIRED_CONSISTENCIES": "[\"Strong\"]", "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "-Dshade.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Encryption Emulator Only Integration Tests": { "ProfileFlag": "-Pencryption-integration", @@ -49,7 +49,7 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "-Dshade.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Spark 3.3 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-3", diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json index 0320151a8715..3734d6b8dfc2 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json @@ -4,17 +4,20 @@ }, "matrix": { "Agent": { - "windows-2022": { "OSVmImage": "env:WINDOWSVMIMAGE", "Pool": "env:WINDOWSPOOL" } + "windows-2022": { + "OSVmImage": "env:WINDOWSVMIMAGE", + "Pool": "env:WINDOWSPOOL" + } }, "TestGoals": "clean verify", "EmulatorConfig": { "Emulator Only Integration Tests Tcp - Java 8": { - "ProfileFlag": "-Pemulator", - "PROTOCOLS": "[\"Tcp\"]", - "DESIRED_CONSISTENCIES": "[\"Session\"]", - "JavaTestVersion": "1.8", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "-Dshade.skip=true" + "ProfileFlag": "-Pemulator", + "PROTOCOLS": "[\"Tcp\"]", + "DESIRED_CONSISTENCIES": "[\"Session\"]", + "JavaTestVersion": "1.8", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Emulator Only Integration Tests Tcp - Java 17": { "ProfileFlag": "-Pemulator", @@ -22,15 +25,15 @@ "DESIRED_CONSISTENCIES": "[\"Strong\"]", "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "-Dshade.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Long Emulator Only Integration Tests Tcp - Java 8": { - "ProfileFlag": "-Plong-emulator", - "PROTOCOLS": "[\"Tcp\"]", - "DESIRED_CONSISTENCIES": "[\"Session\"]", - "JavaTestVersion": "1.8", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "-Dshade.skip=true" + "ProfileFlag": "-Plong-emulator", + "PROTOCOLS": "[\"Tcp\"]", + "DESIRED_CONSISTENCIES": "[\"Session\"]", + "JavaTestVersion": "1.8", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Long Emulator Only Integration Tests Tcp - Java 17": { "ProfileFlag": "-Plong-emulator", @@ -38,15 +41,15 @@ "DESIRED_CONSISTENCIES": "[\"Strong\"]", "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "-Dshade.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Encryption Emulator Only Integration Tests": { - "ProfileFlag": "-Pencryption-integration", - "PROTOCOLS": "[\"Tcp\"]", - "DESIRED_CONSISTENCIES": "[\"Session\"]", - "JavaTestVersion": "1.8", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "-Dshade.skip=true" + "ProfileFlag": "-Pencryption-integration", + "PROTOCOLS": "[\"Tcp\"]", + "DESIRED_CONSISTENCIES": "[\"Session\"]", + "JavaTestVersion": "1.8", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Spark 3.3 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-3", From 2ff45a58564c1b503360b90b05d8022dceae882e Mon Sep 17 00:00:00 2001 From: Kushagra Thapar Date: Tue, 3 Mar 2026 13:11:09 -0800 Subject: [PATCH 3/8] Fix: pass shade.skip to both build AND test steps via AdditionalArgs The test step runs 'clean verify' which recompiles everything from scratch, including Spark shade. Our BuildOptions only affected the build step. Add -Dshade.skip=true -Dmaven.antrun.skip=true to AdditionalArgs for non-Spark jobs so it flows into TestOptions too. Keep BuildOptions for the build step as well (both steps need it). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../templates/stages/cosmos-emulator-matrix-pr.json | 10 +++++----- .../templates/stages/cosmos-emulator-matrix.json | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json index 13f8bb042669..87e69709acba 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json @@ -16,7 +16,7 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Emulator Only Integration Tests Tcp - Java 17": { @@ -24,7 +24,7 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Strong\"]", "JavaTestVersion": "1.17", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Long Emulator Only Integration Tests Tcp - Java 8": { @@ -32,7 +32,7 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Long Emulator Only Integration Tests Tcp - Java 17": { @@ -40,7 +40,7 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Strong\"]", "JavaTestVersion": "1.17", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Encryption Emulator Only Integration Tests": { @@ -48,7 +48,7 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Spark 3.3 Integration Tests targeting Cosmos Emulator - Java 8'": { diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json index 3734d6b8dfc2..9988cac76429 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json @@ -16,7 +16,7 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Emulator Only Integration Tests Tcp - Java 17": { @@ -24,7 +24,7 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Strong\"]", "JavaTestVersion": "1.17", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Long Emulator Only Integration Tests Tcp - Java 8": { @@ -32,7 +32,7 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Long Emulator Only Integration Tests Tcp - Java 17": { @@ -40,7 +40,7 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Strong\"]", "JavaTestVersion": "1.17", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Encryption Emulator Only Integration Tests": { @@ -48,7 +48,7 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" }, "Spark 3.3 Integration Tests targeting Cosmos Emulator - Java 8'": { From a12d2b3ecf5b03dcab727345267e65897ab2eb7b Mon Sep 17 00:00:00 2001 From: Kushagra Thapar Date: Tue, 3 Mar 2026 14:42:50 -0800 Subject: [PATCH 4/8] Add BuildOptions plumbing to skip shade in Build stage unit test jobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add BuildOptions parameter through ci.yml → ci.tests.yml → build-and-test.yml pipeline chain. Defaults to empty string (no behavior change for other SDKs). Cosmos Build stage sets BuildOptions to '-Dshade.skip=true -Dmaven.antrun.skip=true' to skip Spark/Kafka uber JAR creation during unit test matrix jobs, saving ~14 min per job. The release artifact deploy step is unaffected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/templates/jobs/ci.tests.yml | 4 ++++ eng/pipelines/templates/jobs/ci.yml | 4 ++++ eng/pipelines/templates/stages/cosmos-sdk-client.yml | 1 + 3 files changed, 9 insertions(+) diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index 82d12ff45fdf..cdfac6273e60 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -40,6 +40,9 @@ parameters: - name: BuildParallelization type: string default: '2C' + - name: BuildOptions + type: string + default: '' - name: AdditionalLintingOptions type: string default: '' @@ -145,6 +148,7 @@ jobs: TestOptions: ${{ parameters.TestOptions }} TestParallelization: ${{ parameters.TestParallelization }} BuildParallelization: ${{ parameters.BuildParallelization }} + BuildOptions: ${{ parameters.BuildOptions }} TestEnvVars: ${{ parameters.EnvVars }} VersionOverride: ${{ parameters.VersionOverride }} diff --git a/eng/pipelines/templates/jobs/ci.yml b/eng/pipelines/templates/jobs/ci.yml index 703c81308c01..95233db735c1 100644 --- a/eng/pipelines/templates/jobs/ci.yml +++ b/eng/pipelines/templates/jobs/ci.yml @@ -40,6 +40,9 @@ parameters: - name: BuildParallelization type: string default: '2C' + - name: BuildOptions + type: string + default: '' - name: TestGoals type: string default: $(TestGoals) @@ -503,6 +506,7 @@ jobs: TestOptions: ${{ parameters.TestOptions }} TestParallelization: ${{ parameters.TestParallelization }} BuildParallelization: ${{ parameters.BuildParallelization }} + BuildOptions: ${{ parameters.BuildOptions }} AdditionalLintingOptions: ${{ parameters.AdditionalLintingOptions }} TimeoutInMinutes: ${{ parameters.TimeoutInMinutes }} EnvVars: ${{ parameters.EnvVars }} diff --git a/eng/pipelines/templates/stages/cosmos-sdk-client.yml b/eng/pipelines/templates/stages/cosmos-sdk-client.yml index 3fa48b3363fc..ea9b86583e14 100644 --- a/eng/pipelines/templates/stages/cosmos-sdk-client.yml +++ b/eng/pipelines/templates/stages/cosmos-sdk-client.yml @@ -62,6 +62,7 @@ extends: - AZURE_TEST.*=.*/ - .*Version=1.2(1|5)/1.17 BuildParallelization: 2 + BuildOptions: '-Dshade.skip=true -Dmaven.antrun.skip=true' TestOptions: '-Punit' - stage: TestEmulator From 98890f8dc157f82bcb9cb4c0db13c63b704345b7 Mon Sep 17 00:00:00 2001 From: Kushagra Thapar Date: Wed, 4 Mar 2026 07:31:56 -0800 Subject: [PATCH 5/8] Add per-job ProjectListOverride for Spark/Kafka emulator jobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each Spark emulator job previously compiled ALL 14 modules including other Spark versions it doesn't test, wasting ~11 min per job on unnecessary shade+compile. Changes: - generate-project-list.ps1: Check for ProjectListOverride env var at the top. If set, use it directly and skip normal computation. Defaults to empty (no behavior change for other SDKs). - Emulator matrix JSONs: Add ProjectListOverride for each Spark and Kafka job with only the modules they need (core + their specific Spark/Kafka module). Example: Spark 3.5/2.13 job previously built 14 modules (41 min test step). Now builds only 6 modules, saving ~11 min per Spark job. Estimated savings: ~11 min × 9 Spark jobs + ~5 min × 2 Kafka jobs = ~109 min agent time per full CI run. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../scripts/generate-project-list.ps1 | 16 +++++++++ .../stages/cosmos-emulator-matrix-pr.json | 18 ++++++---- .../stages/cosmos-emulator-matrix.json | 33 ++++++++++++------- 3 files changed, 50 insertions(+), 17 deletions(-) diff --git a/eng/pipelines/scripts/generate-project-list.ps1 b/eng/pipelines/scripts/generate-project-list.ps1 index a4432a8b3977..60e00fe65af4 100644 --- a/eng/pipelines/scripts/generate-project-list.ps1 +++ b/eng/pipelines/scripts/generate-project-list.ps1 @@ -4,6 +4,22 @@ $additionalModulesList = @() . "${PSScriptRoot}/../../common/scripts/common.ps1" +# If ProjectListOverride is set (e.g., from matrix variables), use it directly +# to avoid building unnecessary modules in jobs that only test a subset. +if ($env:PROJECTLISTOVERRIDE -and $env:PROJECTLISTOVERRIDE -notlike '*ProjectListOverride*') { + $projects = $env:PROJECTLISTOVERRIDE + Write-Host "Using ProjectListOverride = $projects" + Write-Host "##vso[task.setvariable variable=ProjectList;]$projects" + Write-Host "##vso[task.setvariable variable=ArtifactsList;]$projects" + Write-Host "##vso[task.setvariable variable=AdditionalModulesList;]" + + $sha256 = new-object -TypeName System.Security.Cryptography.SHA256Managed + $utf8 = new-object -TypeName System.Text.UTF8Encoding + $projectListSha256 = [Convert]::ToBase64String($sha256.ComputeHash($utf8.GetBytes($projects))) + Write-Host "##vso[task.setvariable variable=ProjectListSha256;]$projectListSha256" + return +} + if ($env:ARTIFACTSJSON -and $env:ARTIFACTSJSON -notlike '*ArtifactsJson*') { $artifacts = $env:ARTIFACTSJSON | ConvertFrom-Json foreach ($artifact in $artifacts) { diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json index 87e69709acba..a85b0344ab14 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json @@ -57,7 +57,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.spark:azure-cosmos-spark_3,com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12" }, "Spark 3.4 Integration Tests targeting Cosmos Emulator - Java 11'": { "ProfileFlag": "-Dspark-e2e_3-4", @@ -65,7 +66,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.spark:azure-cosmos-spark_3,com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12" }, "Spark 3.5, Scala 2.12 Integration Tests targeting Cosmos Emulator - Java 17'": { "ProfileFlag": "-Dspark-e2e_3-5_2-12", @@ -73,7 +75,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.spark:azure-cosmos-spark_3,com.azure.cosmos.spark:azure-cosmos-spark_3-5,com.azure.cosmos.spark:azure-cosmos-spark_3-5_2-12" }, "Spark 3.5, Scala 2.13 Integration Tests targeting Cosmos Emulator - Java 17'": { "ProfileFlag": "-Dspark-e2e_3-5_2-13", @@ -81,7 +84,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.spark:azure-cosmos-spark_3,com.azure.cosmos.spark:azure-cosmos-spark_3-5,com.azure.cosmos.spark:azure-cosmos-spark_3-5_2-13" }, "Spark 4.0, Scala 2.13 Integration Tests targeting Cosmos Emulator - Java 21'": { "ProfileFlag": "-Dspark-e2e_4-0_2-13", @@ -89,7 +93,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.21", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.spark:azure-cosmos-spark_3,com.azure.cosmos.spark:azure-cosmos-spark_4-0_2-13" }, "Kafka Integration Tests targeting Cosmos Emulator - Java 17": { "ProfileFlag": "-Pkafka-emulator", @@ -97,7 +102,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.kafka:azure-cosmos-kafka-connect" } } } diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json index 9988cac76429..88dffb0886c8 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json @@ -57,7 +57,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.spark:azure-cosmos-spark_3,com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12" }, "Spark 3.3 Integration Tests targeting Cosmos Emulator - Java 11'": { "ProfileFlag": "-Dspark-e2e_3-3", @@ -65,7 +66,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.spark:azure-cosmos-spark_3,com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12" }, "Spark 3.4 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-4", @@ -73,7 +75,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.spark:azure-cosmos-spark_3,com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12" }, "Spark 3.4 Integration Tests targeting Cosmos Emulator - Java 11'": { "ProfileFlag": "-Dspark-e2e_3-4", @@ -81,7 +84,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.spark:azure-cosmos-spark_3,com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12" }, "Spark 3.5, Scala 2.12 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-5_2-12", @@ -89,7 +93,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.spark:azure-cosmos-spark_3,com.azure.cosmos.spark:azure-cosmos-spark_3-5,com.azure.cosmos.spark:azure-cosmos-spark_3-5_2-12" }, "Spark 3.5, Scala 2.12 Integration Tests targeting Cosmos Emulator - Java 17'": { "ProfileFlag": "-Dspark-e2e_3-5_2-12", @@ -97,7 +102,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.spark:azure-cosmos-spark_3,com.azure.cosmos.spark:azure-cosmos-spark_3-5,com.azure.cosmos.spark:azure-cosmos-spark_3-5_2-12" }, "Spark 3.5, Scala 2.13 Integration Tests targeting Cosmos Emulator - Java 17'": { "ProfileFlag": "-Dspark-e2e_3-5_2-13", @@ -105,7 +111,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.spark:azure-cosmos-spark_3,com.azure.cosmos.spark:azure-cosmos-spark_3-5,com.azure.cosmos.spark:azure-cosmos-spark_3-5_2-13" }, "Spark 4.0, Scala 2.13 Integration Tests targeting Cosmos Emulator - Java 17'": { "ProfileFlag": "-Dspark-e2e_4-0_2-13", @@ -113,7 +120,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.spark:azure-cosmos-spark_3,com.azure.cosmos.spark:azure-cosmos-spark_4-0_2-13" }, "Spark 4.0, Scala 2.13 Integration Tests targeting Cosmos Emulator - Java 21'": { "ProfileFlag": "-Dspark-e2e_4-0_2-13", @@ -121,7 +129,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.21", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.spark:azure-cosmos-spark_3,com.azure.cosmos.spark:azure-cosmos-spark_4-0_2-13" }, "Kafka Integration Tests targeting Cosmos Emulator - Java 11": { "ProfileFlag": "-Pkafka-emulator", @@ -129,7 +138,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.kafka:azure-cosmos-kafka-connect" }, "Kafka Integration Tests targeting Cosmos Emulator - Java 17": { "ProfileFlag": "-Pkafka-emulator", @@ -137,7 +147,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true", - "BuildOptions": "" + "BuildOptions": "", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests,com.azure.cosmos.kafka:azure-cosmos-kafka-connect" } } } From f56037e06191338a773eea60d0df2128a356b2f2 Mon Sep 17 00:00:00 2001 From: Kushagra Thapar Date: Wed, 4 Mar 2026 20:19:04 -0800 Subject: [PATCH 6/8] No-op: trigger Cosmos CI for build optimization validation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../src/test/java/com/azure/cosmos/rx/TestSuiteBase.java | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java index af894f913052..2e0beac7e0f0 100644 --- a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java +++ b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. + package com.azure.cosmos.rx; import com.azure.core.credential.AzureKeyCredential; From ddec16d590a8b9511d7e15cdb943a7c5cde0bccd Mon Sep 17 00:00:00 2001 From: Kushagra Thapar Date: Thu, 5 Mar 2026 14:25:20 -0800 Subject: [PATCH 7/8] Add ProjectListOverride for emulator/encryption jobs to skip Spark compilation Emulator, Long Emulator, and Encryption jobs were compiling all 14 cosmos modules including 7 Spark modules (Scala compilation ~10-16 min) despite only running core emulator tests. Add ProjectListOverride to limit these jobs to only the modules they actually test: - Emulator/Long Emulator: azure-cosmos, azure-cosmos-test, azure-cosmos-tests - Encryption: adds azure-cosmos-encryption Also reverts the no-op TestSuiteBase trigger commit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../stages/cosmos-emulator-matrix-pr.json | 15 ++++++++++----- .../templates/stages/cosmos-emulator-matrix.json | 15 ++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json index a85b0344ab14..94625e96ffdb 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix-pr.json @@ -17,7 +17,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", - "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests" }, "Emulator Only Integration Tests Tcp - Java 17": { "ProfileFlag": "-Pemulator", @@ -25,7 +26,8 @@ "DESIRED_CONSISTENCIES": "[\"Strong\"]", "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", - "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests" }, "Long Emulator Only Integration Tests Tcp - Java 8": { "ProfileFlag": "-Plong-emulator", @@ -33,7 +35,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", - "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests" }, "Long Emulator Only Integration Tests Tcp - Java 17": { "ProfileFlag": "-Plong-emulator", @@ -41,7 +44,8 @@ "DESIRED_CONSISTENCIES": "[\"Strong\"]", "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", - "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests" }, "Encryption Emulator Only Integration Tests": { "ProfileFlag": "-Pencryption-integration", @@ -49,7 +53,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", - "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-encryption,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests" }, "Spark 3.3 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-3", diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json index 88dffb0886c8..3347a308cc8f 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json @@ -17,7 +17,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", - "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests" }, "Emulator Only Integration Tests Tcp - Java 17": { "ProfileFlag": "-Pemulator", @@ -25,7 +26,8 @@ "DESIRED_CONSISTENCIES": "[\"Strong\"]", "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", - "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests" }, "Long Emulator Only Integration Tests Tcp - Java 8": { "ProfileFlag": "-Plong-emulator", @@ -33,7 +35,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", - "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests" }, "Long Emulator Only Integration Tests Tcp - Java 17": { "ProfileFlag": "-Plong-emulator", @@ -41,7 +44,8 @@ "DESIRED_CONSISTENCIES": "[\"Strong\"]", "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", - "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests" }, "Encryption Emulator Only Integration Tests": { "ProfileFlag": "-Pencryption-integration", @@ -49,7 +53,8 @@ "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true -Dshade.skip=true -Dmaven.antrun.skip=true", - "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true" + "BuildOptions": "-Dshade.skip=true -Dmaven.antrun.skip=true", + "ProjectListOverride": "com.azure:azure-cosmos,com.azure:azure-cosmos-encryption,com.azure:azure-cosmos-test,com.azure:azure-cosmos-tests" }, "Spark 3.3 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-3", From 3b78ac91e116d5b831425b356e330e4e01213b70 Mon Sep 17 00:00:00 2001 From: Kushagra Thapar Date: Sat, 7 Mar 2026 10:04:47 -0800 Subject: [PATCH 8/8] Guard ProjectListOverride from being used in FromSource runs FromSource runs use ClientFromSourcePom.xml to build all track 2 libraries and rely on the computed project list for -pl/-amd test scoping. Allowing ProjectListOverride to take effect during FromSource runs would restrict the test scope incorrectly. Check $env:TESTFROMSOURCE and skip the override when it is 'true'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../scripts/generate-project-list.ps1 | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/eng/pipelines/scripts/generate-project-list.ps1 b/eng/pipelines/scripts/generate-project-list.ps1 index 60e00fe65af4..2208fd131056 100644 --- a/eng/pipelines/scripts/generate-project-list.ps1 +++ b/eng/pipelines/scripts/generate-project-list.ps1 @@ -6,18 +6,25 @@ $additionalModulesList = @() # If ProjectListOverride is set (e.g., from matrix variables), use it directly # to avoid building unnecessary modules in jobs that only test a subset. +# Do not honor ProjectListOverride for FromSource runs — FromSource builds use +# ClientFromSourcePom.xml which builds all libraries and the project list must +# be computed from the artifacts, not overridden. if ($env:PROJECTLISTOVERRIDE -and $env:PROJECTLISTOVERRIDE -notlike '*ProjectListOverride*') { - $projects = $env:PROJECTLISTOVERRIDE - Write-Host "Using ProjectListOverride = $projects" - Write-Host "##vso[task.setvariable variable=ProjectList;]$projects" - Write-Host "##vso[task.setvariable variable=ArtifactsList;]$projects" - Write-Host "##vso[task.setvariable variable=AdditionalModulesList;]" + if ($env:TESTFROMSOURCE -eq 'true') { + Write-Host "Ignoring ProjectListOverride for FromSource run (TestFromSource=true)" + } else { + $projects = $env:PROJECTLISTOVERRIDE + Write-Host "Using ProjectListOverride = $projects" + Write-Host "##vso[task.setvariable variable=ProjectList;]$projects" + Write-Host "##vso[task.setvariable variable=ArtifactsList;]$projects" + Write-Host "##vso[task.setvariable variable=AdditionalModulesList;]" - $sha256 = new-object -TypeName System.Security.Cryptography.SHA256Managed - $utf8 = new-object -TypeName System.Text.UTF8Encoding - $projectListSha256 = [Convert]::ToBase64String($sha256.ComputeHash($utf8.GetBytes($projects))) - Write-Host "##vso[task.setvariable variable=ProjectListSha256;]$projectListSha256" - return + $sha256 = new-object -TypeName System.Security.Cryptography.SHA256Managed + $utf8 = new-object -TypeName System.Text.UTF8Encoding + $projectListSha256 = [Convert]::ToBase64String($sha256.ComputeHash($utf8.GetBytes($projects))) + Write-Host "##vso[task.setvariable variable=ProjectListSha256;]$projectListSha256" + return + } } if ($env:ARTIFACTSJSON -and $env:ARTIFACTSJSON -notlike '*ArtifactsJson*') {