|
12 | 12 | // limitations under the License.
|
13 | 13 | // ----------------------------------------------------------------------------------
|
14 | 14 |
|
15 |
| -using Microsoft.Azure.ServiceManagement.Common.Models; |
16 | 15 | using Microsoft.WindowsAzure.Commands.ScenarioTest;
|
17 | 16 | using Xunit;
|
18 | 17 |
|
19 |
| -namespace Microsoft.Azure.Commands.Automation.Test |
| 18 | +namespace Commands.Automation.Test |
20 | 19 | {
|
21 |
| - public class AutomationTests : AutomationScenarioTestsBase |
| 20 | + public class AutomationTests : AutomationTestRunner |
22 | 21 | {
|
23 |
| - public XunitTracingInterceptor _logger; |
24 |
| - |
25 | 22 | public AutomationTests(Xunit.Abstractions.ITestOutputHelper output)
|
| 23 | + : base(output) |
26 | 24 | {
|
27 |
| - _logger = new XunitTracingInterceptor(output); |
28 |
| - XunitTracingInterceptor.AddToContext(_logger); |
29 | 25 | }
|
30 | 26 |
|
31 | 27 | [Fact(Skip = "Need x64 test framework.")]
|
32 | 28 | [Trait(Category.AcceptanceType, Category.CheckIn)]
|
33 | 29 | [Trait(Category.Service, Category.Automation)]
|
34 | 30 | public void TestAutomationStartAndStopRunbook()
|
35 | 31 | {
|
36 |
| - RunPowerShellTest(_logger, "Test-AutomationStartAndStopRunbook -runbookPath ScenarioTests\\Resources\\Test-Workflow.ps1"); |
| 32 | + TestRunner.RunTestScript("Test-AutomationStartAndStopRunbook -runbookPath ScenarioTests\\Resources\\Test-Workflow.ps1"); |
37 | 33 | }
|
38 | 34 |
|
39 | 35 | [Fact(Skip = "Need x64 test framework.")]
|
40 | 36 | [Trait(Category.AcceptanceType, Category.CheckIn)]
|
41 | 37 | [Trait(Category.Service, Category.Automation)]
|
42 | 38 | public void TestAutomationPublishAndEditRunbook()
|
43 | 39 | {
|
44 |
| - RunPowerShellTest(_logger, "Test-AutomationPublishAndEditRunbook -runbookPath ScenarioTests\\Resources\\Test-Workflow.ps1 -editRunbookPath Resources\\Automation\\Test-WorkflowV2.ps1"); |
| 40 | + TestRunner.RunTestScript("Test-AutomationPublishAndEditRunbook -runbookPath ScenarioTests\\Resources\\Test-Workflow.ps1 -editRunbookPath Resources\\Automation\\Test-WorkflowV2.ps1"); |
45 | 41 | }
|
46 | 42 |
|
47 | 43 | [Fact(Skip = "Need x64 test framework.")]
|
48 | 44 | [Trait(Category.AcceptanceType, Category.CheckIn)]
|
49 | 45 | [Trait(Category.Service, Category.Automation)]
|
50 | 46 | public void TestAutomationConfigureRunbook()
|
51 | 47 | {
|
52 |
| - RunPowerShellTest(_logger, "Test-AutomationConfigureRunbook -runbookPath ScenarioTests\\Resources\\Write-DebugAndVerboseOutput.ps1"); |
| 48 | + TestRunner.RunTestScript("Test-AutomationConfigureRunbook -runbookPath ScenarioTests\\Resources\\Write-DebugAndVerboseOutput.ps1"); |
53 | 49 | }
|
54 | 50 |
|
55 | 51 | [Fact(Skip = "Need to re-record tests with latest version of automation library")]
|
56 | 52 | [Trait(Category.Service, Category.Automation)]
|
57 | 53 | [Trait(Category.RunType, Category.LiveOnly)]
|
58 | 54 | public void TestAutomationSuspendAndResumeJob()
|
59 | 55 | {
|
60 |
| - RunPowerShellTest(_logger, "Test-AutomationSuspendAndResumeJob -runbookPath ScenarioTests\\Resources\\Use-WorkflowCheckpointSample.ps1"); |
| 56 | + TestRunner.RunTestScript("Test-AutomationSuspendAndResumeJob -runbookPath ScenarioTests\\Resources\\Use-WorkflowCheckpointSample.ps1"); |
61 | 57 | }
|
62 | 58 |
|
63 | 59 | [Fact(Skip = "Need to re-record tests with latest version of automation library")]
|
64 | 60 | [Trait(Category.Service, Category.Automation)]
|
65 | 61 | [Trait(Category.RunType, Category.LiveOnly)]
|
66 | 62 | public void TestAutomationStartRunbookOnASchedule()
|
67 | 63 | {
|
68 |
| - RunPowerShellTest(_logger, "Test-AutomationStartRunbookOnASchedule -runbookPath ScenarioTests\\Resources\\Test-Workflow.ps1"); |
| 64 | + TestRunner.RunTestScript("Test-AutomationStartRunbookOnASchedule -runbookPath ScenarioTests\\Resources\\Test-Workflow.ps1"); |
69 | 65 | }
|
70 | 66 |
|
71 | 67 | [Fact(Skip = "Need x64 test framework.")]
|
72 | 68 | [Trait(Category.AcceptanceType, Category.CheckIn)]
|
73 | 69 | [Trait(Category.Service, Category.Automation)]
|
74 | 70 | public void TestAutomationStartUnpublishedRunbook()
|
75 | 71 | {
|
76 |
| - RunPowerShellTest(_logger, "Test-AutomationStartUnpublishedRunbook -runbookPath ScenarioTests\\Resources\\Test-WorkFlowWithVariousParameters.ps1"); |
| 72 | + TestRunner.RunTestScript("Test-AutomationStartUnpublishedRunbook -runbookPath ScenarioTests\\Resources\\Test-WorkFlowWithVariousParameters.ps1"); |
77 | 73 | }
|
78 | 74 |
|
79 | 75 | [Fact(Skip = "Need x64 test framework.")]
|
80 | 76 | [Trait(Category.AcceptanceType, Category.CheckIn)]
|
81 | 77 | [Trait(Category.Service, Category.Automation)]
|
82 | 78 | public void TestAutomationRunbookWithParameter()
|
83 | 79 | {
|
84 |
| - RunPowerShellTest(_logger, "Test-RunbookWithParameter -runbookPath ScenarioTests\\Resources\\fastJob.ps1 -type 'PowerShell' -parameters @{'nums'='[1,2,3,4,5,6,7]'} -expectedResult 28"); |
| 80 | + TestRunner.RunTestScript("Test-RunbookWithParameter -runbookPath ScenarioTests\\Resources\\fastJob.ps1 -type 'PowerShell' -parameters @{'nums'='[1,2,3,4,5,6,7]'} -expectedResult 28"); |
85 | 81 | }
|
86 | 82 |
|
87 | 83 | [Fact(Skip = "Need x64 test framework.")]
|
88 | 84 | [Trait(Category.AcceptanceType, Category.CheckIn)]
|
89 | 85 | [Trait(Category.Service, Category.Automation)]
|
90 | 86 | public void TestAutomationPy2RunbookWithParameter()
|
91 | 87 | {
|
92 |
| - RunPowerShellTest(_logger, "Test-RunbookWithParameter -runbookPath ScenarioTests\\Resources\\fastJob.py -type 'Python2' -parameters @{'param1'='1';'param2'='2';'param3'='3';'param4'='4';'param5'='5';'param6'='6';'param7'='7'} -expectedResult 28"); |
| 88 | + TestRunner.RunTestScript("Test-RunbookWithParameter -runbookPath ScenarioTests\\Resources\\fastJob.py -type 'Python2' -parameters @{'param1'='1';'param2'='2';'param3'='3';'param4'='4';'param5'='5';'param6'='6';'param7'='7'} -expectedResult 28"); |
93 | 89 | }
|
94 | 90 | }
|
95 | 91 | }
|
0 commit comments