private void RunTestGroup( IGrouping <PythonProjectSettings, TestCase> testGroup, IRunContext runContext, IFrameworkHandle frameworkHandle ) { PythonProjectSettings settings = testGroup.Key; if (settings == null || settings.TestFramework != TestFrameworkType.Pytest) { return; } var testConfig = new PytestConfiguration(runContext); using (var executor = new ExecutorService( testConfig, settings, frameworkHandle, runContext) ) { executor.Run(testGroup, _cancelRequested); } var testResults = ParseResults(testConfig.ResultsXmlPath, testGroup, frameworkHandle); foreach (var result in testResults) { if (_cancelRequested.WaitOne(0)) { break; } frameworkHandle.RecordResult(result); } }
private void RunTestGroup( IGrouping <PythonProjectSettings, TestCase> testGroup, IRunContext runContext, IFrameworkHandle frameworkHandle ) { PythonProjectSettings settings = testGroup.Key; if (settings == null || settings.TestFramework != TestFrameworkType.Pytest) { return; } using (var executor = new ExecutorService(settings, frameworkHandle, runContext)) { bool codeCoverage = ExecutorService.EnableCodeCoverage(runContext); string covPath = null; if (codeCoverage) { covPath = ExecutorService.GetCoveragePath(testGroup); } var resultsXML = executor.Run(testGroup, covPath, _cancelRequested); // Default TestResults var pytestIdToResultsMap = testGroup.Select(tc => new TestResult(tc) { Outcome = TestOutcome.Skipped }) .ToDictionary(tr => tr.TestCase.GetPropertyValue <string>(Pytest.Constants.PytestIdProperty, String.Empty), tr => tr); if (File.Exists(resultsXML)) { try { var doc = JunitXmlTestResultParser.Read(resultsXML); Parse(doc, pytestIdToResultsMap, frameworkHandle); } catch (Exception ex) { frameworkHandle.SendMessage(TestMessageLevel.Error, ex.Message); } } else { frameworkHandle.SendMessage(TestMessageLevel.Error, Strings.PytestResultsXmlNotFound.FormatUI(resultsXML)); } foreach (var result in pytestIdToResultsMap.Values) { if (_cancelRequested.WaitOne(0)) { break; } frameworkHandle.RecordResult(result); } if (codeCoverage) { ExecutorService.AttachCoverageResults(frameworkHandle, covPath); } } }
public void Run() { Logger.Info($"{nameof(Run)}"); var report = ExecutorService.Setup(ScriptService.Current, ScriptService); NavMgr.NavigateTo($"/executor/{report.Id}"); ExecutorService.Run(report); }
protected void Run() { foreach (var(_, script) in ScriptGrid.GetCheckedItems()) { ExecutorService.Setup(script, ScriptService); } ExecutorService.Run(); }
private void OnItemClicked(string colName, Job report) { switch (colName) { case nameof(Script.Run): var newReport = ExecutorService.Setup(report, ScriptService); NavMgr.NavigateTo($"/executor/{report.Id}"); ExecutorService.Run(newReport); break; } }
private void OnItemClicked(string colName, Script script) { switch (colName) { case nameof(Script.Load): OnItemDoubleClicked(colName, script); break; case nameof(Script.Run): var report = ExecutorService.Setup(script, ScriptService); NavMgr.NavigateTo($"/executor/{report.Id}"); ExecutorService.Run(report); break; } }