private void LaunchNextIteration(Parameters parameters) { // increment the counter int count = GetCounter(parameters.xpluginstate) + 1; SetCounter(parameters.xpluginstate, count); // figure out name string commadelimitedlist = string.Join(",", GetMethodlist(parameters.xpluginstate).ToArray()); string name = "Run " + count; if (!string.IsNullOrEmpty(commadelimitedlist)) { name = name + " [" + commadelimitedlist + "]"; } // prepare a new run XElement xrun = TestRunEntity.CreateRunXPrototype(name); // add chess parameters for the run (selected by user from context menu) foreach (XElement xchessarg in parameters.xchessargs) { xrun.Add(xchessarg); } // add preemption variable parameter if (!string.IsNullOrEmpty(commadelimitedlist)) { xrun.Add(new XElement(XSessionNames.PreemptionVars, commadelimitedlist)); } // launch the run parameters.engine.LaunchPlugin(xrun); }
private void SetRun(TaskRunEntity run) { // Clear everything first suspend_selection_notify = true; dataGridView1.Rows.Clear(); rowmap.Clear(); resultmap.Clear(); TestRunEntity testRun = run as TestRunEntity; if (testRun != null && testRun.Result != null) { var results = testRun.Result.GetChessResults(); bool clearSel = false; foreach (var result in results) { string label = result.Label; resultmap[label] = result; //bool hasschedule = result.DataElement.Element(XNames.Schedule) != null; //bool hastrace = run.Entity.TaskHandle.GetTraceFile() != null; int newrow = dataGridView1.Rows.Add(result.Label, result.Description); DataGridViewRow row = dataGridView1.Rows[newrow]; rowmap[label] = row; row.Cells[1].Style.ForeColor = result.ResultType.GetDisplayColor(); } if (clearSel) { dataGridView1.ClearSelection(); } } _testRun = testRun; suspend_selection_notify = false; }
public void Post([FromBody] TestRunData testRunData) { var elapsed = testRunData.ElapsedSeconds; // TODO: Need to send along build source from the test runner. var buildSource = BuildSource.CreateAnonymous(); var runDate = DateTime.UtcNow; var entity = new TestRunEntity(runDate, buildSource) { CacheType = testRunData.Cache, ElapsedSeconds = elapsed, Succeeded = testRunData.Succeeded, IsJenkins = testRunData.IsJenkins, Is32Bit = testRunData.Is32Bit, CacheCount = testRunData.CacheCount, ChunkCount = testRunData.ChunkCount, AssemblyCount = testRunData.AssemblyCount, JenkinsUrl = testRunData.JenkinsUrl, HasErrors = testRunData.HasErrors, }; var testRunTable = _storageAccount.CreateCloudTableClient().GetTableReference(AzureConstants.TableNames.TestRunData); _statsUtil.AddTestRun(entity.Succeeded, entity.IsJenkins); var operation = TableOperation.Insert(entity); testRunTable.Execute(operation); }
/// <summary> /// Подсветка выбранного запуска в меню /// </summary> private void HighlightSelectedRun() { var menuItems = TestingRunMenuItem.Items.OfType <MenuItem>(); TestRunEntity selectedEntity = _selectedRunFolder; foreach (var item in from item in menuItems let header = item.Header.ToString() where string.Compare(selectedEntity.ToString(), header, StringComparison.CurrentCultureIgnoreCase) == 0 select item) { item.Background = UiUtils.DefaulHighlightBrush; break; } }
/// <summary> /// Извлечение сущности тестового запуска /// </summary> /// <param name="existingTestRun">Абсолютный путь к директории тестового запуска</param> /// <returns>Cущность тестового запуска</returns> public static TestRunEntity ObtainTestRunEntity(string existingTestRun) { var fileName = Path.GetFileName(existingTestRun); string machineName; DateTime testingDateTime; AnalyzerUtilities.ExtractLaunchPartyComponents(fileName, out machineName, out testingDateTime); var runEntity = new TestRunEntity { TestRunDirectory = existingTestRun, MachineName = machineName, RunningDateTime = testingDateTime }; return(runEntity); }
/// <summary> /// Обновление модели для тестового запуска /// </summary> /// <param name="testingRunFolder">Директория тестового запуска</param> /// <returns>Актуальная версия модели тестового запуска</returns> public static IEnumerable <SolutionInfoViewModel> RefreshTestingRunModel(string testingRunFolder) { var testingRunModel = RetrieveSlnInfoViewModels(); var testRunFolderName = Path.GetFileName(testingRunFolder); string machineName; DateTime testingDateTime; AnalyzerUtilities.ExtractLaunchPartyComponents(testRunFolderName, out machineName, out testingDateTime); var runEntity = new TestRunEntity { TestRunDirectory = testingRunFolder, MachineName = machineName, RunningDateTime = testingDateTime }; RestoreTestRunState(Tuple.Create(runEntity, testingRunModel)); return(testingRunModel); }
private void ConfigureFileSystemWatcher() { var newTestWatcher = new FileSystemWatcher(ApplicationConfigReader.Instance.Viva64Logs) { NotifyFilter = NotifyFilters.FileName | NotifyFilters.DirectoryName }; newTestWatcher.Created += (sender, args) => { if (args.ChangeType != WatcherChangeTypes.Created) { return; } var newDirName = args.Name; string machineName; DateTime testingDateTime; AnalyzerUtilities.ExtractLaunchPartyComponents(newDirName, out machineName, out testingDateTime); var newRunEntity = new TestRunEntity { MachineName = machineName, RunningDateTime = testingDateTime, TestRunDirectory = args.FullPath }; RunInUiSynchronizationContext(() => { var newItem = new MenuItem { Header = newRunEntity.ToString() }; TestingRunMenuItem.Items.Insert(0, newItem); HighlightFirstMenuItem(); UiUtils.SetMenuItemsEnabled(TestingRunMenuItem, false); }); _selectedRunFolder = newRunEntity.TestRunDirectory; }; newTestWatcher.EnableRaisingEvents = true; }
private static IEnumerable <SolutionInfoViewModel> RestoreTestRunState(TestRunEntity runEntity, SolutionInfoViewModel[] solutions) { foreach (var configMode in Enum.GetValues(typeof(StartupConfigurationMode)).Cast <StartupConfigurationMode>()) { if (configMode == StartupConfigurationMode.All) { continue; } var testRunDir = Path.Combine(runEntity.TestRunDirectory, configMode.ToString()); if (!Directory.Exists(testRunDir)) { continue; } // Для этого режима конфигурации были тестовые запуски var projectStateMap = GetProjectStateMap(testRunDir); SetSolutionsState(projectStateMap, solutions, configMode); } return(solutions); }