Пример #1
0
        public override void ExecuteRecursive(TaskExecutionNode node)
        {
            var task = node.RemoteTask as TestTask;

            if (task == null)
            {
                return;
            }

            var    projectFolder = task.ProjectFolder;
            Action job           = () =>
            {
                // TODO split tasks by project and e2e
                var confFile = KarmaConfig.Build(projectFolder, Enumerable.Empty <string>(), false);
                if (!StartKarma(projectFolder, confFile))
                {
                    return;
                }

                // notify task server
                var doc = LoadResults(projectFolder, false);
                JUnitReporter.Report(doc, Server, node);
            };

            job.BeginInvoke(null, null);
        }
Пример #2
0
        public static void Run(IUnitTestLaunch launch, string projectFolder, IEnumerable <Element> elements, bool isE2E)
        {
            Action job = () =>
            {
                var elementList = elements.ToList();
                var testFiles   = (from e in elementList.Flatten(x => x.Children.OfType <Element>())
                                   let pf = e.GetProjectFile()
                                            where pf != null
                                            select pf.Location.FullPath)
                                  .Distinct(StringComparer.CurrentCultureIgnoreCase);

                var confFile = KarmaConfig.Build(projectFolder, testFiles, isE2E);
                if (!StartKarma(projectFolder, confFile))
                {
                    return;
                }

                // notify task server
                var doc = LoadResults(projectFolder, isE2E);
                JUnitReporter.Report(doc, launch, elementList);
            };

            job.BeginInvoke(null, null);
        }