Exemplo n.º 1
0
        private static void RunWithoutDistribution()
        {
            if (ConfigFile.Runtitle != null)
            {
                ConfigFile.Runtitle = ConfigFile.Runtitle + "_Daily Run_";
            }
            else
            {
                ConfigFile.Runtitle = "Daily Run_";
            }
            //ConfigFile.type = "Controller";
            if (!string.IsNullOrWhiteSpace(ConfigFile.sId))
            {
                TCMFunctions.TCMCreateUsingSuiteId(ConfigFile.sId);
            }
            else
            {
                TCMFunctions.TCMCreate();
            }

            sp.StartTime = DateTime.Now.ToString();

            TCMFunctions.TCMExecute(sp.runId);

            sp.EndTime = DateTime.Now.ToString();

            Console.WriteLine("TFS Data Collection Started ...");
            TFSFunctions.CollectResultFromTFS(sp.curRunId);
            XML.Generate(sp, "O");
            LogMessageToFile("TFS Data Collection Started");
            Console.WriteLine("Done");
        }
Exemplo n.º 2
0
        private static void RunWithSplitDistribution()
        {
            //if (ConfigFile.type.ToUpper() == "Controller".ToUpper())
            if (ConfigFile.order == 0) //i.e. controller
            {
                LogMessageToFile("The Machine is the controller");
                if (ConfigFile.Runtitle != null)
                {
                    ConfigFile.Runtitle = ConfigFile.Runtitle + "_SR_";
                    TFSFunctions.CreateTestRun(ConfigFile.controllerSuite, 0, 0, true);  //change due to run title
                }
                else
                {
                    ConfigFile.Runtitle = "SR_";
                    TFSFunctions.CreateTestRun(ConfigFile.controllerSuite, 0, 0, true);  //change due to run title
                }
                sp.StartTime = DateTime.Now.ToString();

                TCMFunctions.TCMExecute(sp.runId);

                TFSFunctions.CollectResultFromTFS(sp.runId);

                //Handling the controller run failure. If condition to check the controller's run information.
                XML.Generate(sp, "O");
                if (XML.ReadGeneratedSplogFileAndAssertOutcome(XML.combinedPath))
                {
                    throw new Exception("Test Outcome Failure was True.");
                }

                //for (int i = 1; i <= ConfigFile.systems - 1; i++)
                //{
                sp.EndTime = DateTime.Now.ToString();
                //TFSFunctions.CollectResultFromTFS(i, true);
                //}
            }
            else
            {
                LogMessageToFile("The Machine is not the controller");
                string[] sysSuites = ConfigFile.executorSuite.Split(':');
                string   sId       = sysSuites[ConfigFile.order - 1];
                if (ConfigFile.Runtitle != null)
                {
                    ConfigFile.Runtitle = ConfigFile.Runtitle + "_SR_";
                    TFSFunctions.CreateTestRun(sId, 0, 0, true);  //change due to run title
                }
                else
                {
                    ConfigFile.Runtitle = "SR_";
                    TFSFunctions.CreateTestRun(sId, 0, 0, true); //change due to run title
                }
                TCMFunctions.TCMExecute(sp.runId);
                TFSFunctions.CollectResultFromTFS(sp.runId);
            }
            XML.Generate(sp, "O");
        }
Exemplo n.º 3
0
 private static void ExportTRXAndUpdateXML()
 {
     if (string.IsNullOrWhiteSpace(resultFile))
     {
         TCMFunctions.TCMExport();
     }
     if (firstTry == false)
     {
         int counter = 0;
         while (!File.Exists(resultFile))
         {
             counter += 1;
             System.Threading.Thread.Sleep(30000);
             Console.WriteLine("Counter : " + counter.ToString() + " - Trying to export result for the current test run : " + sp.runId);
             TCMFunctions.TCMExport();
         }
     }
 }
Exemplo n.º 4
0
        public static void InitiateCustomization()
        {
            Console.WriteLine("Initiating Project Customization.....");

            switch (ConfigFile.proj.ToUpper())
            {
            case "<SPL_CASES>":
                //if (ConfigFile.type.ToUpper() == "CONTROLLER")
                if (ConfigFile.order == 0)
                {
                    TCMFunctions.TCMPRCreateAndExecute(ConfigFile.prsId, ConfigFile.pId, ConfigFile.cId);
                }
                break;

            default:
                break;
            }
            LogMessageToFile("Initiation Completed");
        }
Exemplo n.º 5
0
        private static void RunWithDistribution()
        {
            int sCount = 0;
            int eCount = 0;

            TFSFunctions.GetTestPointsCount();

            LogMessageToFile("The total number of test cases are - " + TFSFunctions.totalPoints.ToString());

            int average = (TFSFunctions.totalPoints / ConfigFile.systems);

            //if (ConfigFile.type.ToUpper() == "Controller".ToUpper())
            if (ConfigFile.order == 0)
            {
                eCount = average;
            }
            else if (ConfigFile.order > 0 && ConfigFile.order < ConfigFile.systems - 1)
            {
                sCount = (average * ConfigFile.order) + 1;
                eCount = average * (ConfigFile.order + 1);
            }
            else
            {
                sCount = (average * ConfigFile.order) + 1;
                eCount = TFSFunctions.totalPoints - 1;
            }

            if (ConfigFile.Runtitle != null)
            {
                ConfigFile.Runtitle = ConfigFile.Runtitle + "_DR_";
                TFSFunctions.CreateTestRun(ConfigFile.sId, sCount, eCount); //change due to run title
            }
            else
            {
                ConfigFile.Runtitle = "DR_";
                TFSFunctions.CreateTestRun(ConfigFile.sId, sCount, eCount);
            }

            sp.StartTime = DateTime.Now.ToString();

            TCMFunctions.TCMExecute(sp.runId);

            TFSFunctions.CollectResultFromTFS(sp.runId);

            //if (ConfigFile.type.ToUpper() == "Controller".ToUpper())
            if (ConfigFile.order == 0)
            {
                //Handling the controller run failure. If condition to check the controller's run information.
                XML.Generate(sp, "O");
                if (XML.ReadGeneratedSplogFileAndAssertOutcome(XML.combinedPath))
                {
                    throw new Exception("Test Outcome Failure was True.");
                }

                for (int i = 1; i <= ConfigFile.systems - 1; i++)
                {
                    sp.EndTime = DateTime.Now.ToString();
                    TFSFunctions.CollectResultFromTFS(i);
                }
            }
            XML.Generate(sp, "O");
        }