Example #1
0
func ExecuteSpecs(inParallel bool, args []string) int {
	if checkUpdatesDuringExecution && config.CheckUpdates() {
		i := &install.UpdateFacade{}
		i.BufferUpdateDetails()
		defer i.PrintUpdateBuffer()
	}

	env.LoadEnv(false)
	specsToExecute, conceptsDictionary := parseSpecs(args)
	manifest, err := manifest.ProjectManifest()
	if err != nil {
		logger.Fatal(err.Error())
	}
	runner := startApi()
	errMap := validateSpecs(manifest, specsToExecute, runner, conceptsDictionary)
	pluginHandler := plugin.StartPlugins(manifest)
	parallelInfo := &parallelInfo{inParallel: inParallel, numberOfStreams: NumberOfExecutionStreams}
	if !parallelInfo.isValid() {
		os.Exit(1)
	}
	execution := newExecution(&executionInfo{manifest, specsToExecute, runner, pluginHandler, parallelInfo, reporter.Current(), errMap})
	result := execution.start()
	execution.finish()
	exitCode := printExecutionStatus(result, errMap)
	return exitCode
}
Example #2
0
func ExecuteSpecs(specDirs []string) int {
	validateFlags()
	if config.CheckUpdates() {
		i := &install.UpdateFacade{}
		i.BufferUpdateDetails()
		defer i.PrintUpdateBuffer()
	}

	runner := startAPI()
	specs, errMap := validation.ValidateSpecs(specDirs, runner)
	ei := newExecutionInfo(specs, runner, nil, reporter.Current(), errMap, InParallel)
	e := newExecution(ei)
	return printExecutionStatus(e.run(), errMap)
}
Example #3
0
func ExecuteSpecs(args []string) int {
	validateFlags()
	if checkUpdatesDuringExecution && config.CheckUpdates() {
		i := &install.UpdateFacade{}
		i.BufferUpdateDetails()
		defer i.PrintUpdateBuffer()
	}

	specsToExecute, conceptsDictionary := parseSpecs(args)
	manifest, err := manifest.ProjectManifest()
	if err != nil {
		logger.Fatalf(err.Error())
	}
	runner := startAPI()
	errMap := validateSpecs(manifest, specsToExecute, runner, conceptsDictionary)
	executionInfo := newExecutionInfo(manifest, &specStore{specs: specsToExecute}, runner, nil, reporter.Current(), errMap, InParallel)
	execution := newExecution(executionInfo)
	execution.start()
	result := execution.run()
	execution.finish()
	exitCode := printExecutionStatus(result, errMap)
	return exitCode
}