public bool LaunchExecutor(RunData runData)
        {
            IExecutorThread thread = null;
            lock (Threads)
            {
                if (!ThreadFactory.CanLaunch(Threads, runData))
                {
                    return false;
                }

                thread = ThreadFactory.Create(Executor, runData, this);
            }

            thread.Launch(this);
            return true;
        }
		internal UnitTestResult RunUnitTest (UnitTest test, string suiteName, string pathName, string testName, TestContext testContext)
		{
			var runnerExe = GetCustomConsoleRunnerCommand ();
			if (runnerExe != null)
				return RunWithConsoleRunner (runnerExe, test, suiteName, pathName, testName, testContext);

			var console = testContext.ExecutionContext.ConsoleFactory.CreateConsole ();

			ExternalTestRunner runner = new ExternalTestRunner ();
			runner.Connect (NUnitVersion, testContext.ExecutionContext.ExecutionHandler, console).Wait ();
			LocalTestMonitor localMonitor = new LocalTestMonitor (testContext, test, suiteName, testName != null);

			string[] filter = null;
			if (test != null) {
				if (test is UnitTestGroup && NUnitVersion == NUnitVersion.NUnit2) {
					filter = CollectTests ((UnitTestGroup)test);
				} else if (test.TestId != null) {
					filter = new string [] { test.TestId };
				}
			}

			RunData rd = new RunData ();
			rd.Runner = runner;
			rd.Test = this;
			rd.LocalMonitor = localMonitor;

			var cancelReg = testContext.Monitor.CancellationToken.Register (rd.Cancel);

			UnitTestResult result;
			var crashLogFile = Path.GetTempFileName ();

			try {
				if (string.IsNullOrEmpty (AssemblyPath)) {
					string msg = GettextCatalog.GetString ("Could not get a valid path to the assembly. There may be a conflict in the project configurations.");
					throw new Exception (msg);
				}

				string testRunnerAssembly, testRunnerType;
				GetCustomTestRunner (out testRunnerAssembly, out testRunnerType);

				testContext.Monitor.CancellationToken.ThrowIfCancellationRequested ();
					
				result = runner.Run (localMonitor, filter, AssemblyPath, "", new List<string> (SupportAssemblies), testRunnerType, testRunnerAssembly, crashLogFile).Result;
				if (testName != null)
					result = localMonitor.SingleTestResult;
				
				ReportCrash (testContext, crashLogFile);
				
			} catch (Exception ex) {
				if (ReportCrash (testContext, crashLogFile)) {
					result = UnitTestResult.CreateFailure (GettextCatalog.GetString ("Unhandled exception"), null);
				}
				else if (!localMonitor.Canceled) {
					LoggingService.LogError (ex.ToString ());
					if (localMonitor.RunningTest != null) {
						RuntimeErrorCleanup (testContext, localMonitor.RunningTest, ex);
					} else {
						testContext.Monitor.ReportRuntimeError (null, ex);
						throw;
					}
					result = UnitTestResult.CreateFailure (ex);
				} else {
					result = UnitTestResult.CreateFailure (GettextCatalog.GetString ("Canceled"), null);
				}
			} finally {
				if (console != null)
					console.Dispose ();
				cancelReg.Dispose ();
				runner.Dispose ();
				File.Delete (crashLogFile);
			}
			
			return result;
		}
		internal UnitTestResult RunUnitTest (UnitTest test, string suiteName, string testName, TestContext testContext)
		{
			ExternalTestRunner runner = (ExternalTestRunner) Runtime.ProcessService.CreateExternalProcessObject (typeof(ExternalTestRunner), testContext.ExecutionContext);
			LocalTestMonitor localMonitor = new LocalTestMonitor (testContext, runner, test, suiteName, testName != null);
			
			ITestFilter filter = null;
			
			if (testName != null) {
				filter = new TestNameFilter (suiteName + "." + testName);
			} else {
				NUnitCategoryOptions categoryOptions = (NUnitCategoryOptions) test.GetOptions (typeof(NUnitCategoryOptions));
				if (categoryOptions.EnableFilter && categoryOptions.Categories.Count > 0) {
					string[] cats = new string [categoryOptions.Categories.Count];
					categoryOptions.Categories.CopyTo (cats, 0);
					filter = new CategoryFilter (cats);
					if (categoryOptions.Exclude)
						filter = new NotFilter (filter);
				}
			}
			
			RunData rd = new RunData ();
			rd.Runner = runner;
			rd.Test = this;
			rd.LocalMonitor = localMonitor;
			testContext.Monitor.CancelRequested += new TestHandler (rd.Cancel);
			
			UnitTestResult result;
			
			try {
				if (string.IsNullOrEmpty (AssemblyPath)) {
					string msg = GettextCatalog.GetString ("Could not get a valid path to the assembly. There may be a conflict in the project configurations.");
					throw new Exception (msg);
				}
				System.Runtime.Remoting.RemotingServices.Marshal (localMonitor, null, typeof (IRemoteEventListener));
				result = runner.Run (localMonitor, filter, AssemblyPath, suiteName, new List<string> (SupportAssemblies));
				if (testName != null)
					result = localMonitor.SingleTestResult;
			} catch (Exception ex) {
				if (!localMonitor.Canceled) {
					LoggingService.LogError (ex.ToString ());
					if (localMonitor.RunningTest != null) {
						RuntimeErrorCleanup (testContext, localMonitor.RunningTest, ex);
					} else {
						testContext.Monitor.ReportRuntimeError (null, ex);
						throw ex;
					}
					result = UnitTestResult.CreateFailure (ex);
				} else {
					result = UnitTestResult.CreateFailure (GettextCatalog.GetString ("Canceled"), null);
				}
			} finally {
				testContext.Monitor.CancelRequested -= new TestHandler (rd.Cancel);
				runner.Dispose ();
				System.Runtime.Remoting.RemotingServices.Disconnect (localMonitor);
			}
			
			return result;
		}
		internal UnitTestResult RunUnitTest (UnitTest test, string suiteName, string pathName, string testName, TestContext testContext)
		{
			var runnerExe = GetCustomConsoleRunnerCommand ();
			if (runnerExe != null)
				return RunWithConsoleRunner (runnerExe, test, suiteName, pathName, testName, testContext);

			ExternalTestRunner runner = (ExternalTestRunner)Runtime.ProcessService.CreateExternalProcessObject (typeof(ExternalTestRunner), testContext.ExecutionContext, UserAssemblyPaths);
			LocalTestMonitor localMonitor = new LocalTestMonitor (testContext, test, suiteName, testName != null);

			ITestFilter filter = null;
			if (test != null) {
				if (test is UnitTestGroup) {
					var categoryOptions = (NUnitCategoryOptions) test.GetOptions (typeof(NUnitCategoryOptions));
					if (categoryOptions.EnableFilter && categoryOptions.Categories.Count > 0) {
						string[] cats = new string [categoryOptions.Categories.Count];
						categoryOptions.Categories.CopyTo (cats, 0);
						filter = new CategoryFilter (cats);
						if (categoryOptions.Exclude)
							filter = new NotFilter (filter);
					} else {
						filter = new TestNameFilter (CollectTests ((UnitTestGroup)test));
					}
				} else {
					filter = new TestNameFilter (test.TestId);
				}
			}

			RunData rd = new RunData ();
			rd.Runner = runner;
			rd.Test = this;
			rd.LocalMonitor = localMonitor;
			testContext.Monitor.CancelRequested += new TestHandler (rd.Cancel);

			UnitTestResult result;
			var crashLogFile = Path.GetTempFileName ();

			try {
				if (string.IsNullOrEmpty (AssemblyPath)) {
					string msg = GettextCatalog.GetString ("Could not get a valid path to the assembly. There may be a conflict in the project configurations.");
					throw new Exception (msg);
				}
				System.Runtime.Remoting.RemotingServices.Marshal (localMonitor, null, typeof (IRemoteEventListener));

				string testRunnerAssembly, testRunnerType;
				GetCustomTestRunner (out testRunnerAssembly, out testRunnerType);

				result = runner.Run (localMonitor, filter, AssemblyPath, "", new List<string> (SupportAssemblies), testRunnerType, testRunnerAssembly, crashLogFile);
				if (testName != null)
					result = localMonitor.SingleTestResult;
				
				ReportCrash (testContext, crashLogFile);
				
			} catch (Exception ex) {
				if (ReportCrash (testContext, crashLogFile)) {
					result = UnitTestResult.CreateFailure (GettextCatalog.GetString ("Unhandled exception"), null);
				}
				else if (!localMonitor.Canceled) {
					LoggingService.LogError (ex.ToString ());
					if (localMonitor.RunningTest != null) {
						RuntimeErrorCleanup (testContext, localMonitor.RunningTest, ex);
					} else {
						testContext.Monitor.ReportRuntimeError (null, ex);
						throw;
					}
					result = UnitTestResult.CreateFailure (ex);
				} else {
					result = UnitTestResult.CreateFailure (GettextCatalog.GetString ("Canceled"), null);
				}
			} finally {
				File.Delete (crashLogFile);
				testContext.Monitor.CancelRequested -= new TestHandler (rd.Cancel);
				runner.Dispose ();
				System.Runtime.Remoting.RemotingServices.Disconnect (localMonitor);
			}
			
			return result;
		}
        public bool CanLaunch(IList<IExecutorThread> threads, RunData runData)
        {
            if (runData.Groups.Count == 0 ||
                   threads.Count == 0)
            {
                return true;
            }

            foreach (IExecutorThread item in threads)
            {
                RunData data = item.GetRunData();
                if (data.Exclusive ||
                    (data.Groups.Count > 0 && runData.Exclusive))
                {
                    return false;
                }

                foreach (string group in data.Groups)
                {
                    if (runData.Groups.Contains(group))
                    {
                        return false;
                    }
                }
            }

            return true;
        }
Beispiel #6
0
        public override int DoLogic()
        {
            TaxonomyReader taxoReader = RunData.GetTaxonomyReader();

            RunData.SetTaxonomyReader(null);
            if (taxoReader.RefCount != 1)
            {
                Console.WriteLine("WARNING: CloseTaxonomyReader: reference count is currently " + taxoReader.RefCount);
            }
            taxoReader.Dispose();
            return(1);
        }
        public void Run(RunData data)
        {
            FileHelper.CreateSettingsFile(data);
            FileHelper.CreateExecutionFolder(data);
            var info = ProcessStartInfoFactory.CreateProcessStartInfo(data);

            FileHelper.CreateInputFile(data, info);
            var processReader = ProcessOutputReaderFactory.CreateReader(data);

            ProcessFactory.StartProcessAndWait(info, processReader);
            FileHelper.CreateOutputFile(data);
        }
        public void CreatRunDatalist()
        {//建立班次和生产数的list
            m_RunDataList.Clear();
            string         EXEPath = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
            string         dbPath  = EXEPath + "Demo.db3";
            string         sql     = "select * from RunningLog";
            SQLiteDBHelper db      = new SQLiteDBHelper(dbPath);

            string stStarttime  = "";
            string stStoptime   = "";
            int    ProduceCount = 0;
            string TypeStart    = "start";
            string TypeStop     = "stop";
            string TypeCount    = "Produce";

            using (SQLiteDataReader reader = db.ExecuteReader(sql, null))
            {
                while (reader.Read())
                {
                    string stID       = reader["id"].ToString();
                    string stdatetime = reader["datetime"].ToString();
                    string stType     = reader["Type"].ToString();
                    string stcount    = reader["count"].ToString();
                    string stRelateID = reader["RelateID"].ToString();
                    string IsPost     = reader["IsPost"].ToString();

                    if (stType.Equals(TypeStart) && string.IsNullOrEmpty(stStarttime))
                    {
                        stStarttime = stdatetime;
                        RunData run = new RunData(stStarttime, stStoptime, ProduceCount);
                        m_RunDataList.Add(run);
                    }

                    if (stType.Equals(TypeCount) && !string.IsNullOrEmpty(stStarttime))
                    {
                        ProduceCount += Convert.ToInt32(stcount);
                        int nListLenght = m_RunDataList.Count();
                        m_RunDataList[nListLenght - 1].count = ProduceCount;
                    }

                    if (stType.Equals(TypeStop) && !string.IsNullOrEmpty(stStarttime))
                    {
                        stStoptime = stdatetime;
                        int nListLenght = m_RunDataList.Count();
                        m_RunDataList[nListLenght - 1].Stoptime = stStoptime;
                        stStarttime  = "";
                        ProduceCount = 0;
                        stStoptime   = "";
                    }
                }
            }
        }
        public void Execute()
        {
            if (WindowsFileHelper.FolderExist(Args.Root) == false)
            {
                WindowsFileHelper.CreateFolder(Args.Root);
            }

            IRunDataEnumerator enumerator = RunDataListBuilder.GetEnumerator();

            if (enumerator.HasItems() == false)
            {
                Console.WriteLine("Test Classes where not found, nothing to run");
                return;
            }

            while (enumerator.HasItems())
            {
                if (Breaker.IsBreakReceived())
                {
                    return;
                }

                ExecutorLauncher.WaitForAnyThreadToComplete();
                while (ExecutorLauncher.HasFreeThreads())
                {
                    if (Breaker.IsBreakReceived())
                    {
                        return;
                    }

                    if (!enumerator.HasItems())
                    {
                        break;
                    }

                    RunData data = enumerator.PeekNext();
                    if (null == data)
                    {
                        // if peeked all items till the end, but none of them was valid to launch a thread (due to concurrent groups)
                        break;
                    }

                    if (ExecutorLauncher.LaunchExecutor(data))
                    {
                        // if launching succeded (group was valid)
                        enumerator.MoveNext();
                    }
                }
            }

            ExecutorLauncher.WaitForAll();
        }
Beispiel #10
0
        public async void Run(Guid runId)
        {
            if (_processingTask != null)
            {
                await CancelExistingRun();
            }

            if (_cancelToken != null)
            {
                _cancelToken.Cancel();
                _cancelToken.Dispose();
            }
            _cancelToken = new CancellationTokenSource();

            _processingTask = Task.Run(async() =>
            {
                _processingStartedOn = DateTime.Now;

                using (var scope = _serviceScopeFactory.CreateScope())
                {
                    var runsRepository = scope.ServiceProvider.GetRequiredService <AppKeyRepository <Run> >();

                    ProcessingRun      = runsRepository.Read <RunReadModel>().SingleOrDefault(r => r.Id == runId);
                    _processingRunData = new RunData(ProcessingRun);

                    if (ProcessingRun == null)
                    {
                        throw new ToolsException($"Cannot find run with id {runId}.");
                    }
                }

                await SaveRunData();

                foreach (var testRun in ProcessingRun.TestRuns)
                {
                    await ProcessTestRun(testRun);
                }

                _processingFinishedOn     = DateTime.Now;
                _processingRunData.Status = RunStatus.Finished;

                await SaveRunData();
                SendRunData(() =>
                {
                    ProcessingRun         = null;
                    _processingRunData    = null;
                    _processingTask       = null;
                    _processingStartedOn  = null;
                    _processingFinishedOn = null;
                });
            });
        }
Beispiel #11
0
    private void OnEndGame(RunData result)
    {
        underControll = false;

        StopCoroutine(trailPainter);
        trail.enabled = false;

        rigidBody.velocity = Vector2.zero;
        transform.position = startPosition;

        acceleration = new Vector3(0, -1);
        gameObject.SetActive(true);
    }
Beispiel #12
0
        public RunData RecordDataPoint(int et)
        {
            RunData runData = new RunData(app.currentRecord.ID, et, DateTime.Now.Ticks, 0, 0);

            DB.Write(runData);
            app.currentLapData.Add(runData);

            if (et == RunData.MANUEL_LAP)
            {
                app.lapSW.ResetTime();
            }
            return(runData);
        }
Beispiel #13
0
 private bool TryGetRunData(Human hu, out RunData runData)
 {
     runData = null;
     foreach (var rd in _runDatas)
     {
         if (rd.Human == hu)
         {
             runData = rd;
             return(true);
         }
     }
     return(false);
 }
Beispiel #14
0
        public override int DoLogic()
        {
            DirectoryReader r  = RunData.GetIndexReader();
            DirectoryReader nr = DirectoryReader.OpenIfChanged(r);

            if (nr != null)
            {
                RunData.SetIndexReader(nr);
                nr.DecRef();
            }
            r.DecRef();
            return(1);
        }
Beispiel #15
0
 private bool TryGetStagedRunData(Human hu, int stage, out RunData runData)
 {
     runData = null;
     foreach (var rd in _stageRunDatas)
     {
         if (rd.Human == hu && rd.Stage == stage)
         {
             runData = rd;
             return(true);
         }
     }
     return(false);
 }
Beispiel #16
0
        private IEnumerator awaitCoroutine(IEnumerator another)
        {
            yield return(StartCoroutine(another));

            RunData result = Singleton.Instanse.AddRun(new RunData(Score, (int)generator.meters));             //save here

            Debug.Log("EndGame");
            if (OnEndGame != null)
            {
                OnEndGame(result);
            }
            State = LevelState.Stop;
        }
        public void Create()
        {
            IExecutor      executor = Stub <IExecutor>();
            IThreadStarter starter  = Stub <IThreadStarter>();
            RunData        data     = new RunData();

            starter.Expect((m) => m.OnStarted(Arg <IExecutorThread> .Is.NotNull));

            IExecutorThread thread = VerifyTarget(() => target.Create(executor, data, starter));

            Assert.AreEqual(data, thread.GetRunData());
            Assert.AreEqual(executor, thread.GetExecutor());
            Assert.IsNull(thread.GetTask());
        }
        public void CanLaunch_NoGroups()
        {
            IList <IExecutorThread> threads = new List <IExecutorThread>()
            {
                Stub <IExecutorThread>()
            };
            RunData data = new RunData()
            {
                Groups = new HashSet <string>()
            };
            bool actual = target.CanLaunch(threads, data);

            Assert.IsTrue(actual);
        }
Beispiel #19
0
        public bool TryMerge(RunData run)
        {
            if (IsBold == run.IsBold &&
                IsItalic == run.IsItalic &&
                IsStrikethrough == run.IsStrikethrough &&
                IsCode == run.IsCode &&
                LinkUrl == run.LinkUrl)
            {
                Text += run.Text;
                return(true);
            }

            return(false);
        }
Beispiel #20
0
        static void Main(string[] args)
        {
            List <string> argList = new List <string>(args);

            runData = new RunData()
            {
                uassetFileName = argList.TakeArg(),
                pendingArgs    = argList
            };

            string command = argList.TakeArg();

            commands[command]();
        }
        /// <summary>
        /// Specific method that sends the runtime to the server for a given sample.
        /// </summary>
        /// <param name="rd">The run data instance which contains the exit code and runtime.</param>
        /// <param name="testId">The id of the test</param>
        public void SendExitCodeAndRuntime(RunData rd, int testId)
        {
            // Post equality status
            using (var wb = new WebClient())
            {
                var d = new NameValueCollection();
                d["exitCode"] = rd.ExitCode.ToString();
                d["runTime"]  = Convert.ToInt32(rd.Runtime.TotalMilliseconds).ToString();
                d["test_id"]  = testId.ToString();
                d["type"]     = "finish";

                var response = wb.UploadValues(reportUrl, "POST", d);
            }
        }
Beispiel #22
0
    public void ShowLastScore(RunData result)
    {
        int place = Singleton.Instanse.data.GetPlace(result);

        if (place > 0)
        {
            LastScore.color = Color.green;
            LastScore.text  = string.Format("CONGRATULATIONS!!! PLACE: {2}\nDISTANCE: {0}\tSCORE: {1}", result.distance, result.score, place);
        }
        else
        {
            LastScore.color = Color.white;
            LastScore.text  = string.Format("DISTANCE: {0}\nSCORE: {1}", result.distance, result.score);
        }
    }
Beispiel #23
0
        protected override bool SolveProblem(RunData data)
        {
            string zal = Path.ChangeExtension(data.Get("broken_db"), ".zal");

            if (!File.Exists(zal))
            {
                ExecutionResult = "Troubleshooter nenašiel zálohu";
                return(false);
            }
            ExecutionResult = "Databázu sa nepodarilo obnoviť zo zálohy";
            File.Delete(data.Get("broken_db"));
            File.Copy(zal, Path.ChangeExtension(zal, ".mdb"));
            ExecutionResult = "Databáza bola úspešne obnovená zo zálohy.";
            return(true);
        }
Beispiel #24
0
        //扫描方法
        public void scan(Object config)
        {
            Config cfg = (Config)config;

            stp = new SmartThreadPool(50, bt_thread_size, bt_thread_size);
            foreach (String url in this.bt_list_url)
            {
                RunData rd = new RunData();
                rd.CFG = cfg;
                rd.URL = url;
                stp.QueueWorkItem <Object>(batchGetShell, rd);
            }

            stp.WaitForIdle();
            stopScan();
        }
        public void Clean()
        {
            RunData         a     = new RunData();
            RunData         b     = new RunData();
            IList <RunData> items = new List <RunData> {
                a, b
            };

            using (Ordered())
            {
                fileHelper.Expect(m => m.CleanRootFolder(a));
                fileHelper.Expect(m => m.CleanRootFolder(b));
            }

            VerifyTarget(() => target.Clean(items));
        }
    void WriteData(RunData data)
    {
        dataWriter = new StreamWriter(Application.persistentDataPath + "/" + _participantNumber.ToString() + dataFilename, true);
        dataWriter.WriteLine();
        dataWriter.WriteLine("Current method: " + currentMethod);

        dataWriter.WriteLine("Total Time:");
        dataWriter.WriteLine(data.totalTime.ToString());

        dataWriter.WriteLine("Total Distance:");
        dataWriter.WriteLine(data.totalDistanceTraveled.ToString());

        dataWriter.WriteLine("Total Steps:");
        dataWriter.WriteLine(data.totalSteps.ToString());

        dataWriter.WriteLine("Waypoint Coordinates:");
        foreach (Vector3 point in data.waypoints)
        {
            dataWriter.WriteLine(point.x.ToString() + " " + point.z.ToString());
        }

        dataWriter.WriteLine("Waypoint Distances");
        foreach (float dist in data.distancesWaypoint)
        {
            dataWriter.WriteLine(dist.ToString());
        }

        dataWriter.WriteLine("Actual Distances Moved");
        foreach (float dist in data.distancesMoved)
        {
            dataWriter.WriteLine(dist.ToString());
        }

        dataWriter.WriteLine("Times for each waypoint");
        foreach (float time in data.times)
        {
            dataWriter.WriteLine(time.ToString());
        }

        dataWriter.WriteLine("Obstacle order");
        foreach (int obstacle in data.obstacle)
        {
            dataWriter.WriteLine(obstacle.ToString());
        }

        dataWriter.Close();
    }
Beispiel #27
0
        private void OnEndGame(RunData result)
        {
            generate = false;

            foreach (Border b in up)
            {
                ObjectPool.ReturnToPool(b);
            }
            up.container.Clear();

            foreach (Border b in down)
            {
                ObjectPool.ReturnToPool(b);
            }
            down.container.Clear();
            FillDefault();
        }
        public bool LaunchExecutor(RunData runData)
        {
            IExecutorThread thread = null;

            lock (Threads)
            {
                if (!ThreadFactory.CanLaunch(Threads, runData))
                {
                    return(false);
                }

                thread = ThreadFactory.Create(Executor, runData, this);
            }

            thread.Launch(this);
            return(true);
        }
Beispiel #29
0
        private void Staged_ExitStart(int stage, Human hu)
        {
            _stageRunDatas.RemoveAll(x => x.Human == hu && x.Stage != stage);

            if (!TryGetStagedRunData(hu, stage, out RunData rd))
            {
                var tl = hu.Game.Get <FSTimeline>();
                rd = new RunData()
                {
                    Human = hu,
                    Stage = stage,
                    Track = tl.CreateTrack(hu)
                };
                _stageRunDatas.Add(rd);
            }
            rd.Reset();
        }
Beispiel #30
0
 // Token: 0x06001137 RID: 4407 RVA: 0x000649C0 File Offset: 0x00062BC0
 internal static void CleanUpOldGrammarRuns(RunData runData, Trace Tracer)
 {
     Utils.TryDiskOperation(delegate
     {
         Guid runId = Guid.Empty;
         try
         {
             string grammarManifestPath = GrammarFileDistributionShare.GetGrammarManifestPath(runData.OrgId, runData.MailboxGuid);
             GrammarGenerationMetadata grammarGenerationMetadata = GrammarGenerationMetadata.Deserialize(grammarManifestPath);
             runId = grammarGenerationMetadata.RunId;
         }
         catch (Exception obj)
         {
             UmGlobals.ExEvent.LogEvent(UMEventLogConstants.Tuple_ReadLastSuccessRunIDFailed, null, new object[]
             {
                 runData.TenantId,
                 runData.RunId,
                 CommonUtil.ToEventLogString(obj)
             });
         }
         string grammarGenerationRunFolderPath = GrammarFileDistributionShare.GetGrammarGenerationRunFolderPath(runData.OrgId, runData.MailboxGuid, runId);
         string grammarFolderPath = GrammarFileDistributionShare.GetGrammarFolderPath(runData.OrgId, runData.MailboxGuid);
         string[] directories     = Directory.GetDirectories(grammarFolderPath);
         foreach (string text in directories)
         {
             string fileName = Path.GetFileName(text);
             Guid b;
             if (Guid.TryParse(fileName, out b) && runData.RunId != b && string.Compare(text, grammarGenerationRunFolderPath, StringComparison.OrdinalIgnoreCase) != 0)
             {
                 Utilities.DebugTrace(Tracer, "Deleting run directory '{0}'", new object[]
                 {
                     text
                 });
                 Directory.Delete(text, true);
             }
         }
     }, delegate(Exception exception)
     {
         UmGlobals.ExEvent.LogEvent(UMEventLogConstants.Tuple_GrammarGenerationCleanupFailed, null, new object[]
         {
             runData.TenantId,
             runData.RunId,
             CommonUtil.ToEventLogString(exception)
         });
     });
 }
Beispiel #31
0
        private static RunStepResult DiscoverSequencePoints(IRunExecutorHost host, RunStartParams rsp, RunStepInfo rsi)
        {
            var sequencePoint = Instrumentation.GenerateSequencePointInfo(host, rsp);

            if (sequencePoint != null)
            {
                sequencePoint.Serialize(rsp.DataFiles.SequencePointStore);
            }

            var totalSP = sequencePoint.Values.Aggregate(0, (acc, e) => acc + e.Count);

            TelemetryClient.TrackEvent(rsi.name.Item, new Dictionary <string, string>(), new Dictionary <string, double> {
                { "SequencePointCount", totalSP }
            });

            return(RunStepStatus.Succeeded.ToRSR(RunData.NewSequencePoints(sequencePoint), "Binaries Instrumented - which ones - TBD"));
        }
    private static void DrawMinMaxMarkers(Rect rect, RunData data, int frames)
    {
        var c = Color.red;

        c.a           = 0.5f;
        Handles.color = c;
        var maxX = Mathf.Lerp(rect.xMin, rect.xMax, (float)data.MaxFrame.frameIndex / frames);

        Handles.DrawLine(new Vector2(maxX, rect.yMin), new Vector2(maxX, rect.yMax));

        c             = Color.green;
        c.a           = 0.5f;
        Handles.color = c;
        var minX = Mathf.Lerp(rect.xMin, rect.xMax, (float)data.MinFrame.frameIndex / frames);

        Handles.DrawLine(new Vector2(minX, rect.yMin), new Vector2(minX, rect.yMax));
    }
Beispiel #33
0
        public override int DoLogic()
        {
            Store.Directory dir = RunData.Directory;
            DirectoryReader r   = null;

            if (commitUserData != null)
            {
                r = DirectoryReader.Open(OpenReaderTask.FindIndexCommit(dir, commitUserData));
            }
            else
            {
                r = DirectoryReader.Open(dir);
            }
            RunData.SetIndexReader(r);
            // We transfer reference to the run data
            r.DecRef();
            return(1);
        }
Beispiel #34
0
        public static async Task <string> SendControllerData(string site, RunData data, bool runNow = false)
        {
            string msg = "";
            await Task.Run(() =>
            {
                System.Net.WebClient wc = new System.Net.WebClient();

                string url = AquaControllerCmd.FillTemplate(site, data, runNow);

                string webData = wc.DownloadString(url);
                var message    = RunDataMessage.Deserialize(webData);
                msg            = message.msg;

                //msg = url;
            });

            return(msg);
        }
Beispiel #35
0
        /// <summary>
        /// Load partymanager specific values from saveData
        /// </summary>
        /// <param name="data"></param>
        public void LoadData(RunData data)
        {
            WAX = data.WAX;
            ID  = 0;
            for (int i = partyMembersAll.Count - 1; i >= 0; i--)       // not sure if this is redundant
            {
                Destroy(partyMembersAll[i].gameObject);
            }
            partyMembersAll.Clear();
            partyMembersAlive.Clear();
            partyMembersDead.Clear();

            foreach (PartyMemberData pmData in data.partyMemberDatas)
            {
                PartyManager.instance.AddPartyMember(pmData);
            }
            PartyManager.instance.CalculateMultipliers();
        }
        private RunData CreateNewFromFixture(TestAssembly testAssembly, TestFixture fixture)
        {
            RunData item = new RunData()
            {
                Fixtures = new List<TestFixture>() { fixture },
                Root = Args.Root,
                Output = new StringBuilder(),
                Groups = new HashSet<string>(),
                Exclusive = fixture.Exclusive ?? false,
                Executable = Args.GetExecutablePath(),
                RunId = Guid.NewGuid(),
                AssemblyName = testAssembly.Name
            };
            if (!string.IsNullOrEmpty(fixture.Group))
            {
                item.Groups.Add(fixture.Group);
            }

            return item;
        }
 public HostedStressRun(RunData runData)
     : base(runData)
 {
     ScenarioName = base.GetContractName() + "-" + RunData.Host + "-" + RunData.Transport;
 }
        internal UnitTestResult RunUnitTest(UnitTest test, string suiteName, TestContext testContext)
        {
            ExternalTestRunner runner = (ExternalTestRunner) Runtime.ProcessService.CreateExternalProcessObject (typeof(ExternalTestRunner), false);
            LocalTestMonitor localMonitor = new LocalTestMonitor (testContext, runner, test, suiteName);

            IFilter filter = null;

            NUnitCategoryOptions categoryOptions = (NUnitCategoryOptions) test.GetOptions (typeof(NUnitCategoryOptions));
            if (categoryOptions.EnableFilter && categoryOptions.Categories.Count > 0) {
                string[] cats = new string [categoryOptions.Categories.Count];
                categoryOptions.Categories.CopyTo (cats, 0);
                filter = new CategoryFilter (cats, categoryOptions.Exclude);
            }

            RunData rd = new RunData ();
            rd.Runner = runner;
            rd.Test = this;
            testContext.Monitor.CancelRequested += new TestHandler (rd.Cancel);

            UnitTestResult result;

            try {
                TestResult res = runner.Run (localMonitor, filter, AssemblyPath, suiteName, null);
                result = localMonitor.GetLocalTestResult (res);
            } catch (Exception ex) {
                Console.WriteLine (ex);
                if (localMonitor.RunningTest != null) {
                    RuntimeErrorCleanup (testContext, localMonitor.RunningTest, ex);
                } else {
                    testContext.Monitor.ReportRuntimeError (null, ex);
                    throw ex;
                }
                result = UnitTestResult.CreateFailure (ex);
            } finally {
                testContext.Monitor.CancelRequested -= new TestHandler (rd.Cancel);
                runner.Dispose ();
            }

            return result;
        }
 public ExecutorThreadImpl(IExecutor executor, RunData runData)
 {
     this.executor = executor;
     this.runData = runData;
 }
 public SimpleEchoHubRun(RunData runData)
     : base(runData)
 {
     _categoryString = String.Format("{0};{1}", ScenarioName, "Latency in Milliseconds");
     _connections = new HubConnection[Connections];
     _proxies = new HubProxy[Connections];
 }
Beispiel #41
-1
 public StressRunBase(RunData runData)
 {
     RunData = runData;
     Resolver = new DefaultDependencyResolver();
     CancellationTokenSource = new CancellationTokenSource();
     _countDown = new CountdownEvent(runData.Senders);
 }
 public ClientServerMemoryRun(RunData runData)
     : base(runData)
 {
     _connections = new Connection[runData.Connections];
     for (int i = 0; i < runData.Connections; i++)
     {
         _connections[i] = new Connection("http://memoryhost/echo");
     }
 }
        public SimpleEchoHubRun(RunData runData)
            : base(runData)
        {
            Debug.Assert(Connections == Senders);

            _categoryString = String.Format("{0};{1}", ScenarioName, "Latency;Milliseconds");
            _connections = new HubConnection[Connections];
            _proxies = new HubProxy[Connections];
            _callbacks = new TaskCompletionSource<bool>[Connections];
        }
 public IExecutorThread Create(IExecutor executor, RunData data, IThreadStarter starter)
 {
     IExecutorThread thread = new ExecutorThreadImpl(executor, data);
     starter.OnStarted(thread);
     return thread;
 }
        public ServiceBusMessageBusRun(RunData runData)
            : base(runData)
        {

        }
 public ConcurrentCallsRun(RunData runData)
     : base(runData)
 {
 }
        public RedisMessageBusRun(RunData runData)
            : base(runData)
        {

        }
Beispiel #48
-1
        public SqlMessageBusRun(RunData runData)
            : base(runData)
        {

        }
Beispiel #49
-1
 public HostedRun(RunData runData)
     : base(runData)
 {
 }