Exemple #1
0
 public static async Task ReportTestResultAsync(TestResultReportingClient apiClient, ILogger logger, TestResultBase testResult)
 {
     try
     {
         logger.LogInformation($"Sending test result: Source={testResult.Source}, Type={testResult.ResultType}, CreatedAt={testResult.CreatedAt}, Result={testResult.GetFormattedResult()}");
         await apiClient.ReportResultAsync(testResult.ToTestOperationResultDto());
     }
     catch (Exception e)
     {
         logger.LogError(e, "Failed call to report status to TestResultCoordinator");
     }
 }
Exemple #2
0
        // TODO: Remove this function once the TRC support the two new endpoint properly.
        public static async Task ReportTestResultUntilSuccessAsync(TestResultReportingClient apiClient, ILogger logger, TestResultBase testResult, CancellationToken cancellationToken)
        {
            bool isSuccessful = false;

            while (!isSuccessful && !cancellationToken.IsCancellationRequested)
            {
                try
                {
                    logger.LogInformation($"Sending test result: Source={testResult.Source}, Type={testResult.ResultType}, CreatedAt={testResult.CreatedAt}, Result={testResult.GetFormattedResult()}");
                    await apiClient.ReportResultAsync(testResult.ToTestOperationResultDto(), cancellationToken);

                    isSuccessful = true;
                }
                catch (Exception ex)
                {
                    logger.LogDebug(ex, "Exception caught in ReportTestResultAsync()");
                }
            }
        }
Exemple #3
0
 public static async Task ReportTestResultAsync(TestResultReportingClient apiClient, ILogger logger, TestResultBase testResult, CancellationToken cancellationToken = default(CancellationToken))
 {
     logger.LogInformation($"Sending test result: Source={testResult.Source}, Type={testResult.ResultType}, CreatedAt={testResult.CreatedAt}, Result={testResult.GetFormattedResult()}");
     await apiClient.ReportResultAsync(testResult.ToTestOperationResultDto(), cancellationToken);
 }