public static CreateTestJob ( |
||
controller | ||
context | BatchAccountContext | |
jobId | string | |
poolId | string | |
리턴 | void |
public void TestCreateTaskCollection() { BatchController controller = BatchController.NewInstance; string jobId = "createTaskCollectionJob"; BatchAccountContext context = null; controller.RunPsTestWorkflow( _logger, () => { return(new string[] { string.Format("Test-CreateTaskCollection '{0}'", jobId) }); }, () => { context = new ScenarioTestContext(); ScenarioTestHelpers.CreateTestJob(controller, context, jobId); }, () => { ScenarioTestHelpers.DeleteJob(controller, context, jobId); }, MethodBase.GetCurrentMethod().ReflectedType?.ToString(), MethodBase.GetCurrentMethod().Name); }
public void TestDisableAndEnableJob() { BatchController controller = BatchController.NewInstance; string jobId = "testDisableEnableJob"; BatchAccountContext context = null; controller.RunPsTestWorkflow( () => { return(new string[] { string.Format("Test-DisableAndEnableJob '{0}' '1'", jobId) }); }, () => { context = new ScenarioTestContext(); ScenarioTestHelpers.CreateTestJob(controller, context, jobId); }, () => { ScenarioTestHelpers.DeleteJob(controller, context, jobId); }, TestUtilities.GetCallingClass(), TestUtilities.GetCurrentMethodName()); }
public void TestGetTaskById() { BatchController controller = BatchController.NewInstance; string jobId = "getTaskJob"; string taskId = "testTask"; BatchAccountContext context = null; controller.RunPsTestWorkflow( () => { return(new string[] { string.Format("Test-GetTaskById '{0}' '{1}' '{2}'", accountName, jobId, taskId) }); }, () => { context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName); ScenarioTestHelpers.CreateTestJob(controller, context, jobId); ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId); }, () => { ScenarioTestHelpers.DeleteJob(controller, context, jobId); }, TestUtilities.GetCallingClass(), TestUtilities.GetCurrentMethodName()); }
public void TestListTaskPipeline() { BatchController controller = BatchController.NewInstance; string jobId = "listTaskPipeJob"; string taskId = "testTask"; BatchAccountContext context = null; controller.RunPsTestWorkflow( () => { return(new string[] { string.Format("Test-ListTaskPipeline '{0}' '{1}'", jobId, taskId) }); }, () => { context = new ScenarioTestContext(); ScenarioTestHelpers.CreateTestJob(controller, context, jobId); ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId); }, () => { ScenarioTestHelpers.DeleteJob(controller, context, jobId); }, TestUtilities.GetCallingClass(), TestUtilities.GetCurrentMethodName()); }
public void TestUpdateTask() { BatchController controller = BatchController.NewInstance; string jobId = "updateTaskJob"; string taskId = "testTask"; BatchAccountContext context = null; controller.RunPsTestWorkflow( () => { return(new string[] { string.Format("Test-UpdateTask '{0}' '{1}' '{2}'", accountName, jobId, taskId) }); }, () => { context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName); ScenarioTestHelpers.CreateTestJob(controller, context, jobId); // Make the task long running so the constraints can be updated ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId, "ping -t localhost -w 60"); }, () => { ScenarioTestHelpers.DeleteJob(controller, context, jobId); }, TestUtilities.GetCallingClass(), TestUtilities.GetCurrentMethodName()); }
public void TestListNodeFilesByTaskWithMaxCount() { BatchController controller = BatchController.NewInstance; string jobId = "nodeFileByTaskMaxJob"; string taskId = "testTask"; int maxCount = 1; BatchAccountContext context = null; controller.RunPsTestWorkflow( () => { return(new string[] { string.Format("Test-ListNodeFilesByTaskWithMaxCount '{0}' '{1}' '{2}' '{3}'", accountName, jobId, taskId, maxCount) }); }, () => { context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName); ScenarioTestHelpers.CreateTestJob(controller, context, jobId); ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId); ScenarioTestHelpers.WaitForTaskCompletion(controller, context, jobId, taskId); }, () => { ScenarioTestHelpers.DeleteJob(controller, context, jobId); }, TestUtilities.GetCallingClass(), TestUtilities.GetCurrentMethodName()); }
public void TestListNodeFilesByTaskRecursive() { BatchController controller = BatchController.NewInstance; string jobId = "listNodeFileByTaskRecursiveJob"; string taskId = "testTask"; string newFile = "testFile.txt"; BatchAccountContext context = null; controller.RunPsTestWorkflow( () => { return(new string[] { string.Format("Test-ListNodeFilesByTaskRecursive '{0}' '{1}' '{2}' '{3}'", accountName, jobId, taskId, newFile) }); }, () => { context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName); ScenarioTestHelpers.CreateTestJob(controller, context, jobId); ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId, string.Format("cmd /c echo \"test file\" > {0}", newFile)); ScenarioTestHelpers.WaitForTaskCompletion(controller, context, jobId, taskId); }, () => { ScenarioTestHelpers.DeleteJob(controller, context, jobId); }, TestUtilities.GetCallingClass(), TestUtilities.GetCurrentMethodName()); }
public void TestGetNodeFileByTaskByName() { BatchController controller = BatchController.NewInstance; string jobId = "testGetNodeFileByTaskJob"; string taskId = "testTask"; string nodeFileName = "stdout.txt"; BatchAccountContext context = null; controller.RunPsTestWorkflow( () => { return(new string[] { string.Format("Test-GetNodeFileByTaskByName '{0}' '{1}' '{2}'", jobId, taskId, nodeFileName) }); }, () => { context = new ScenarioTestContext(); ScenarioTestHelpers.CreateTestJob(controller, context, jobId); ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId); ScenarioTestHelpers.WaitForTaskCompletion(controller, context, jobId, taskId); }, () => { ScenarioTestHelpers.DeleteJob(controller, context, jobId); }, TestUtilities.GetCallingClass(), TestUtilities.GetCurrentMethodName()); }
public void TestListNodeFileByTaskPipeline() { BatchController controller = BatchController.NewInstance; string jobId = "nodeFileByTaskPipe"; string taskId = "testTask"; int count = 4; // ProcessEnv, stdout, stderr, wd BatchAccountContext context = null; controller.RunPsTestWorkflow( () => { return(new string[] { string.Format("Test-ListNodeFileByTaskPipeline '{0}' '{1}' '{2}'", jobId, taskId, count) }); }, () => { context = new ScenarioTestContext(); ScenarioTestHelpers.CreateTestJob(controller, context, jobId); ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId); ScenarioTestHelpers.WaitForTaskCompletion(controller, context, jobId, taskId); }, () => { ScenarioTestHelpers.DeleteJob(controller, context, jobId); }, TestUtilities.GetCallingClass(), TestUtilities.GetCurrentMethodName()); }