Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test runner option #4257

Merged
merged 1 commit into from
May 5, 2017
Merged
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
6 changes: 2 additions & 4 deletions Tasks/AzureFileCopy/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ import assert = require('assert');
import path = require('path');

var psm = require('../../../Tests/lib/psRunner');
var shell = require('shelljs');
var ps = shell.which('powershell.exe');
var psr = null;

describe('AzureFileCopy Suite', function () {
this.timeout(20000);

before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -26,7 +24,7 @@ describe('AzureFileCopy Suite', function () {
psr.kill();
});

if(ps) {
if (psm.testSupported()) {
it('Validate AzureFileCopy.Utility Get-AzureUtility', (done) => {
psr.run(path.join(__dirname, 'L0GetAzureUtility.ps1'), done);
});
Expand Down
6 changes: 2 additions & 4 deletions Tasks/AzurePowerShell/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import Q = require('q');
import assert = require('assert');
import path = require('path');
var psm = require('../../../Tests/lib/psRunner');
var shell = require('shelljs');
var ps = shell.which('powershell.exe');
var psr = null;

describe('AzurePowerShell Suite', function () {
this.timeout(20000);

before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -26,7 +24,7 @@ describe('AzurePowerShell Suite', function () {
psr.kill();
});

if (ps) {
if (psm.testSupported()) {
it('does not unravel output', (done) => {
psr.run(path.join(__dirname, 'DoesNotUnravelOutput.ps1'), done);
})
Expand Down
6 changes: 2 additions & 4 deletions Tasks/Common/MSBuildHelpers/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import Q = require('q');
import assert = require('assert');
import path = require('path');
var psm = require('../../../../Tests/lib/psRunner');
var shell = require('shelljs');
var ps = shell.which('powershell.exe');
var psr = null;

describe('Common-MSBuildHelpers Suite', function () {
this.timeout(20000);

before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -26,7 +24,7 @@ describe('Common-MSBuildHelpers Suite', function () {
psr.kill();
});

if (ps) {
if (psm.testSupported()) {
it('(Format-MSBuildArguments) adds configuration property', (done) => {
psr.run(path.join(__dirname, 'Format-MSBuildArguments.AddsConfigurationProperty.ps1'), done);
})
Expand Down
6 changes: 2 additions & 4 deletions Tasks/Common/VstsAzureHelpers_/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import Q = require('q');
import assert = require('assert');
import path = require('path');
var psm = require('../../../../Tests/lib/psRunner');
var shell = require('shelljs');
var ps = shell.which('powershell.exe');
var psr = null;

describe('Common-VstsAzureHelpers_ Suite', function () {
this.timeout(20000);

before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -26,7 +24,7 @@ describe('Common-VstsAzureHelpers_ Suite', function () {
psr.kill();
});

if (ps) {
if (psm.testSupported()) {
it('(Import-AzureModule) azure preferred falls back', (done) => {
psr.run(path.join(__dirname, 'Import-AzureModule.AzurePreferredFallsBack.ps1'), done);
})
Expand Down
6 changes: 2 additions & 4 deletions Tasks/IISWebAppManagementOnMachineGroup/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import Q = require('q');
import assert = require('assert');
var path = require('path');
var psm = require('../../../Tests/lib/psRunner');
var shell = require('shelljs');
var ps = shell.which('powershell.exe');
var psr = null;

describe('IISWebAppManagementOnMachineGroup Suite', function () {
this.timeout(20000);

before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -26,7 +24,7 @@ describe('IISWebAppManagementOnMachineGroup Suite', function () {
psr.kill();
});

if (ps) {
if (psm.testSupported()) {
it('test iis manage utility - manage website', (done) => {
psr.run(path.join(__dirname, 'L0UtilityManageWebsite.ps1'), done);
})
Expand Down
6 changes: 2 additions & 4 deletions Tasks/MSBuild/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import assert = require('assert');
import path = require('path');
import * as ttm from 'vsts-task-lib/mock-test';
var psm = require('../../../Tests/lib/psRunner');
var shell = require('shelljs');
var ps = shell.which('powershell.exe');
var psr = null;

describe('MSBuild Suite', function () {
this.timeout(20000);
before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -23,7 +21,7 @@ describe('MSBuild Suite', function () {
}
});

if (ps) {
if (psm.testSupported()) {
it('passes arguments', (done) => {
psr.run(path.join(__dirname, 'PassesArguments.ps1'), done);
})
Expand Down
10 changes: 4 additions & 6 deletions Tasks/PowerShellOnTargetMachines/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ import assert = require('assert');
import path = require('path');

var psm = require('../../../Tests/lib/psRunner');
var shell = require('shelljs');
var ps = shell.which('powershell.exe');
var psr = null;

describe('PowerShellOnTargetMachine Suite', function () {
this.timeout(20000);

before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -26,7 +24,7 @@ describe('PowerShellOnTargetMachine Suite', function () {
psr.kill();
});

if(ps) {
if (psm.testSupported()) {
it('Validate Get-EnvironmentResources Command', (done) => {
psr.run(path.join(__dirname, 'L0ValidateEnvResources.ps1'), done);
});
Expand Down Expand Up @@ -56,7 +54,7 @@ describe('PowerShellOnTargetMachine - (Get-SkipCACheckOption and Get-ResourceWin
this.timeout(20000);

before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -67,7 +65,7 @@ describe('PowerShellOnTargetMachine - (Get-SkipCACheckOption and Get-ResourceWin
psr.kill();
});

if(ps) {
if (psm.testSupported()) {
it('Test for an environment with Https/SkipCA property set', (done) => {
psr.run(path.join(__dirname, 'L0SkipCAPropertyOnly.ps1'), done);
});
Expand Down
6 changes: 2 additions & 4 deletions Tasks/PublishSymbols/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import Q = require('q');
import assert = require('assert');
import path = require('path');
var psm = require('../../../Tests/lib/psRunner');
var shell = require('shelljs');
var ps = shell.which('powershell.exe');
var psr = null;

describe('PublishSymbols Suite', function () {
this.timeout(20000);

before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -26,7 +24,7 @@ describe('PublishSymbols Suite', function () {
psr.kill();
});

if (ps) {
if (psm.testSupported()) {
it('(Add-DbghelpLibrary) loads if not loaded', (done) => {
psr.run(path.join(__dirname, 'Add-DbghelpLibrary.LoadsIfNotLoaded.ps1'), done);
})
Expand Down
6 changes: 2 additions & 4 deletions Tasks/ServiceFabricComposeDeploy/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import Q = require('q');
import assert = require('assert');
var psm = require('../../../Tests/lib/psRunner');
import path = require('path');
var shell = require('shelljs');
var ps = shell.which('powershell.exe');
var psr = null;

describe('ServiceFabricComposeDeploy Suite', function () {
this.timeout(20000);

before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -26,7 +24,7 @@ describe('ServiceFabricComposeDeploy Suite', function () {
psr.kill();
});

if (ps) {
if (psm.testSupported()) {
it('Deploy', (done) => {
psr.run(path.join(__dirname, 'Deploy.ps1'), done);
})
Expand Down
6 changes: 2 additions & 4 deletions Tasks/ServiceFabricDeploy/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import Q = require('q');
import assert = require('assert');
var psm = require('../../../Tests/lib/psRunner');
import path = require('path');
var shell = require('shelljs');
var ps = shell.which('powershell.exe');
var psr = null;

describe('ServiceFabricDeploy Suite', function () {
this.timeout(20000);

before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -26,7 +24,7 @@ describe('ServiceFabricDeploy Suite', function () {
psr.kill();
});

if (ps) {
if (psm.testSupported()) {
it('AAD deploy', (done) => {
psr.run(path.join(__dirname, 'AadDeploy.ps1'), done);
})
Expand Down
6 changes: 2 additions & 4 deletions Tasks/ServiceFabricPowerShell/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import Q = require('q');
import assert = require('assert');
import path = require('path');
var psm = require('../../../Tests/lib/psRunner');
var shell = require('shelljs');
var ps = shell.which('powershell.exe');
var psr = null;

describe('ServiceFabricPowerShell Suite', function () {
this.timeout(20000);

before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -26,7 +24,7 @@ describe('ServiceFabricPowerShell Suite', function () {
psr.kill();
});

if (ps) {
if (psm.testSupported()) {
it('does not unravel output', (done) => {
psr.run(path.join(__dirname, 'DoesNotUnravelOutput.ps1'), done);
})
Expand Down
6 changes: 2 additions & 4 deletions Tasks/ServiceFabricUpdateAppVersions/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import Q = require('q');
import assert = require('assert');
var psm = require('../../../Tests/lib/psRunner');
import path = require('path');
var shell = require('shelljs');
var ps = shell.which('powershell.exe');
var psr = null;

describe('ServiceFabricUpdateAppVersions Suite', function () {
this.timeout(20000);

before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -26,7 +24,7 @@ describe('ServiceFabricUpdateAppVersions Suite', function () {
psr.kill();
});

if (ps) {
if (psm.testSupported()) {
it('update all versions', (done) => {
psr.run(path.join(__dirname, 'SimpleSuffix.ps1'), done);
})
Expand Down
10 changes: 4 additions & 6 deletions Tasks/SqlAzureDacpacDeployment/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ import assert = require('assert');
import path = require('path');

var psm = require('../../../Tests/lib/psRunner');
var shell = require('shelljs');
var ps = shell.which('powershell.exe');
var psr = null;

describe('SqlAzureDacpacDeployment Suite', function () {
this.timeout(20000);

before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -26,7 +24,7 @@ describe('SqlAzureDacpacDeployment Suite', function () {
psr.kill();
});

if(ps) {
if (psm.testSupported()) {
it('(DACPAC) Should throw if Multiple Dacpac files or none present', (done) => {
psr.run(path.join(__dirname, 'L0DacpacTaskFileCheck.ps1'), done);
});
Expand All @@ -47,7 +45,7 @@ describe('SqlAzureDacpacDeployment - Utility Suite', function () {
this.timeout(10000);

before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -58,7 +56,7 @@ describe('SqlAzureDacpacDeployment - Utility Suite', function () {
psr.kill();
});

if(ps) {
if (psm.testSupported()) {
it('Validate Username end point (Create-AzureSqlDatabaseServerFirewallRule)', (done) => {
psr.run(path.join(__dirname, 'L0UtilityUsernameCreate.ps1'), done);
});
Expand Down
6 changes: 2 additions & 4 deletions Tasks/VSBuild/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import Q = require('q');
import assert = require('assert');
import path = require('path');
var psm = require('../../../Tests/lib/psRunner');
var shell = require('shelljs');
var ps = shell.which('powershell.exe');
var psr = null;

describe('VSBuild Suite', function () {
this.timeout(20000);

before((done) => {
if (ps) {
if (psm.testSupported()) {
psr = new psm.PSRunner();
psr.start();
}
Expand All @@ -26,7 +24,7 @@ describe('VSBuild Suite', function () {
psr.kill();
});

if (ps) {
if (psm.testSupported()) {
it('(Select-VSVersion) errors if 15 not found', (done) => {
psr.run(path.join(__dirname, 'Select-VSVersion.ErrorsIf15NotFound.ps1'), done);
})
Expand Down
Loading