コード例 #1
0
 public DotNetTestCaseResult(DotNetTestRunInfo testRunInfo, HelixWorkItem helixWorkItem, TestCaseResult testCaseResult)
 {
     Debug.Assert(HelixUtil.TryGetHelixInfo(testCaseResult) == helixWorkItem.HelixInfo);
     TestRunInfo    = testRunInfo;
     HelixWorkItem  = helixWorkItem;
     TestCaseResult = testCaseResult;
 }
コード例 #2
0
ファイル: HelixWorkItem.cs プロジェクト: sharwell/devops-util
 public HelixWorkItem(TestRunInfo testRunInfo, HelixInfo helixInfo, TestCaseResult testCaseResult)
 {
     Debug.Assert(HelixUtil.TryGetHelixInfo(testCaseResult) == helixInfo);
     TestRunInfo    = testRunInfo;
     HelixInfo      = helixInfo;
     TestCaseResult = testCaseResult;
 }
コード例 #3
0
ファイル: HelixLogInfo.cs プロジェクト: riarenas/runfo
 public HelixLogInfo(
     string?runClientUri,
     string?consoleUri,
     string?coreDumpUri,
     string?testResultsUri)
 {
     RunClientUri   = HelixUtil.RewriteUri(runClientUri);
     ConsoleUri     = HelixUtil.RewriteUri(consoleUri);
     CoreDumpUri    = HelixUtil.RewriteUri(coreDumpUri);
     TestResultsUri = HelixUtil.RewriteUri(testResultsUri);
 }
コード例 #4
0
        public static async Task <Dictionary <HelixInfo, HelixLogInfo> > GetHelixMapAsync(this DevOpsServer server, IEnumerable <DotNetTestCaseResult> testCaseResults)
        {
            var query = testCaseResults
                        .Where(x => x.HelixWorkItem.HasValue)
                        .Select(x => x.HelixWorkItem !.Value)
                        .GroupBy(x => x.HelixInfo)
                        .ToList()
                        .AsParallel()
                        .Select(async g => (g.Key, await HelixUtil.GetHelixLogInfoAsync(server, g.First())));
            await Task.WhenAll(query).ConfigureAwait(false);

            return(query.ToDictionary(x => x.Result.Key, x => x.Result.Item2));
        }
コード例 #5
0
            static List <DotNetTestCaseResult> ToDotNetTestCaseResult(TestRunInfo testRunInfo, List <TestCaseResult> testCaseResults)
            {
                var list = new List <DotNetTestCaseResult>();

                foreach (var testCaseResult in testCaseResults)
                {
                    var helixInfo = HelixUtil.TryGetHelixInfo(testCaseResult);
                    if (helixInfo is null)
                    {
                        list.Add(new DotNetTestCaseResult(testRunInfo, testCaseResult));
                        continue;
                    }

                    if (HelixUtil.IsHelixWorkItem(testCaseResult))
                    {
                        var helixWorkItem = new HelixWorkItem(testRunInfo, helixInfo.Value, testCaseResult);
                        list.Add(new DotNetTestCaseResult(testRunInfo, helixWorkItem, testCaseResult));
                    }
                    else
                    {
                        var workItemTestCaseResult = testCaseResults.FirstOrDefault(x => HelixUtil.IsHelixWorkItemAndTestCaseResult(workItem: x, test: testCaseResult));
                        if (workItemTestCaseResult is null)
                        {
                            // This can happen when helix errors and doesn't fully upload a result. Treat it like
                            // a normal test case
                            list.Add(new DotNetTestCaseResult(testRunInfo, testCaseResult));
                        }
                        else
                        {
                            var helixWorkItem = new HelixWorkItem(testRunInfo, helixInfo.Value, workItemTestCaseResult);
                            list.Add(new DotNetTestCaseResult(testRunInfo, helixWorkItem, testCaseResult));
                        }
                    }
                }

                return(list);
            }