func (agent *rephraseRefactorer) performRefactoringOn(specs []*parser.Specification, conceptDictionary *parser.ConceptDictionary) *refactoringResult { specsRefactored, conceptFilesRefactored := agent.rephraseInSpecsAndConcepts(&specs, conceptDictionary) result := &refactoringResult{Success: false, Errors: make([]string, 0), warnings: make([]string, 0)} if !agent.isConcept { var runner *runner.TestRunner select { case runner = <-agent.startChan.RunnerChan: case err := <-agent.startChan.ErrorChan: result.Errors = append(result.Errors, "Cannot perform refactoring: Unable to connect to runner."+err.Error()) return result } defer runner.Kill(execLogger.Current()) stepName, err, warning := agent.getStepNameFromRunner(runner) if err != nil { result.Errors = append(result.Errors, err.Error()) return result } if warning == nil { runnerFilesChanged, err := agent.requestRunnerForRefactoring(runner, stepName) if err != nil { result.Errors = append(result.Errors, fmt.Sprintf("Cannot perform refactoring: %s", err)) return result } result.runnerFilesChanged = runnerFilesChanged } else { result.warnings = append(result.warnings, warning.Message) } } specFiles, conceptFiles := writeToConceptAndSpecFiles(specs, conceptDictionary, specsRefactored, conceptFilesRefactored) result.specsChanged = specFiles result.Success = true result.conceptsChanged = conceptFiles return result }
func (e *parallelExecution) startSpecsExecutionWithRunner(s *gauge.SpecCollection, resChan chan *result.SuiteResult, runner *runner.TestRunner, reporter reporter.Reporter) { executionInfo := newExecutionInfo(s, runner, e.pluginHandler, reporter, e.errMaps, false) se := newSimpleExecution(executionInfo) se.execute() runner.Kill() resChan <- se.suiteResult }
func (e *parallelExecution) startSpecsExecutionWithRunner(specStore *specStore, suiteResultsChan chan *result.SuiteResult, runner *runner.TestRunner, reporter reporter.Reporter) { executionInfo := newExecutionInfo(e.manifest, specStore, runner, e.pluginHandler, reporter, e.errMaps, false) simpleExecution := newExecution(executionInfo) simpleExecution.start() result := simpleExecution.run() runner.Kill() suiteResultsChan <- result }
func validateSpecs(manifest *manifest.Manifest, specsToExecute []*parser.Specification, runner *runner.TestRunner, conceptDictionary *parser.ConceptDictionary) { validator := newValidator(manifest, specsToExecute, runner, conceptDictionary) validationErrors := validator.validate() if len(validationErrors) > 0 { printValidationFailures(validationErrors) runner.Kill(execLogger.Current()) os.Exit(1) } }
func (e *parallelSpecExecution) startSpecsExecutionWithRunner(specCollection *filter.SpecCollection, suiteResults chan *result.SuiteResult, runner *runner.TestRunner, writer execLogger.ExecutionLogger) { execution := newExecution(e.manifest, specCollection.Specs, runner, e.pluginHandler, ¶llelInfo{inParallel: false}, writer) result := execution.start() runner.Kill(e.writer) suiteResults <- result }
func (e *parallelSpecExecution) startSpecsExecutionWithRunner(specCollection *filter.SpecCollection, suiteResults chan *result.SuiteResult, runner *runner.TestRunner, logger *logger.GaugeLogger) { execution := newExecution(&executionInfo{e.manifest, specCollection.Specs, runner, e.pluginHandler, ¶llelInfo{inParallel: false}, logger, e.errMaps}) result := execution.start() runner.Kill() suiteResults <- result }