Esempio n. 1
0
        private void UpdateTestAgentLastAvailable(int testAgentRunId)
        {
            try
            {
                var testAgentRunAvailability = new TestAgentRunAvailabilityDto
                {
                    TestAgentRunId = testAgentRunId,
                    LastAvailable  = _dateTimeProvider.GetCurrentTime(),
                };

                _testAgentRunAvailabilityServiceClient.CreateAsync(testAgentRunAvailability).Wait();
            }
            catch (Exception e)
            {
                // DEBUG:
                _consoleProvider.WriteLine($"THERE WAS AN EXCEPTION DURING UPDATING LAST AVAILABLE {e}");
            }
        }
Esempio n. 2
0
        public async Task <IActionResult> CreateTestAgentRunAvailabilityAsync([FromBody] TestAgentRunAvailabilityDto testRunAvailabilityDto)
        {
            if (testRunAvailabilityDto == null)
            {
                return(BadRequest());
            }

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var testRunAvailability = Mapper.Map <TestAgentRunAvailability>(testRunAvailabilityDto);

            var result = await _meissaRepository.InsertWithSaveAsync(testRunAvailability);

            var resultDto = Mapper.Map <TestAgentRunAvailabilityDto>(result);

            return(Ok(resultDto));
        }
Esempio n. 3
0
        private void UpdateTestAgentLastAvailable(int testAgentRunId)
        {
            try
            {
                var testAgentRunAvailability = new TestAgentRunAvailabilityDto
                {
                    TestAgentRunId = testAgentRunId,
                    LastAvailable  = _dateTimeProvider.GetCurrentTime(),
                };

                _testAgentRunAvailabilityServiceClient.CreateAsync(testAgentRunAvailability).Wait();
                ////_testRunLogService.CreateTestRunLogAsync($"Update Test Agent Run on machine {_environmentService.MachineName} {_dateTimeProvider.GetCurrentTime()}", testAgentRun.TestRunId).Wait();
                // DEBUG:
                ////_consoleProvider.WriteLine();
                _consoleProvider.WriteLine($"UPDATE Test Agent Run on machine {_environmentService.MachineName} {_dateTimeProvider.GetCurrentTime()}");
            }
            catch (Exception e)
            {
                // DEBUG:
                _consoleProvider.WriteLine($"THERE WAS AN EXCEPTION DURING UPDATING LAST AVAILABLE {e}");
            }
        }