Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion test/nightly/crud.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
testApi.testing.setOverrideAzureSubscriptionProvider(undefined);

const subscriptionTreeItems = await testApi.compatibility.getAppResourceTree().getChildren() as unknown as SubscriptionItem[];
Comment on lines 26 to 29
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.
if (subscriptionTreeItems.length > 0) {
Expand Down
3 changes: 3 additions & 0 deletions test/utils/azureDevOpsSubscriptionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export async function setupAzureDevOpsSubscriptionProvider(): Promise<void> {
// Create the provider instance now so we can return it synchronously
const provider = await factory();

// Sign in to initialize the token credential
await provider.signIn();

// Set the override via the test API
const testApi = getCachedTestApi();
testApi.testing.setOverrideAzureSubscriptionProvider(() => provider);
Expand Down