Skip to content

Commit 7a2a6ab

Browse files
Add L2 Tests for AzureRmWebAppDeploymentV4, AzureWebAppV1: Use skipEntryNameValidation in ziputility (#19341)
* Add L2 or BuildCanary Tests for AzureRmWebAppDeploymentV4, AzureWebAppV1: Use skipEntryNameValidation in ziputility - Removed unused imports from tests * Add L2 or BuildCanary Tests for AzureRmWebAppDeploymentV4, AzureWebAppV1: Use skipEntryNameValidation in ziputility - Add tests for AzureRmWebAppDeploymentV4 * Add L2 or BuildCanary Tests for AzureRmWebAppDeploymentV4, AzureWebAppV1: Use skipEntryNameValidation in ziputility - Add tests for AzureWebAppV1 - Fixed files for AzureRmWebAppDeploymentV4 * Add L2 or BuildCanary Tests for AzureRmWebAppDeploymentV4, AzureWebAppV1: Use skipEntryNameValidation in ziputility - Fixed Mailicious entry for AzureWebAppV1 Node20 - Bumped task version * Add L2 or BuildCanary Tests for AzureRmWebAppDeploymentV4, AzureWebAppV1: Use skipEntryNameValidation in ziputility - Bumped AzureRmWebAppDeploymentV4 version
1 parent 23398ff commit 7a2a6ab

File tree

155 files changed

+2469
-1513
lines changed

Some content is hidden

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

155 files changed

+2469
-1513
lines changed

Tasks/AzureRmWebAppDeploymentV4/Tests/AzureRmWebAppDeploymentProviderL0Tests.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import tl = require('azure-pipelines-task-lib');
2-
import { DeploymentFactory } from '../deploymentProvider/DeploymentFactory';
32
import { AzureRmWebAppDeploymentProvider } from '../deploymentProvider/AzureRmWebAppDeploymentProvider'
4-
import { IWebAppDeploymentProvider } from '../deploymentProvider/IWebAppDeploymentProvider';
5-
import { TaskParametersUtility, TaskParameters, DeploymentType } from '../operations/TaskParameters';
6-
import { stringify } from 'querystring';
7-
import { PackageType } from 'azure-pipelines-tasks-webdeployment-common/packageUtility';
3+
import { TaskParametersUtility, TaskParameters } from '../operations/TaskParameters';
84
import { getMockEndpoint } from '../node_modules/azure-pipelines-tasks-azure-arm-rest/Tests/mock_utils';
95
import { mockAzureARMPreDeploymentSteps } from "./mock_utils";
106

Tasks/AzureRmWebAppDeploymentV4/Tests/AzureRmWebAppDeploymentProviderTests.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ import tl = require('azure-pipelines-task-lib');
22
import tmrm = require('azure-pipelines-task-lib/mock-run');
33
import ma = require('azure-pipelines-task-lib/mock-answer');
44
import * as path from 'path';
5-
import { AzureResourceFilterUtility } from '../operations/AzureResourceFilterUtility';
6-
import { KuduServiceUtility } from '../operations/KuduServiceUtility';
7-
import { AzureEndpoint } from 'azure-pipelines-tasks-azure-arm-rest/azureModels';
8-
import { ApplicationTokenCredentials } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-common';
9-
import { AzureRMEndpoint } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-endpoint';
105
import { setEndpointData, setAgentsData, mockTaskArgument, mockTaskInputParameters } from './utils';
116

127
export class AzureRmWebAppDeploymentProviderTests {

Tasks/AzureRmWebAppDeploymentV4/Tests/BuiltInLinuxWebAppDeploymentProviderL0Tests.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import tl = require('azure-pipelines-task-lib');
2-
import { DeploymentFactory } from '../deploymentProvider/DeploymentFactory';
32
import { BuiltInLinuxWebAppDeploymentProvider } from '../deploymentProvider/BuiltInLinuxWebAppDeploymentProvider'
4-
import { IWebAppDeploymentProvider } from '../deploymentProvider/IWebAppDeploymentProvider';
5-
import { TaskParametersUtility, TaskParameters, DeploymentType } from '../operations/TaskParameters';
6-
import { stringify } from 'querystring';
3+
import { TaskParametersUtility, TaskParameters } from '../operations/TaskParameters';
74
import { PackageType } from 'azure-pipelines-tasks-webdeployment-common/packageUtility';
85
import { getMockEndpoint } from '../node_modules/azure-pipelines-tasks-azure-arm-rest/Tests/mock_utils';
96
import { mockAzureARMPreDeploymentSteps, mockLinuxAppSettings } from "./mock_utils";

Tasks/AzureRmWebAppDeploymentV4/Tests/BuiltInLinuxWebAppDeploymentProviderTests.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
import tl = require('azure-pipelines-task-lib');
21
import tmrm = require('azure-pipelines-task-lib/mock-run');
3-
import ma = require('azure-pipelines-task-lib/mock-answer');
42
import * as path from 'path';
5-
import { AzureResourceFilterUtility } from '../operations/AzureResourceFilterUtility';
6-
import { KuduServiceUtility } from '../operations/KuduServiceUtility';
7-
import { AzureEndpoint } from 'azure-pipelines-tasks-azure-arm-rest/azureModels';
8-
import { ApplicationTokenCredentials } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-common';
9-
import { AzureRMEndpoint } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-endpoint';
103
import { setEndpointData, setAgentsData, mockTaskArgument, mockTaskInputParameters } from './utils';
114

125
export class BuiltInLinuxWebAppDeploymentProviderTests {

Tasks/AzureRmWebAppDeploymentV4/Tests/ContainerWebAppDeploymentProviderL0Tests.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import tl = require('azure-pipelines-task-lib');
2-
import { DeploymentFactory } from '../deploymentProvider/DeploymentFactory';
32
import { ContainerWebAppDeploymentProvider } from '../deploymentProvider/ContainerWebAppDeploymentProvider'
4-
import { IWebAppDeploymentProvider } from '../deploymentProvider/IWebAppDeploymentProvider';
5-
import { TaskParametersUtility, TaskParameters, DeploymentType } from '../operations/TaskParameters';
6-
import { stringify } from 'querystring';
7-
import { PackageType } from 'azure-pipelines-tasks-webdeployment-common/packageUtility';
3+
import { TaskParametersUtility, TaskParameters } from '../operations/TaskParameters';
84
import { getMockEndpoint } from '../node_modules/azure-pipelines-tasks-azure-arm-rest/Tests/mock_utils';
95
import { mockAzureARMPreDeploymentSteps, mockContainerDeploySettings } from "./mock_utils";
106

Tasks/AzureRmWebAppDeploymentV4/Tests/ContainerWebAppDeploymentProviderTests.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
import tl = require('azure-pipelines-task-lib');
21
import tmrm = require('azure-pipelines-task-lib/mock-run');
3-
import ma = require('azure-pipelines-task-lib/mock-answer');
42
import * as path from 'path';
5-
import { AzureResourceFilterUtility } from '../operations/AzureResourceFilterUtility';
6-
import { KuduServiceUtility } from '../operations/KuduServiceUtility';
7-
import { AzureEndpoint } from 'azure-pipelines-tasks-azure-arm-rest/azureModels';
8-
import { ApplicationTokenCredentials } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-common';
9-
import { AzureRMEndpoint } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-endpoint';
103
import { setEndpointData, setAgentsData, mockTaskArgument, mockTaskInputParameters } from './utils';
114

125
export class ContainerWebAppDeploymentProviderTests {

Tasks/AzureRmWebAppDeploymentV4/Tests/DeploymentFactoryL0Tests.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import tl = require('azure-pipelines-task-lib');
22
import { DeploymentFactory } from '../deploymentProvider/DeploymentFactory';
3-
import { BuiltInLinuxWebAppDeploymentProvider } from '../deploymentProvider/BuiltInLinuxWebAppDeploymentProvider'
43
import { IWebAppDeploymentProvider } from '../deploymentProvider/IWebAppDeploymentProvider';
54
import { TaskParametersUtility, TaskParameters, DeploymentType } from '../operations/TaskParameters';
6-
import { stringify } from 'querystring';
75
import { PackageType } from 'azure-pipelines-tasks-webdeployment-common/packageUtility';
86

97
export class DeploymentFactoryL0Tests {

Tasks/AzureRmWebAppDeploymentV4/Tests/DeploymentFactoryTests.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import tl = require('azure-pipelines-task-lib');
21
import tmrm = require('azure-pipelines-task-lib/mock-run');
3-
import ma = require('azure-pipelines-task-lib/mock-answer');
42
import * as path from 'path';
53
import { setAgentsData, mockTaskArgument, mockTaskInputParameters } from './utils';
64

Tasks/AzureRmWebAppDeploymentV4/Tests/L0.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@ var KuduServiceTests = require("../node_modules/azure-pipelines-tasks-azure-arm-
88
var ApplicationInsightsTests = require("../node_modules/azure-pipelines-tasks-azure-arm-rest/Tests/L0-azure-arm-appinsights-tests.js");
99
var ResourcesTests = require("../node_modules/azure-pipelines-tasks-azure-arm-rest/Tests/L0-azure-arm-resource-tests.js");
1010

11+
const tmpDir = path.join(__dirname, 'temp');
12+
1113
describe('AzureRmWebAppDeployment Suite', function() {
12-
1314
this.timeout(60000);
15+
this.beforeAll(done => {
16+
tl.mkdirP(tmpDir);
17+
done();
18+
});
19+
this.afterAll(done => {
20+
tl.rmRF(tmpDir);
21+
done();
22+
});
1423

15-
before((done) => {
24+
before((done) => {
1625
if(!tl.exist(path.join(__dirname, '..', 'node_modules/azure-pipelines-tasks-azure-arm-rest/Tests/node_modules'))) {
1726
tl.cp(path.join( __dirname, 'node_modules'), path.join(__dirname, '..', 'node_modules/azure-pipelines-tasks-azure-arm-rest/Tests'), '-rf', true);
1827
}
@@ -214,12 +223,13 @@ describe('AzureRmWebAppDeployment Suite', function() {
214223
try {
215224
tr.run();
216225
assert(tr.stdOutContained('SCM_COMMAND_IDLE_TIMEOUT variable PRESENT'), 'Should have printed: SCM_COMMAND_IDLE_TIMEOUT variable PRESENT');
226+
assert(tr.stdOutContained('msbuild package PRESENT'), 'Should have printed: msbuild package PRESENT');
217227
done();
218228
}
219229
catch(error) {
220230
console.log(tr.stdout);
221231
console.log(tr.stderr);
222-
done();
232+
done(error);
223233
}
224234
});
225235

Tasks/AzureRmWebAppDeploymentV4/Tests/L0LinuxBuiltinImage.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import ma = require('azure-pipelines-task-lib/mock-answer');
22
import tmrm = require('azure-pipelines-task-lib/mock-run');
33
import path = require('path');
44

5-
import tl = require('azure-pipelines-task-lib');
6-
import trm = require('azure-pipelines-task-lib/toolrunner');
7-
85
let taskPath = path.join(__dirname, '..', 'azurermwebappdeployment.js');
96
let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath);
107

@@ -99,7 +96,6 @@ let a: ma.TaskLibAnswers = <ma.TaskLibAnswers>{
9996
}
10097

10198

102-
import mockTask = require('azure-pipelines-task-lib/mock-task');
10399
var kuduDeploymentLog = require('azurerest-common/kududeploymentstatusutility.js');
104100
var msDeployUtility = require('azure-pipelines-tasks-webdeployment-common/msdeployutility.js');
105101
tr.registerMock('./msdeployutility.js', {

0 commit comments

Comments
 (0)