async Task <TestInfoCached> LoadTestsCoreAsync(IFarmTaskInfo farmTaskInfo)
        {
            string realUrl = await CapureRealUrl(farmTaskInfo.Url).ConfigureAwait(false);

            if (RealUrlCache.TryGetValue(farmTaskInfo, out TestInfoCached cache))
            {
                if (cache.RealUrl == realUrl)
                {
                    ActualizeTests(cache.TestList);
                    return(cache);
                }
            }
            List <Task <TestInfo> >  allTasks = new List <Task <TestInfo> >();
            CorpDirTestInfoContainer corpDirTestInfoContainer = LoadFromFarmTaskInfo(farmTaskInfo, realUrl);

            foreach (var corpDirTestInfo in corpDirTestInfoContainer.FailedTests)
            {
                CorpDirTestInfo info = corpDirTestInfo;
                allTasks.Add(Task.Factory.StartNew <TestInfo>(() => LoadTestInfo(info, corpDirTestInfoContainer.Teams)));
            }
            List <TestInfo> result      = (await Task.WhenAll(allTasks.ToArray()).ConfigureAwait(false)).ToList();
            TestInfoCached  cachedValue = new TestInfoCached(farmTaskInfo.Repository, realUrl, result, corpDirTestInfoContainer);

            RealUrlCache[farmTaskInfo] = cachedValue;
            return(cachedValue);
        }
        CorpDirTestInfoContainer LoadFromFarmTaskInfo(IFarmTaskInfo farmTaskInfo, string realUrl)
        {
            CorpDirTestInfoContainer corpDirTestInfoContainer = TestLoader.LoadFromInfo(farmTaskInfo, realUrl);

            loadingProgressController.Enlarge(corpDirTestInfoContainer.FailedTests.Count);
            return(corpDirTestInfoContainer);
        }
Пример #3
0
 public TestInfoCached(Repository repository, string realUrl, List <TestInfo> testList, CorpDirTestInfoContainer container)
 {
     Repository       = repository;
     RealUrl          = realUrl;
     TestList         = testList;
     UsedFilesLinks   = container.UsedFilesLinks;
     ElapsedTimes     = container.ElapsedTimes;
     SourcesBuildTime = container.SourcesBuildTime;
     TestsBuildTime   = container.TestsBuildTime;
 }
 public TestInfoCached(Repository repository, string realUrl, List <TestInfo> testList, CorpDirTestInfoContainer container)
 {
     Repository   = repository;
     RealUrl      = realUrl;
     TestList     = testList;
     UsedFiles    = container.UsedFiles;
     ElapsedTimes = container.ElapsedTimes;
     Teams        = container.Teams;
 }