Skip to content

Comments

Fix tests#1367

Open
alexweininger wants to merge 2 commits intomainfrom
alex/red-bass
Open

Fix tests#1367
alexweininger wants to merge 2 commits intomainfrom
alex/red-bass

Conversation

@alexweininger
Copy link
Member

don't merge WIP

Copilot AI review requested due to automatic review settings February 11, 2026 22:23
@alexweininger alexweininger requested a review from a team as a code owner February 11, 2026 22:23
Copy link
Contributor

Copilot AI left a 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 adjusts the nightly CRUD test setup, likely to avoid undoing the Azure DevOps federated-credentials subscription provider override used in long-running/nightly runs.

Changes:

  • Removed a call that cleared the test override for the Azure subscription provider in nightly CRUD tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 26 to 29
const testApi = getCachedTestApi();
testApi.testing.setOverrideAzureServiceFactory(undefined);
testApi.testing.setOverrideAzureSubscriptionProvider(undefined);

const subscriptionTreeItems = await testApi.compatibility.getAppResourceTree().getChildren() as unknown as SubscriptionItem[];
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

PR description says "don't merge WIP", but the PR is opened as a regular change. If this is intended to be non-mergeable, mark the PR as Draft; otherwise please update the description to reflect merge intent so it isn't accidentally blocked later.

Copilot uses AI. Check for mistakes.
@@ -25,7 +25,6 @@ suite('Resource CRUD Operations', function (this: Mocha.Suite): void {

const testApi = getCachedTestApi();
testApi.testing.setOverrideAzureServiceFactory(undefined);
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

Removing the call to clear setOverrideAzureSubscriptionProvider(undefined) can let a mock subscription provider leak in from earlier unit tests (e.g. createMockSubscriptionWithFunctions() sets an override and nothing appears to reset it). When long-running tests run without AzCode_UseAzureFederatedCredentials, this suite can end up using the mock provider, causing azureResourceGroups.logIn/tree subscription selection and subsequent ARM calls to break. Consider reintroducing the reset when federated creds are disabled (or, better, clear overrides in test/nightly/global.nightly.test.ts and then conditionally set the AzDO provider).

Suggested change
testApi.testing.setOverrideAzureServiceFactory(undefined);
testApi.testing.setOverrideAzureServiceFactory(undefined);
testApi.testing.setOverrideAzureSubscriptionProvider(undefined);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants