Example #1
0
func Validate(args []string) {
	runner := startAPI()
	_, errMap := ValidateSpecs(args, runner)
	runner.Kill()
	if len(errMap.StepErrs) > 0 {
		os.Exit(1)
	}
	logger.Info("No error found.")
}
Example #2
0
func runAPIServiceIndefinitely(port int, wg *sync.WaitGroup) {
	wg.Add(1)
	startChan := &runner.StartChannels{RunnerChan: make(chan *runner.TestRunner), ErrorChan: make(chan error), KillChan: make(chan bool)}
	go StartAPIService(port, startChan)
	select {
	case runner := <-startChan.RunnerChan:
		runner.Kill()
	case <-startChan.ErrorChan:
	}
}
Example #3
0
func Validate(args []string) {
	specsToExecute, conceptsDictionary := parseSpecs(args)
	manifest, err := manifest.ProjectManifest()
	if err != nil {
		logger.Fatalf(err.Error())
	}
	runner := startAPI()
	errMap := validateSpecs(manifest, specsToExecute, runner, conceptsDictionary)
	runner.Kill()
	if len(errMap.stepErrs) > 0 {
		os.Exit(1)
	}
	logger.Info("No error found.")
	os.Exit(0)
}
Example #4
0
func CheckSpecs(args []string) {
	env.LoadEnv(false)
	specsToExecute, conceptsDictionary := parseSpecs(args)
	manifest, err := manifest.ProjectManifest()
	if err != nil {
		logger.Log.Critical(err.Error())
	}
	runner := startApi()
	errMap := validateSpecs(manifest, specsToExecute, runner, conceptsDictionary)
	runner.Kill()
	if len(errMap.stepErrs) > 0 {
		os.Exit(1)
	}
	logger.Log.Info("No error found.")
	os.Exit(0)
}
Example #5
0
func runAPIServiceIndefinitely(port int, specDirs []string) {
	startChan := &runner.StartChannels{RunnerChan: make(chan *runner.TestRunner), ErrorChan: make(chan error), KillChan: make(chan bool)}

	sig := &infoGatherer.SpecInfoGatherer{SpecDirs: specDirs}
	sig.MakeListOfAvailableSteps()
	go startAPIService(port, startChan, sig)
	go checkParentIsAlive(startChan)

	for {
		select {
		case runner := <-startChan.RunnerChan:
			logger.Info("Got a kill message. Killing runner.")
			runner.Kill()
		case err := <-startChan.ErrorChan:
			logger.Fatalf("Killing Gauge daemon. %v", err.Error())
		}
	}
}