Example #1
0
func ExecuteSpecs(inParallel bool, args []string) {
	env.LoadEnv(false)
	conceptsDictionary, conceptParseResult := parser.CreateConceptsDictionary(false)
	parser.HandleParseResult(conceptParseResult)
	specsToExecute, specsSkipped := filter.GetSpecsToExecute(conceptsDictionary, args)
	if len(specsToExecute) == 0 {
		printExecutionStatus(nil, 0)
	}
	parallelInfo := &parallelInfo{inParallel: inParallel, numberOfStreams: NumberOfExecutionStreams}
	if !parallelInfo.isValid() {
		os.Exit(1)
	}
	manifest, err := manifest.ProjectManifest()
	if err != nil {
		execLogger.CriticalError(err)
	}
	runner := startApi()
	validateSpecs(manifest, specsToExecute, runner, conceptsDictionary)
	pluginHandler := plugin.StartPlugins(manifest)
	execution := newExecution(manifest, specsToExecute, runner, pluginHandler, parallelInfo, execLogger.Current())
	result := execution.start()
	execution.finish()
	exitCode := printExecutionStatus(result, specsSkipped)
	os.Exit(exitCode)
}
Example #2
0
func parseSpecs(args []string) ([]*parser.Specification, *parser.ConceptDictionary) {
	conceptsDictionary, conceptParseResult := parser.CreateConceptsDictionary(false)
	parser.HandleParseResult(conceptParseResult)
	specsToExecute, _ := filter.GetSpecsToExecute(conceptsDictionary, args)
	if len(specsToExecute) == 0 {
		printExecutionStatus(nil, &validationErrMaps{})
	}
	return specsToExecute, conceptsDictionary
}
Example #3
0
func parseSpecs(args []string) ([]*gauge.Specification, *gauge.ConceptDictionary) {
	conceptsDictionary, conceptParseResult := parser.CreateConceptsDictionary(false, args)
	parser.HandleParseResult(conceptParseResult)
	specsToExecute, _ := filter.GetSpecsToExecute(conceptsDictionary, args)
	if len(specsToExecute) == 0 {
		logger.Info("No specifications found in %s.", strings.Join(args, ", "))
		os.Exit(0)
	}
	return specsToExecute, conceptsDictionary
}