Beispiel #1
0
        public ActionResult <string> InitiateJob([FromBody] StartJobRequest request)
        {
            if (request == null)
            {
                throw new ArgumentException("Invalid request");
            }
            // Get a list of tests
            //List<TestInfo> tests = await _testListService.ListTests(new TestRequestDescription { TestRunCommand = request.TestRunCommand, TestRunImage = request.TestRunImage});

            List <TestInfo> tests = new List <TestInfo>
            {
                new TestInfo {
                    FullName = "WebTests.NavigateFeature.NavigateToSpecflow"
                }
            };
            // Create the job
            Job job = _jobService.CreateJob("NONE", tests);

            // Enqueue the tests
            _queues.EnqueueTests(job);

            // Call the compose endpoints
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            _composerService.RunCompose(request, job.JobId).ConfigureAwait(false);
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed

            // Return the polling url
            return(PollUrl(job.JobId, 0));
        }