Skip to content

Commit 382a06f

Browse files
authored
Replaced copid auth with az cli with the same code from shared library (#18657)
1 parent 00cb6ce commit 382a06f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+328
-348
lines changed

Tasks/AzureContainerAppsV0/Tests/L0.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ describe('AzureContainerAppsV0 Suite', function () {
102102
assert(tr.succeeded, 'AzureContainerAppsV0 task should have succeeded when creating a Container App using an image produced from the Oryx++ builder.');
103103

104104
// Validate that the Azure CLI was set up correctly
105-
assert(tr.stdout.includes('[MOCK] loginAzureRM called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
105+
assert(tr.stdout.includes('[MOCK] loginAzure called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
106106
assert(tr.stdout.includes('[MOCK] setAzureCliDynamicInstall called'), 'AzureContainerAppsV0 task should have called ensure dynamic installation is enabled for the Azure CLI.');
107107

108108
// Validate that the necessary Azure resources were created
@@ -162,7 +162,7 @@ describe('AzureContainerAppsV0 Suite', function () {
162162
assert(tr.succeeded, 'AzureContainerAppsV0 task should have succeeded when creating a Container App using an image produced from a Dockerfile.');
163163

164164
// Validate that the Azure CLI was set up correctly
165-
assert(tr.stdout.includes('[MOCK] loginAzureRM called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
165+
assert(tr.stdout.includes('[MOCK] loginAzure called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
166166
assert(tr.stdout.includes('[MOCK] setAzureCliDynamicInstall called'), 'AzureContainerAppsV0 task should have called ensure dynamic installation is enabled for the Azure CLI.');
167167

168168
// Validate that the necessary Azure resources were created
@@ -217,7 +217,7 @@ describe('AzureContainerAppsV0 Suite', function () {
217217
assert(tr.succeeded, 'AzureContainerAppsV0 task should have succeeded when creating a Container App using an image produced from a previously built image.');
218218

219219
// Validate that the Azure CLI was set up correctly
220-
assert(tr.stdout.includes('[MOCK] loginAzureRM called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
220+
assert(tr.stdout.includes('[MOCK] loginAzure called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
221221
assert(tr.stdout.includes('[MOCK] setAzureCliDynamicInstall called'), 'AzureContainerAppsV0 task should have called ensure dynamic installation is enabled for the Azure CLI.');
222222

223223
// Validate that the necessary Azure resources were created
@@ -261,7 +261,7 @@ describe('AzureContainerAppsV0 Suite', function () {
261261
assert(tr.succeeded, 'AzureContainerAppsV0 task should have succeeded when creating a Container App with a new Container App environment.');
262262

263263
// Validate that the Azure CLI was set up correctly
264-
assert(tr.stdout.includes('[MOCK] loginAzureRM called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
264+
assert(tr.stdout.includes('[MOCK] loginAzure called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
265265
assert(tr.stdout.includes('[MOCK] setAzureCliDynamicInstall called'), 'AzureContainerAppsV0 task should have called ensure dynamic installation is enabled for the Azure CLI.');
266266

267267
// Validate that the necessary Azure resources were created
@@ -308,7 +308,7 @@ describe('AzureContainerAppsV0 Suite', function () {
308308
assert(tr.succeeded, 'AzureContainerAppsV0 task should have succeeded when creating a Container App using a YAML configuration file and an image produced from the Oryx++ builder.');
309309

310310
// Validate that the Azure CLI was set up correctly
311-
assert(tr.stdout.includes('[MOCK] loginAzureRM called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
311+
assert(tr.stdout.includes('[MOCK] loginAzure called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
312312
assert(tr.stdout.includes('[MOCK] setAzureCliDynamicInstall called'), 'AzureContainerAppsV0 task should have called ensure dynamic installation is enabled for the Azure CLI.');
313313

314314
// Validate that the necessary Azure resources were created
@@ -364,7 +364,7 @@ describe('AzureContainerAppsV0 Suite', function () {
364364
assert(tr.succeeded, 'AzureContainerAppsV0 task should have succeeded when creating a Container App using a YAML configuration file and a previously built image.');
365365

366366
// Validate that the Azure CLI was set up correctly
367-
assert(tr.stdout.includes('[MOCK] loginAzureRM called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
367+
assert(tr.stdout.includes('[MOCK] loginAzure called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
368368
assert(tr.stdout.includes('[MOCK] setAzureCliDynamicInstall called'), 'AzureContainerAppsV0 task should have called ensure dynamic installation is enabled for the Azure CLI.');
369369

370370
// Validate that the necessary Azure resources were created
@@ -404,7 +404,7 @@ describe('AzureContainerAppsV0 Suite', function () {
404404
assert(tr.succeeded, 'AzureContainerAppsV0 task should have succeeded when updating an existing Container App using an image produced from the Oryx++ builder.');
405405

406406
// Validate that the Azure CLI was set up correctly
407-
assert(tr.stdout.includes('[MOCK] loginAzureRM called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
407+
assert(tr.stdout.includes('[MOCK] loginAzure called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
408408
assert(tr.stdout.includes('[MOCK] setAzureCliDynamicInstall called'), 'AzureContainerAppsV0 task should have called ensure dynamic installation is enabled for the Azure CLI.');
409409

410410
// Validate that the necessary Azure resources exist
@@ -455,7 +455,7 @@ describe('AzureContainerAppsV0 Suite', function () {
455455
assert(tr.succeeded, 'AzureContainerAppsV0 task should have succeeded when updating an existing Container App using an image produced from a previously built image.');
456456

457457
// Validate that the Azure CLI was set up correctly
458-
assert(tr.stdout.includes('[MOCK] loginAzureRM called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
458+
assert(tr.stdout.includes('[MOCK] loginAzure called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
459459
assert(tr.stdout.includes('[MOCK] setAzureCliDynamicInstall called'), 'AzureContainerAppsV0 task should have called ensure dynamic installation is enabled for the Azure CLI.');
460460

461461
// Validate that the necessary Azure resources exist
@@ -490,7 +490,7 @@ describe('AzureContainerAppsV0 Suite', function () {
490490
assert(tr.succeeded, 'AzureContainerAppsV0 task should have succeeded when updating an existing Container App using a YAML configuration file and a previously built image.');
491491

492492
// Validate that the Azure CLI was set up correctly
493-
assert(tr.stdout.includes('[MOCK] loginAzureRM called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
493+
assert(tr.stdout.includes('[MOCK] loginAzure called'), 'AzureContainerAppsV0 task should authenticate with the provided service connection.');
494494
assert(tr.stdout.includes('[MOCK] setAzureCliDynamicInstall called'), 'AzureContainerAppsV0 task should have called ensure dynamic installation is enabled for the Azure CLI.');
495495

496496
// Validate that the necessary Azure resources exist

Tasks/AzureContainerAppsV0/Tests/L0FailsForAppSourcePathWithoutAcrName.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ tmr.registerMock('azure-pipelines-task-lib/mock-task', tlClone);
3636
tmr.registerMock('./src/AzureAuthenticationHelper', {
3737
AzureAuthenticationHelper: function() {
3838
return {
39-
loginAzureRM: function() {
40-
console.log('[MOCK] loginAzureRM called');
39+
loginAzure: function() {
40+
console.log('[MOCK] loginAzure called');
4141
return;
4242
},
4343
logoutAzure: function() {

Tasks/AzureContainerAppsV0/Tests/L0FailsForMissingRequiredArguments.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ tmr.registerMock('azure-pipelines-task-lib/mock-task', tlClone);
3535
tmr.registerMock('./src/AzureAuthenticationHelper', {
3636
AzureAuthenticationHelper: function() {
3737
return {
38-
loginAzureRM: function() {
39-
console.log('[MOCK] loginAzureRM called');
38+
loginAzure: function() {
39+
console.log('[MOCK] loginAzure called');
4040
return;
4141
},
4242
logoutAzure: function() {

Tasks/AzureContainerAppsV0/Tests/L0FailsForNoServiceConnectionArgument.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ tmr.registerMock('azure-pipelines-task-lib/mock-task', tlClone);
3737
tmr.registerMock('./src/AzureAuthenticationHelper', {
3838
AzureAuthenticationHelper: function() {
3939
return {
40-
loginAzureRM: function() {
41-
console.log('[MOCK] loginAzureRM called');
40+
loginAzure: function() {
41+
console.log('[MOCK] loginAzure called');
4242
return;
4343
},
4444
logoutAzure: function() {

Tasks/AzureContainerAppsV0/Tests/L0SucceedsForCreateWithBuilder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ tmr.registerMock('azure-pipelines-task-lib/mock-task', tlClone);
4040
tmr.registerMock('./src/AzureAuthenticationHelper', {
4141
AzureAuthenticationHelper: function() {
4242
return {
43-
loginAzureRM: function() {
44-
console.log('[MOCK] loginAzureRM called');
43+
loginAzure: function() {
44+
console.log('[MOCK] loginAzure called');
4545
return;
4646
},
4747
logoutAzure: function() {

Tasks/AzureContainerAppsV0/Tests/L0SucceedsForCreateWithDockerfile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ tmr.registerMock('azure-pipelines-task-lib/mock-task', tlClone);
4141
tmr.registerMock('./src/AzureAuthenticationHelper', {
4242
AzureAuthenticationHelper: function() {
4343
return {
44-
loginAzureRM: function() {
45-
console.log('[MOCK] loginAzureRM called');
44+
loginAzure: function() {
45+
console.log('[MOCK] loginAzure called');
4646
return;
4747
},
4848
logoutAzure: function() {

Tasks/AzureContainerAppsV0/Tests/L0SucceedsForCreateWithImage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ tmr.registerMock('azure-pipelines-task-lib/mock-task', tlClone);
3939
tmr.registerMock('./src/AzureAuthenticationHelper', {
4040
AzureAuthenticationHelper: function() {
4141
return {
42-
loginAzureRM: function() {
43-
console.log('[MOCK] loginAzureRM called');
42+
loginAzure: function() {
43+
console.log('[MOCK] loginAzure called');
4444
return;
4545
},
4646
logoutAzure: function() {

Tasks/AzureContainerAppsV0/Tests/L0SucceedsForCreateWithNewEnvironment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ tmr.registerMock('azure-pipelines-task-lib/mock-task', tlClone);
3838
tmr.registerMock('./src/AzureAuthenticationHelper', {
3939
AzureAuthenticationHelper: function() {
4040
return {
41-
loginAzureRM: function() {
42-
console.log('[MOCK] loginAzureRM called');
41+
loginAzure: function() {
42+
console.log('[MOCK] loginAzure called');
4343
return;
4444
},
4545
logoutAzure: function() {

Tasks/AzureContainerAppsV0/Tests/L0SucceedsForCreateWithYamlAndBuilder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ tmr.registerMock('azure-pipelines-task-lib/mock-task', tlClone);
4141
tmr.registerMock('./src/AzureAuthenticationHelper', {
4242
AzureAuthenticationHelper: function() {
4343
return {
44-
loginAzureRM: function() {
45-
console.log('[MOCK] loginAzureRM called');
44+
loginAzure: function() {
45+
console.log('[MOCK] loginAzure called');
4646
return;
4747
},
4848
logoutAzure: function() {

Tasks/AzureContainerAppsV0/Tests/L0SucceedsForCreateWithYamlAndImage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ tmr.registerMock('azure-pipelines-task-lib/mock-task', tlClone);
4040
tmr.registerMock('./src/AzureAuthenticationHelper', {
4141
AzureAuthenticationHelper: function() {
4242
return {
43-
loginAzureRM: function() {
44-
console.log('[MOCK] loginAzureRM called');
43+
loginAzure: function() {
44+
console.log('[MOCK] loginAzure called');
4545
return;
4646
},
4747
logoutAzure: function() {

0 commit comments

Comments
 (0)