Ejemplo n.º 1
0
        public IActionResult RunAll(string constellation, string include, string exclude)
        {
            HashSet <string> includeSet = null, excludeSet = null;

            if (!String.IsNullOrEmpty(include))
            {
                includeSet = new HashSet <string>(include.Split(','));
            }
            if (!String.IsNullOrEmpty(exclude))
            {
                excludeSet = new HashSet <string>(exclude.Split(','));
            }

            var packageJson = IOFile.ReadAllText(Path.Combine(_env.ContentRootPath, "package.json"));

            var model = new RunAllViewModel
            {
                Constellation  = constellation ?? "",
                CategoriesList = include,
                Version        = JsonConvert.DeserializeObject <IDictionary>(packageJson)["version"].ToString(),
                Suites         = UIModelHelper.GetAllSuites(HasDeviceModeFlag(), constellation, includeSet, excludeSet)
            };

            AssignBaseRunProps(model);

            return(View(model));
        }
Ejemplo n.º 2
0
        public ViewModelLocator()
        {
            var state = new LimsService();

            LoginUrl       = new LoginUrlViewModel(state);
            Recipe         = new GetRecipeViewModel(state);
            LoginPage      = new LoginPageViewModel(state);
            Metrics        = new MetricsViewModel(state);
            ProgressUpdate = new ProgressUpdateViewModel(state);
            RunAll         = new RunAllViewModel(state);
            Samplesheet    = new SamplesheetViewModel(state);

            Main = new MainViewModel(state, LoginUrl, Recipe, LoginPage, Metrics, ProgressUpdate, RunAll, Samplesheet);
        }
Ejemplo n.º 3
0
        public IActionResult RunAll(string constellation, string include, string exclude)
        {
            HashSet <string> includeSet = null, excludeSet = null, excludeSuites = null;
            int partIndex = 0;
            int partCount = 1;

            if (!String.IsNullOrEmpty(include))
            {
                includeSet = new HashSet <string>(include.Split(','));
            }
            if (!String.IsNullOrEmpty(exclude))
            {
                excludeSet = new HashSet <string>(exclude.Split(','));
            }
            if (!String.IsNullOrEmpty(constellation) && constellation.Contains('(') && constellation.EndsWith(')'))
            {
                var constellationParts = constellation.TrimEnd(')').Split('(');
                var parts = constellationParts[1].Split('/');

                constellation = constellationParts[0];
                partIndex     = Int32.Parse(parts[0]) - 1;
                partCount     = Int32.Parse(parts[1]);
            }

            var packageJson = IOFile.ReadAllText(Path.Combine(_env.ContentRootPath, "package.json"));

            if (_runFlags.IsContinuousIntegration)
            {
                if (IOFile.Exists(_completedSuitesFileName))
                {
                    var completedSuites = IOFile.ReadAllLines(_completedSuitesFileName);
                    excludeSuites = new HashSet <string>(completedSuites);
                }
            }

            var model = new RunAllViewModel
            {
                Constellation  = constellation ?? "",
                CategoriesList = include,
                Version        = JsonConvert.DeserializeObject <IDictionary>(packageJson)["version"].ToString(),
                Suites         = UIModelHelper.GetAllSuites(HasDeviceModeFlag(), constellation, includeSet, excludeSet, excludeSuites, partIndex, partCount)
            };

            AssignBaseRunProps(model);

            return(View(model));
        }