public async Task <IActionResult> CreateTestRunOutputAsync([FromBody] TestRunOutputDto testRunOutputDto) { if (testRunOutputDto == null) { return(BadRequest()); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var testRunOutput = Mapper.Map <TestRunOutput>(testRunOutputDto); var result = await _meissaRepository.InsertWithSaveAsync(testRunOutput); var resultDto = Mapper.Map <TestRunOutputDto>(result); return(Ok(resultDto)); }
public async Task <Guid> CreateNewTestRunAsync(string testAssemblyName, byte[] outputFilesZip, int retriesCount, double threshold, bool runInParallel, int maxParallelProcessesCount, string nativeArguments, string testTechnology, bool isTimeBasedBalance, bool sameMachineByClass, IEnumerable <string> customArgumentsPairs = null) { if (testAssemblyName == null) { throw new ArgumentException("testAssemblyName must be provided."); } var newTestRun = new TestRunDto { TestRunId = _guidService.NewGuid(), DateStarted = _dateTimeProvider.GetCurrentTime(), TestAssemblyName = testAssemblyName, Status = TestRunStatus.InProgress, RetriesCount = retriesCount, Threshold = threshold, RunInParallel = runInParallel, NativeArguments = nativeArguments, MaxParallelProcessesCount = maxParallelProcessesCount, TestTechnology = testTechnology, IsTimeBasedBalance = isTimeBasedBalance, SameMachineByClass = sameMachineByClass, }; newTestRun = await _testRunServiceClient.CreateAsync(newTestRun); var newTestRunOutput = new TestRunOutputDto() { TestRunId = newTestRun.TestRunId, TestOutputFilesPackage = outputFilesZip, }; await _testRunOutputServiceClient.CreateAsync(newTestRunOutput); if (customArgumentsPairs != null) { await CreateTestRunCustomArgumentsAsync(newTestRun.TestRunId, customArgumentsPairs); } return(newTestRun.TestRunId); }