Agent - Last step quit with success (#6034)

* turn strings to enums and allow changing step completion action

* fixed edit

* added tests for agent enums and fixed cms tests
This commit is contained in:
Aditya Bist
2019-06-20 00:30:05 -07:00
committed by GitHub
parent 433e5633cf
commit 1ececc3035
11 changed files with 273 additions and 60 deletions

View File

@@ -0,0 +1,39 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import 'mocha';
import * as should from 'should';
import { AgentSubSystem } from 'azdata';
import { JobStepDialog } from '../../dialogs/jobStepDialog';
import { JobStepData } from '../../data/jobStepData';
const subSytems: AgentSubSystem[] = [AgentSubSystem.TransactSql, AgentSubSystem.PowerShell,
AgentSubSystem.CmdExec, AgentSubSystem.Distribution, AgentSubSystem.Merge,
AgentSubSystem.QueueReader, AgentSubSystem.Snapshot, AgentSubSystem.LogReader, AgentSubSystem.AnalysisCommands,
AgentSubSystem.AnalysisQuery, AgentSubSystem.Ssis];
const subSystemDisplayNames: string[] = [JobStepDialog.TSQLScript, JobStepDialog.Powershell,
JobStepDialog.CmdExec, JobStepDialog.ReplicationDistributor, JobStepDialog.ReplicationMerge,
JobStepDialog.ReplicationQueueReader, JobStepDialog.ReplicationSnapshot, JobStepDialog.ReplicationTransactionLogReader,
JobStepDialog.AnalysisServicesCommand, JobStepDialog.AnalysisServicesQuery, JobStepDialog.ServicesPackage];
describe('Agent extension enum mapping sanity test', function (): void {
it('SubSystem to Display Name Mapping test', () => {
for (let i = 0; i < subSytems.length; i++) {
let subSystem = subSytems[i];
let convertedSubSystemName = JobStepData.convertToSubSystemDisplayName(subSystem);
should.equal(convertedSubSystemName, subSystemDisplayNames[i]);
}
});
it('SubSystem Display Name to SubSystem Mapping test', () => {
for (let i = 0; i < subSystemDisplayNames.length; i++) {
let subSystemDisplayName = subSystemDisplayNames[i];
let convertedSubSystem = JobStepData.convertToAgentSubSystem(subSystemDisplayName);
should.equal(convertedSubSystem, subSytems[i]);
}
});
});