示例#1
0
        private TestPackagesData _CalculatePackages(
            List <ProxyPackageInfoV1> testPackagesOriginal,
            string testName
            )
        {
            List <ProxyPackageInfoV1> testPackages =
                this._GetTestPackagesWithoutDoubles(new List <ProxyPackageInfoV1>(testPackagesOriginal));

            this._previousTestPackages = new List <ProxyPackageInfoV1>(testPackagesOriginal);

            List <string>             doublesSignatures    = this.PackagesDoubleCheck(testPackages, testPackagesOriginal);
            List <ProxyPackageInfoV1> alContainingPackages = this._FindAllPackagesOfEvent <AlEvent>(testPackages).ToList();
            List <ProxyPackageInfoV1> ueContainingPackages = this._FindAllPackagesOfEvent <UeEvent>(testPackages).ToList();

            ProxyPackageInfoV1 packageWithLastAlEvent = this._GetPackageWithLastEventOfType <AlEvent>(testPackages);
            ProxyPackageInfoV1 packageWithLastUeEvent = this._GetPackageWithLastEventOfType <UeEvent>(testPackages);

            IEnumerable <ProxyPackageInfoV1> sdkVersionPackages = testPackages.Where(e => e.RequestJson is SdkVersionData);

            bool previousTestContainsClean = this.testBeforeCleanDictionary != null &&
                                             this.testBeforeCleanDictionary.ContainsKey(testName.ToUpper()) &&
                                             this.testBeforeCleanDictionary[testName.ToUpper()];

            TestPackagesData testPackagesData = new TestPackagesData(
                originalPackagesCount: testPackagesOriginal.Count,
                packagesCount: testPackages.Count,
                alPackagesCount: alContainingPackages.Count,
                uePackagesCount: ueContainingPackages.Count,
                caPackagesCount: 0,
                attemptPackagesCount: 0,
                sdkVersionCount: sdkVersionPackages.Count(),
                isLastAlRemoved: (previousTestContainsClean && CounterSettings.IgnoreLastAl) && packageWithLastAlEvent != null,
                isLastUeRemoved: (previousTestContainsClean && CounterSettings.IgnoreBadUe) && packageWithLastUeEvent != null,
                isFirstUeRemoved: false,
                isAllEventsOrdered: true,
                events: null,
                doublesSignatures: doublesSignatures,
                badCodesPackages: new List <ProxyPackageInfo>(),
                previousTestContainsCleaning: previousTestContainsClean,
                containsDeserializationErrors: false
                );

            return(testPackagesData);
        }
示例#2
0
        /// <summary>
        /// Calculates packages in given result folder.
        /// </summary>
        /// <returns>Platform separated dictionary of dictionary of test and packages.</returns>
        private Dictionary <string, Dictionary <string, TestPackagesData> > _EnumeratePackagesV1()
        {
            Console.WriteLine("Packages enumeration started..");

            Dictionary <string, Dictionary <string, TestPackagesData> > packagesDataDictionary =
                new Dictionary <string, Dictionary <string, TestPackagesData> >();

            foreach (var deserializedPlatformPackages in this._deserializedPackages)
            {
                string platformName = deserializedPlatformPackages.Key;

                Console.Write($"Enumerate {platformName} packages..");

                Dictionary <string, List <ProxyPackageInfoV1> > platformPackages =
                    deserializedPlatformPackages.Value;
                Dictionary <string, TestPackagesData> platformPackagesData =
                    new Dictionary <string, TestPackagesData>();

                foreach (var deserializedTestPackages in platformPackages)
                {
                    string testName = deserializedTestPackages.Key;

                    TestPackagesData testPackagesData = this._CalculatePackages(
                        new List <ProxyPackageInfoV1>(deserializedTestPackages.Value),
                        testName
                        );

                    platformPackagesData.Add(testName, testPackagesData);
                }

                packagesDataDictionary.Add(platformName, platformPackagesData);

                Console.Write(".");
            }

            Console.WriteLine();

            return(packagesDataDictionary);
        }