Ejemplo n.º 1
0
        public void AddTestResult(string testName, string machineName, bool success) //, XDocument trxDocument)
        {
            if (string.IsNullOrEmpty(machineName) || testResults.Any(t => t.TestName == testName))
            {
                throw new ApplicationException("Test result already uploaded or machine name not set");
            }

            var tr = new TestResult()
            {
                TestName = testName, Success = success
            };                                                                  //  TestResultXml = trxDocument};

            testResults.Add(tr);

            Interlocked.Decrement(ref inProgressTests);
            Interlocked.Increment(ref completedTests);

            string ignored;

            activeTests.TryRemove(machineName, out ignored);

            if (InProgressTests == 0 && RemainingTests == 0)
            {
                RunStatus = RunStatus.Completed;
                CommandController.StartNextTestRun();
            }
            else
            {
                TestRunIdleTimer.Start(); //Start the idle timer. It will be reset when a machine next requests a test
            }
        }
Ejemplo n.º 2
0
 public void Stop()
 {
     //Only set to aborted if there's work remaining or in progress
     if (Interlocked.Read(ref remainingTests) + Interlocked.Read(ref inProgressTests) > 0)
     {
         RunStatus = RunStatus.Aborted;
         CommandController.StartNextTestRun();
     }
     TestRunIdleTimer.Stop();
     //Finished status is set when the final test returns a result, no need to set it here
 }