Skip to content

Commit 5101d05

Browse files
authored
Fixed DTS:1819676 (#14547) (#14552)
* Fixed DTS:1819676 * fix unit test * Fixed unit test * commit
1 parent b0edca7 commit 5101d05

File tree

8 files changed

+10
-11
lines changed

8 files changed

+10
-11
lines changed

Tasks/AzureResourceGroupDeploymentV2/Tests/L0.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ describe('Azure Resource Group Deployment', function () {
473473
assert(tr.succeeded, "Should have succeeded");
474474
assert(tr.stdout.indexOf("properly sanitized") > 0, "Parameters should have been sanitized");
475475
assert(tr.stdout.indexOf("deployments.createOrUpdate is called") > 0, "deployments.createOrUpdate function should have been called from azure-sdk");
476-
assert(tr.stdout.indexOf("set someVar") >= 0, "deploymentsOutput should have been updated");
476+
assert(tr.stdout.indexOf("##vso[task.setvariable variable=someVar;]") >= 0, "deploymentsOutput should have been updated");
477477
done();
478478
}
479479
catch (error) {

Tasks/AzureResourceGroupDeploymentV2/operations/ResourceGroup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,15 +563,15 @@ export class ResourceGroup {
563563
setVariablesInObject(`${path}.${key}`, obj[key]);
564564
}
565565
else {
566-
tl.setVariable(`${path}.${key}`, JSON.stringify(obj[key]));
566+
console.log(`##vso[task.setvariable variable=${path}.${key};]` + JSON.stringify(obj[key]));
567567
console.log(tl.loc("AddedOutputVariable", `${path}.${key}`));
568568
}
569569
}
570570
}
571571
if (typeof(result["properties"]["outputs"]) === "object") {
572572
setVariablesInObject(this.taskParameters.deploymentOutputs, result["properties"]["outputs"]);
573573
}
574-
tl.setVariable(this.taskParameters.deploymentOutputs, JSON.stringify(result["properties"]["outputs"]));
574+
console.log(`##vso[task.setvariable variable=${this.taskParameters.deploymentOutputs};]` + JSON.stringify(result["properties"]["outputs"]));
575575
console.log(tl.loc("AddedOutputVariable", this.taskParameters.deploymentOutputs));
576576
}
577577

Tasks/AzureResourceGroupDeploymentV2/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"version": {
1616
"Major": 2,
1717
"Minor": 184,
18-
"Patch": 0
18+
"Patch": 1
1919
},
2020
"demands": [],
2121
"minimumAgentVersion": "2.119.1",

Tasks/AzureResourceGroupDeploymentV2/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"version": {
1616
"Major": 2,
1717
"Minor": 184,
18-
"Patch": 0
18+
"Patch": 2
1919
},
2020
"demands": [],
2121
"minimumAgentVersion": "2.119.1",

Tasks/AzureResourceManagerTemplateDeploymentV3/Tests/L0.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('Azure Resource Manager Template Deployment', function () {
5454
assert(tr.succeeded, "Should have succeeded");
5555
assert(tr.stdout.indexOf("properly sanitized") > 0, "Parameters should have been sanitized");
5656
assert(tr.stdout.indexOf("deployments.createOrUpdate is called") > 0, "deployments.createOrUpdate function should have been called from azure-sdk");
57-
assert(tr.stdout.indexOf("set someVar") >= 0, "deploymentsOutput should have been updated");
57+
assert(tr.stdout.indexOf("##vso[task.setvariable variable=someVar;]") >= 0, "deploymentsOutput should have been updated");
5858
done();
5959
}
6060
catch (error) {
@@ -172,5 +172,4 @@ describe('Azure Resource Manager Template Deployment', function () {
172172
done(error);
173173
}
174174
});
175-
176175
});

Tasks/AzureResourceManagerTemplateDeploymentV3/operations/DeploymentScopeBase.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ export class DeploymentScopeBase {
7777
setVariablesInObject(`${path}.${key}`, obj[key]);
7878
}
7979
else {
80-
tl.setVariable(`${path}.${key}`, JSON.stringify(obj[key]));
80+
console.log(`##vso[task.setvariable variable=${path}.${key};]` + JSON.stringify(obj[key]));
8181
console.log(tl.loc("AddedOutputVariable", `${path}.${key}`));
8282
}
8383
}
8484
}
8585
if (typeof(result["properties"]["outputs"]) === "object") {
8686
setVariablesInObject(this.taskParameters.deploymentOutputs, result["properties"]["outputs"]);
8787
}
88-
tl.setVariable(this.taskParameters.deploymentOutputs, JSON.stringify(result["properties"]["outputs"]));
88+
console.log(`##vso[task.setvariable variable=${this.taskParameters.deploymentOutputs};]` + JSON.stringify(result["properties"]["outputs"]));
8989
console.log(tl.loc("AddedOutputVariable", this.taskParameters.deploymentOutputs));
9090
}
9191

Tasks/AzureResourceManagerTemplateDeploymentV3/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"version": {
1616
"Major": 3,
1717
"Minor": 184,
18-
"Patch": 0
18+
"Patch": 1
1919
},
2020
"demands": [],
2121
"minimumAgentVersion": "2.119.1",

Tasks/AzureResourceManagerTemplateDeploymentV3/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"version": {
1616
"Major": 3,
1717
"Minor": 184,
18-
"Patch": 0
18+
"Patch": 1
1919
},
2020
"demands": [],
2121
"minimumAgentVersion": "2.119.1",

0 commit comments

Comments
 (0)