This commit is contained in:
matthchr 2016-07-08 15:34:22 -07:00
Родитель 3eefa1d43c
Коммит 206bd3c433
3 изменённых файлов: 78 добавлений и 193 удалений

Просмотреть файл

@ -104,195 +104,7 @@
<Compile Include="lib\services\batchManagement\lib\operations\applicationOperations.js" />
<Compile Include="lib\services\batchManagement\lib\operations\index.js" />
<Compile Include="lib\services\batchManagement\lib\operations\subscription.js" />
<Compile Include="lib\services\batch\lib\batchServiceClient.js" />
<Compile Include="lib\services\batch\lib\batchSharedKeyCredentials.js" />
<Compile Include="lib\services\batch\lib\hmacsha256.js" />
<Compile Include="lib\services\batch\lib\models\affinityInformation.js" />
<Compile Include="lib\services\batch\lib\models\applicationGetOptions.js" />
<Compile Include="lib\services\batch\lib\models\applicationListNextOptions.js" />
<Compile Include="lib\services\batch\lib\models\applicationListOptions.js" />
<Compile Include="lib\services\batch\lib\models\applicationListResult.js" />
<Compile Include="lib\services\batch\lib\models\applicationPackageReference.js" />
<Compile Include="lib\services\batch\lib\models\applicationSummary.js" />
<Compile Include="lib\services\batch\lib\models\autoPoolSpecification.js" />
<Compile Include="lib\services\batch\lib\models\autoScaleRun.js" />
<Compile Include="lib\services\batch\lib\models\autoScaleRunError.js" />
<Compile Include="lib\services\batch\lib\models\batchError.js" />
<Compile Include="lib\services\batch\lib\models\batchErrorDetail.js" />
<Compile Include="lib\services\batch\lib\models\certificate.js" />
<Compile Include="lib\services\batch\lib\models\certificateAddOptions.js" />
<Compile Include="lib\services\batch\lib\models\certificateAddParameter.js" />
<Compile Include="lib\services\batch\lib\models\certificateCancelDeletionOptions.js" />
<Compile Include="lib\services\batch\lib\models\certificateDeleteMethodOptions.js" />
<Compile Include="lib\services\batch\lib\models\certificateGetOptions.js" />
<Compile Include="lib\services\batch\lib\models\certificateListNextOptions.js" />
<Compile Include="lib\services\batch\lib\models\certificateListOptions.js" />
<Compile Include="lib\services\batch\lib\models\certificateListResult.js" />
<Compile Include="lib\services\batch\lib\models\certificateReference.js" />
<Compile Include="lib\services\batch\lib\models\cloudJob.js" />
<Compile Include="lib\services\batch\lib\models\cloudJobListPreparationAndReleaseTaskStatusResult.js" />
<Compile Include="lib\services\batch\lib\models\cloudJobListResult.js" />
<Compile Include="lib\services\batch\lib\models\cloudJobSchedule.js" />
<Compile Include="lib\services\batch\lib\models\cloudJobScheduleListResult.js" />
<Compile Include="lib\services\batch\lib\models\cloudPool.js" />
<Compile Include="lib\services\batch\lib\models\cloudPoolListResult.js" />
<Compile Include="lib\services\batch\lib\models\cloudTask.js" />
<Compile Include="lib\services\batch\lib\models\cloudTaskListResult.js" />
<Compile Include="lib\services\batch\lib\models\cloudTaskListSubtasksResult.js" />
<Compile Include="lib\services\batch\lib\models\computeNode.js" />
<Compile Include="lib\services\batch\lib\models\computeNodeAddUserOptions.js" />
<Compile Include="lib\services\batch\lib\models\computeNodeDeleteUserOptions.js" />
<Compile Include="lib\services\batch\lib\models\computeNodeDisableSchedulingOptions.js" />
<Compile Include="lib\services\batch\lib\models\computeNodeEnableSchedulingOptions.js" />
<Compile Include="lib\services\batch\lib\models\computeNodeError.js" />
<Compile Include="lib\services\batch\lib\models\computeNodeGetOptions.js" />
<Compile Include="lib\services\batch\lib\models\computeNodeGetRemoteDesktopOptions.js" />
<Compile Include="lib\services\batch\lib\models\computeNodeInformation.js" />
<Compile Include="lib\services\batch\lib\models\computeNodeListNextOptions.js" />
<Compile Include="lib\services\batch\lib\models\computeNodeListOptions.js" />
<Compile Include="lib\services\batch\lib\models\computeNodeListResult.js" />
<Compile Include="lib\services\batch\lib\models\computeNodeRebootOptions.js" />
<Compile Include="lib\services\batch\lib\models\computeNodeReimageOptions.js" />
<Compile Include="lib\services\batch\lib\models\computeNodeUpdateUserOptions.js" />
<Compile Include="lib\services\batch\lib\models\computeNodeUser.js" />
<Compile Include="lib\services\batch\lib\models\deleteCertificateError.js" />
<Compile Include="lib\services\batch\lib\models\environmentSetting.js" />
<Compile Include="lib\services\batch\lib\models\errorMessage.js" />
<Compile Include="lib\services\batch\lib\models\fileDeleteFromComputeNodeOptions.js" />
<Compile Include="lib\services\batch\lib\models\fileDeleteFromTaskOptions.js" />
<Compile Include="lib\services\batch\lib\models\fileGetFromComputeNodeOptions.js" />
<Compile Include="lib\services\batch\lib\models\fileGetFromTaskOptions.js" />
<Compile Include="lib\services\batch\lib\models\fileGetNodeFilePropertiesFromComputeNodeOptions.js" />
<Compile Include="lib\services\batch\lib\models\fileGetNodeFilePropertiesFromTaskOptions.js" />
<Compile Include="lib\services\batch\lib\models\fileListFromComputeNodeNextOptions.js" />
<Compile Include="lib\services\batch\lib\models\fileListFromComputeNodeOptions.js" />
<Compile Include="lib\services\batch\lib\models\fileListFromTaskNextOptions.js" />
<Compile Include="lib\services\batch\lib\models\fileListFromTaskOptions.js" />
<Compile Include="lib\services\batch\lib\models\fileProperties.js" />
<Compile Include="lib\services\batch\lib\models\index.js" />
<Compile Include="lib\services\batch\lib\models\jobAddOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobAddParameter.js" />
<Compile Include="lib\services\batch\lib\models\jobConstraints.js" />
<Compile Include="lib\services\batch\lib\models\jobDeleteMethodOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobDisableOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobDisableParameter.js" />
<Compile Include="lib\services\batch\lib\models\jobEnableOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobExecutionInformation.js" />
<Compile Include="lib\services\batch\lib\models\jobGetAllJobsLifetimeStatisticsOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobGetOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobListFromJobScheduleNextOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobListFromJobScheduleOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobListNextOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobListOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobListPreparationAndReleaseTaskStatusNextOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobListPreparationAndReleaseTaskStatusOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobManagerTask.js" />
<Compile Include="lib\services\batch\lib\models\jobPatchOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobPatchParameter.js" />
<Compile Include="lib\services\batch\lib\models\jobPreparationAndReleaseTaskExecutionInformation.js" />
<Compile Include="lib\services\batch\lib\models\jobPreparationTask.js" />
<Compile Include="lib\services\batch\lib\models\jobPreparationTaskExecutionInformation.js" />
<Compile Include="lib\services\batch\lib\models\jobReleaseTask.js" />
<Compile Include="lib\services\batch\lib\models\jobReleaseTaskExecutionInformation.js" />
<Compile Include="lib\services\batch\lib\models\jobScheduleAddOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobScheduleAddParameter.js" />
<Compile Include="lib\services\batch\lib\models\jobScheduleDeleteMethodOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobScheduleDisableOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobScheduleEnableOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobScheduleExecutionInformation.js" />
<Compile Include="lib\services\batch\lib\models\jobScheduleExistsOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobScheduleGetOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobScheduleListNextOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobScheduleListOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobSchedulePatchOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobSchedulePatchParameter.js" />
<Compile Include="lib\services\batch\lib\models\jobScheduleStatistics.js" />
<Compile Include="lib\services\batch\lib\models\jobScheduleTerminateOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobScheduleUpdateOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobScheduleUpdateParameter.js" />
<Compile Include="lib\services\batch\lib\models\jobSchedulingError.js" />
<Compile Include="lib\services\batch\lib\models\jobSpecification.js" />
<Compile Include="lib\services\batch\lib\models\jobStatistics.js" />
<Compile Include="lib\services\batch\lib\models\jobTerminateOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobTerminateParameter.js" />
<Compile Include="lib\services\batch\lib\models\jobUpdateOptions.js" />
<Compile Include="lib\services\batch\lib\models\jobUpdateParameter.js" />
<Compile Include="lib\services\batch\lib\models\metadataItem.js" />
<Compile Include="lib\services\batch\lib\models\multiInstanceSettings.js" />
<Compile Include="lib\services\batch\lib\models\nameValuePair.js" />
<Compile Include="lib\services\batch\lib\models\nodeDisableSchedulingParameter.js" />
<Compile Include="lib\services\batch\lib\models\nodeFile.js" />
<Compile Include="lib\services\batch\lib\models\nodeFileListResult.js" />
<Compile Include="lib\services\batch\lib\models\nodeRebootParameter.js" />
<Compile Include="lib\services\batch\lib\models\nodeReimageParameter.js" />
<Compile Include="lib\services\batch\lib\models\nodeRemoveParameter.js" />
<Compile Include="lib\services\batch\lib\models\nodeUpdateUserParameter.js" />
<Compile Include="lib\services\batch\lib\models\poolAddOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolAddParameter.js" />
<Compile Include="lib\services\batch\lib\models\poolDeleteMethodOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolDisableAutoScaleOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolEnableAutoScaleOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolEnableAutoScaleParameter.js" />
<Compile Include="lib\services\batch\lib\models\poolEvaluateAutoScaleOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolEvaluateAutoScaleParameter.js" />
<Compile Include="lib\services\batch\lib\models\poolExistsOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolGetAllPoolsLifetimeStatisticsOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolGetOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolInformation.js" />
<Compile Include="lib\services\batch\lib\models\poolListNextOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolListOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolListPoolUsageMetricsNextOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolListPoolUsageMetricsOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolListPoolUsageMetricsResult.js" />
<Compile Include="lib\services\batch\lib\models\poolPatchOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolPatchParameter.js" />
<Compile Include="lib\services\batch\lib\models\poolRemoveNodesOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolResizeOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolResizeParameter.js" />
<Compile Include="lib\services\batch\lib\models\poolSpecification.js" />
<Compile Include="lib\services\batch\lib\models\poolStatistics.js" />
<Compile Include="lib\services\batch\lib\models\poolStopResizeOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolUpdatePropertiesOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolUpdatePropertiesParameter.js" />
<Compile Include="lib\services\batch\lib\models\poolUpgradeOSOptions.js" />
<Compile Include="lib\services\batch\lib\models\poolUpgradeOSParameter.js" />
<Compile Include="lib\services\batch\lib\models\poolUsageMetrics.js" />
<Compile Include="lib\services\batch\lib\models\recentJob.js" />
<Compile Include="lib\services\batch\lib\models\resizeError.js" />
<Compile Include="lib\services\batch\lib\models\resourceFile.js" />
<Compile Include="lib\services\batch\lib\models\resourceStatistics.js" />
<Compile Include="lib\services\batch\lib\models\schedule.js" />
<Compile Include="lib\services\batch\lib\models\startTask.js" />
<Compile Include="lib\services\batch\lib\models\startTaskInformation.js" />
<Compile Include="lib\services\batch\lib\models\subtaskInformation.js" />
<Compile Include="lib\services\batch\lib\models\taskAddOptions.js" />
<Compile Include="lib\services\batch\lib\models\taskAddParameter.js" />
<Compile Include="lib\services\batch\lib\models\taskConstraints.js" />
<Compile Include="lib\services\batch\lib\models\taskDeleteMethodOptions.js" />
<Compile Include="lib\services\batch\lib\models\taskDependencies.js" />
<Compile Include="lib\services\batch\lib\models\taskExecutionInformation.js" />
<Compile Include="lib\services\batch\lib\models\taskGetOptions.js" />
<Compile Include="lib\services\batch\lib\models\taskIdRange.js" />
<Compile Include="lib\services\batch\lib\models\taskInformation.js" />
<Compile Include="lib\services\batch\lib\models\taskListNextOptions.js" />
<Compile Include="lib\services\batch\lib\models\taskListOptions.js" />
<Compile Include="lib\services\batch\lib\models\taskListSubtasksOptions.js" />
<Compile Include="lib\services\batch\lib\models\taskSchedulingError.js" />
<Compile Include="lib\services\batch\lib\models\taskSchedulingPolicy.js" />
<Compile Include="lib\services\batch\lib\models\taskStatistics.js" />
<Compile Include="lib\services\batch\lib\models\taskTerminateOptions.js" />
<Compile Include="lib\services\batch\lib\models\taskUpdateOptions.js" />
<Compile Include="lib\services\batch\lib\models\taskUpdateParameter.js" />
<Compile Include="lib\services\batch\lib\models\usageStatistics.js" />
<Compile Include="lib\services\batch\lib\operations\application.js" />
<Compile Include="lib\services\batch\lib\operations\certificateOperations.js" />
<Compile Include="lib\services\batch\lib\operations\computeNodeOperations.js" />
<Compile Include="lib\services\batch\lib\operations\file.js" />
<Compile Include="lib\services\batch\lib\operations\index.js" />
<Compile Include="lib\services\batch\lib\operations\job.js" />
<Compile Include="lib\services\batch\lib\operations\jobSchedule.js" />
<Compile Include="lib\services\batch\lib\operations\pool.js" />
<Compile Include="lib\services\batch\lib\operations\task.js" />
<Compile Include="lib\services\batch\lib\**\*.js" />
<Compile Include="lib\services\cdnManagement\lib\cdnManagementClient.js" />
<Compile Include="lib\services\cdnManagement\lib\models\checkNameAvailabilityInput.js" />
<Compile Include="lib\services\cdnManagement\lib\models\checkNameAvailabilityOutput.js" />

Просмотреть файл

@ -14,7 +14,6 @@
// limitations under the License.
//
var should = require('should');
var util = require('util');
var fs = require('fs');
@ -155,7 +154,7 @@ describe('Batch Service', function () {
});
it('should update pool target OS version successfully', function (done) {
client.pool.upgradeOS('nodesdktestpool1', 'WA-GUEST-OS-4.27_201512-01', function (err, result, request, response) {
client.pool.upgradeOS('nodesdktestpool1', 'WA-GUEST-OS-4.33_201606-01', function (err, result, request, response) {
should.not.exist(err);
should.not.exist(result);
response.statusCode.should.equal(202);
@ -220,6 +219,24 @@ describe('Batch Service', function () {
});
});
it('should add a pool with vnet and get expected error', function (done) {
var pool = {
id: 'nodesdkvnetpool',
vmSize: 'small',
cloudServiceConfiguration: { osFamily: '4' },
targetDedicated: 0,
networkConfiguration: { subnetId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1' }
};
client.pool.add(pool, function (err, result, request, response) {
should.exist(err);
should.not.exist(result);
err.statusCode.should.equal(400);
err.body.code.should.equal('InvalidPropertyValue');
done();
});
});
it('should list compute nodes successfully', function (done) {
client.computeNodeOperations.list('nodesdktestpool1', function (err, result, request, response) {
should.not.exist(err);
@ -518,6 +535,61 @@ describe('Batch Service', function () {
});
});
it.only('should create a task with exit conditions successfully', function (done) {
var jobId = 'JobWithAutoComplete';
var taskId = 'TaskWithAutoComplete';
var job = {
id: jobId,
poolInfo: {
poolId: 'dummypool'
},
onAllTasksComplete: 'noAction',
onTaskFailure: 'performExitOptionsJobAction'
};
client.job.add(job, function (err, result, request, response) {
should.not.exist(err);
should.not.exist(result);
response.statusCode.should.equal(201);
var task = {
id: taskId,
commandLine: 'echo Hello World',
exitConditions: {
default: {
jobAction: 'terminate'
},
exitCodes: [
{
code: 1,
exitOptions: {
jobAction: 'none'
}
}]
}
};
client.task.add(jobId, task, function (err, result, request, response) {
should.not.exist(err);
should.not.exist(result);
response.statusCode.should.equal(201);
client.task.get(jobId, taskId, function (err, result, request, response) {
should.not.exist(err);
should.exist(result);
result.exitConditions.default.jobAction.should.equal('terminate');
result.exitConditions.exitCodes[0].code.should.equal(1);
result.exitConditions.exitCodes[0].exitOptions.jobAction.should.equal('none');
client.job.deleteMethod(jobId, function (err, result, request, response) {
should.not.exist(err);
done();
});
});
});
});
});
it('should terminate a task successfully', function (done) {
client.task.terminate('HelloWorldJobNodeSDKTest', 'HelloWorldNodeSDKTestTask', function (err, result, request, response) {
should.not.exist(err);

Просмотреть файл

@ -8,8 +8,9 @@ WARNING: When running this test in live mode, it takes a long time, as waiting i
it takes to start up the machines and perform operations on them. This waiting is not done in replay mode.
Expect this suite to take around 10 minutes when run in live mode (and when run exclusive of the other test suites).
Note, if you wish to run this test suite exclusive of the other client tests, the environment variables AZURE_SUBSCRIPTION_ID, CLIENT_ID and APPLICATION_SECRET will need to
be set regardless. However they can be set to any random values, as they will not actually be tested.
Note, if you wish to run this test suite exclusive of the other client tests, the environment variables AZURE_SUBSCRIPTION_ID, CLIENT_ID and APPLICATION_SECRET will still need to
be set. However they can be set to any random values, as they will not actually be tested. You also will need to remove all of the other files from the test/testlistarm.txt file,
and then run "npm -s run-script unit-arm" to actually run the tests.
In order to test (and record) against a specific Batch Account, set the following variables:
AZURE_BATCH_ACCOUNT (just the account name)