Skip to content

fixing key isolation - #48933

Open
Matthew Metcalf (mrm9084) wants to merge 6 commits into
Azure:mainfrom
mrm9084:appconfig-test-key-isolation
Open

fixing key isolation#48933
Matthew Metcalf (mrm9084) wants to merge 6 commits into
Azure:mainfrom
mrm9084:appconfig-test-key-isolation

Conversation

@mrm9084

@mrm9084 Matthew Metcalf (mrm9084) commented Sep 8, 2026

Copy link
Copy Markdown
Member

This pull request improves the reliability and maintainability of the App Configuration Provider test suite by making the test data more robust and reducing hard-coded values. The changes focus on dynamically generating resource names for test keys, cleaning up test data after execution, and updating test logic to use these dynamic keys. This helps prevent test conflicts and ensures a cleaner test environment.

Test improvements and reliability:

  • Updated tests to generate unique resource names for configuration keys and feature flags using get_resource_name, reducing the risk of key collisions during parallel test runs. [1] [2] [3]
  • Modified tests to clean up configuration settings and feature flags after each test by deleting them in finally blocks, ensuring no leftover data affects other tests. [1] [2] [3]

Test logic and import adjustments:

  • Adjusted test logic to use dynamically generated keys in assertions and refresh logic, replacing hard-coded key names throughout the async and sync test suites. [1] [2] [3]
  • Added or updated imports to include new or needed test utilities and types, such as SettingSelector and FeatureFlagConfigurationSetting. [1] [2] [3] [4]

Test asset tracking:

  • Updated the asset tag in assets.json to reflect the new state of the test assets.

Description

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added the App Configuration Azure.ApplicationModel.Configuration label Sep 8, 2026

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.

🟡 Changes recommended

Multi-resource setup occurs before cleanup protection, allowing partial setup failures to leak test data.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Improves App Configuration Provider test isolation through deterministic per-test keys and cleanup.

Changes:

  • Uses dynamic keys for sync/async refresh tests.
  • Deletes temporary settings and feature flags.
  • Updates recorded test assets.
File summaries
File Description
tests/test_provider_refresh.py Isolates synchronous refresh resources.
tests/aio/test_async_provider_refresh.py Isolates asynchronous refresh resources.
tests/key_vault/test_secret_refresh.py Uses a unique secret-reference key.
tests/aio/key_vault/test_async_secret_refresh.py Adds async secret-key isolation.
assets.json Updates the test recording asset tag.
Review details

Suppressed comments (2)

sdk/appconfiguration/azure-appconfiguration-provider/tests/test_provider_refresh.py:108

  • Both setup writes occur before this try, so failure while creating the watch key bypasses cleanup and leaks the already-created refresh setting. Include resource creation in the protected region and tolerate partially completed setup during cleanup.
        try:

sdk/appconfiguration/azure-appconfiguration-provider/tests/aio/test_async_provider_refresh.py:120

  • The two resources are created before entering this try. A failure creating the watch key therefore leaves the refresh setting behind, undermining the intended test isolation. Protect setup too and tolerate absent resources in cleanup.
            try:
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 8, 2026 17:31

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.

🟢 Approval recommended

The focused test-only changes consistently isolate resources and ensure cleanup without introducing unresolved issues.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings September 8, 2026 18:57

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.

🟢 Approval recommended

The test isolation and cleanup changes are consistent across sync and async paths with no blocking issues found.

Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings September 8, 2026 19: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.

🟢 Approval recommended

The test-only changes consistently isolate resources, preserve tested behavior, and clean up created data.

Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings September 8, 2026 21:01

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.

🟢 Approval recommended

The test isolation, cleanup, and sanitization changes are consistent across synchronous and asynchronous paths.

Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings September 9, 2026 18:45

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.

🟢 Approval recommended

The test isolation, cleanup, resource definitions, and recordings are consistently updated without unresolved issues.

Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

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

Labels

App Configuration Azure.ApplicationModel.Configuration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants