Skip to content

Enable continuous backup for AllVersionsAndDeletes tests - #4901

Open
NaluTripician wants to merge 4 commits into
Azure:mainfrom
NaluTripician:nalutripician-supreme-journey
Open

Enable continuous backup for AllVersionsAndDeletes tests#4901
NaluTripician wants to merge 4 commits into
Azure:mainfrom
NaluTripician:nalutripician-supreme-journey

Conversation

@NaluTripician

Copy link
Copy Markdown
Contributor

Add support for enabling continuous backup on Cosmos DB test accounts to support the AllVersionsAndDeletes change feed mode added in PR #4706.

Changes

  • Add �nableContinuousBackup parameter to est-resources.bicep that configures continuous backup policy when enabled
  • Update cosmosAccount resource to conditionally use continuous backup when the parameter is set
  • Add a new account configuration in live-platform-matrix.json for Session SingleRegion ChangeFeed AllVersionsAndDeletes tests that enables continuous backup

Related Issue

Fixes #4706 - The live tests for AllVersionsAndDeletes change feed mode require continuous backup to be enabled on the test account

Copilot AI review requested due to automatic review settings July 28, 2026 20:31
@NaluTripician
NaluTripician requested a review from a team as a code owner July 28, 2026 20:31
@github-actions github-actions Bot added the Cosmos The azure_cosmos crate label Jul 28, 2026
Add enableContinuousBackup parameter to test-resources.bicep to configure
continuous backup policy when needed. Add a new account configuration in
live-platform-matrix.json for AllVersionsAndDeletes change feed tests that
enables continuous backup.

This fixes the live tests for PR Azure#4706 that require continuous backup to
be enabled for the AllVersionsAndDeletes change feed mode to function properly.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f2f63ad0-37fe-4d65-a2a3-0329ae6cb793
@NaluTripician
NaluTripician force-pushed the nalutripician-supreme-journey branch from d9f38da to d87da5a Compare July 28, 2026 20:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds continuous-backup provisioning intended for AllVersionsAndDeletes live tests.

Changes:

  • Adds an opt-in Cosmos DB backup policy.
  • Adds a dedicated continuous-backup test matrix entry.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
sdk/cosmos/test-resources.bicep Configures periodic or continuous backups.
sdk/cosmos/live-platform-matrix.json Adds the AllVersionsAndDeletes test account.
Comments suppressed due to low confidence (1)

sdk/cosmos/test-resources.bicep:84

  • continuousTierPolicy is not part of the 2023-04-15 database-account backup policy schema, so this account deployment will fail instead of enabling continuous backup. Continuous policies use continuousModeProperties.tier (the existing base implementation uses Continuous7Days).
    disableKeyBasedMetadataWriteAccess: false
    enableFreeTier: false
    enableAnalyticalStorage: false

Comment thread sdk/cosmos/live-platform-matrix.json
Copilot AI review requested due to automatic review settings July 28, 2026 20:37
@NaluTripician

Copy link
Copy Markdown
Contributor Author

/azp run rust - cosmos - weekly

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

sdk/cosmos/live-platform-matrix.json:57

  • This category does not enable any of the intended tests. The three AllVersionsAndDeletes live tests are currently ignored unless test_category = "emulator" (cosmos_change_feed.rs:730-733, 859-862, 960-963), while this value is exported directly as COSMOS_RUSTFLAGS; therefore this matrix entry provisions the account but skips all three tests. Add all_versions_and_deletes to those tests' cfg_attr gates (or use an existing category that enables them).
          "ArmTemplateParameters": "@{ defaultConsistencyLevel = 'Session'; enableContinuousBackup = $true; testCategory = 'all_versions_and_deletes' }"

sdk/cosmos/test-resources.bicep:60

  • continuousTierPolicy is not a property of the Microsoft.DocumentDB/databaseAccounts@2023-04-15 backup-policy schema, so this configuration is not a valid way to select continuous backup. Restore the supported continuousModeProperties.tier shape; otherwise Bicep/ARM can reject or ignore this setting instead of provisioning the intended policy.
  continuousTierPolicy: {
    state: 'On'
  }

… backup policy

The continuousTierPolicy property does not exist in the Azure API version
2023-04-15. The correct property for continuous backup mode is
continuousModeProperties with tier set to 'Continuous7Days', which matches
the structure used in the merged PR Azure#4706.

Addresses review comment on incorrect backup policy schema.
Copilot AI review requested due to automatic review settings July 28, 2026 20:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

sdk/cosmos/live-platform-matrix.json:57

  • This category does not enable the intended tests. test-resources.bicep:138 emits it as --cfg=test_category="all_versions_and_deletes", but there are no tests gated on that value; the three AllVersionsAndDeletes live tests are still gated exclusively on test_category = "emulator" (cosmos_change_feed.rs:731, :860, and :961). Consequently this new matrix leg provisions the continuous-backup account and then skips every test it was added for. Either make those guards accept the new category or use a category that currently enables them.
          "ArmTemplateParameters": "@{ defaultConsistencyLevel = 'Session'; enableContinuousBackup = $true; testCategory = 'all_versions_and_deletes' }"

@NaluTripician

Copy link
Copy Markdown
Contributor Author

/azp run rust - cosmos - weekly

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

…etes category

The three AllVersionsAndDeletes change feed tests were incorrectly gated to run
on emulator, but they require continuous backup which the emulator doesn't
support. Changed test gating from 'emulator' to 'all_versions_and_deletes' so
these tests only run on live accounts with continuous backup enabled.

- all_versions_and_deletes_surfaces_create_replace_delete
- all_versions_and_deletes_fans_out_creates_across_partitions
- all_versions_and_deletes_rejects_point_in_time_start

This fixes the HTTP 400 errors on DocumentCollection creation in CI.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 708004fe-cc4b-4721-969f-a7661c2a1ce1
Copilot AI review requested due to automatic review settings July 28, 2026 21:36
The AllVersionsAndDeletes change feed tests now use the 'all_versions_and_deletes'
test category to gate to live accounts with continuous backup. This category
needs to be registered in build.rs so the Rust compiler recognizes it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 708004fe-cc4b-4721-969f-a7661c2a1ce1

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

sdk/cosmos/azure_data_cosmos/tests/emulator_tests/cosmos_change_feed.rs:861

  • The preceding documentation still says this test is gated on test_category = "emulator", which contradicts the new all_versions_and_deletes gate. Update it to state that the test requires the live continuous-backup account.
    not(test_category = "all_versions_and_deletes"),
    ignore = "requires test_category 'all_versions_and_deletes' (requires live account with continuous backup enabled)"

sdk/cosmos/azure_data_cosmos/tests/emulator_tests/cosmos_change_feed.rs:962

  • The preceding documentation still says this test is gated on test_category = "emulator", which contradicts the new all_versions_and_deletes gate. Update it to state that the test requires the live continuous-backup account.
    not(test_category = "all_versions_and_deletes"),
    ignore = "requires test_category 'all_versions_and_deletes' (requires live account with continuous backup enabled)"

sdk/cosmos/azure_data_cosmos/tests/emulator_tests/cosmos_change_feed.rs:732

  • The gate now makes this test live-only, but its documentation still says test_category = "emulator" and the body still describes emulator-specific behavior (for example, the retention and pre-image comments). Update those references to describe the live continuous-backup account so the prerequisites and assertion rationale match how the test runs.

This issue also appears in the following locations of the same file:

  • line 860
  • line 961
    not(test_category = "all_versions_and_deletes"),
    ignore = "requires test_category 'all_versions_and_deletes' (requires live account with continuous backup enabled)"

@NaluTripician

Copy link
Copy Markdown
Contributor Author

/azp run rust - cosmos - weekly

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cosmos The azure_cosmos crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants