Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GetLastFailedState = func() ([]string, error) { meta := readLastFailedState() util.SetWorkingDir(config.ProjectRoot) if len(meta.FailedItems) == 0 { return nil, errors.New("No failed tests found.") } return meta.args(), nil }
View Source
var ReadPrevArgs = func() []string { contents, err := common.ReadFileContents(filepath.Join(config.ProjectRoot, common.DotGauge, lastRunCmdFileName)) if err != nil { logger.Fatalf(true, "Failed to read previous command information. Reason: %s", err.Error()) return nil } var args []string if err = json.Unmarshal([]byte(contents), &args); err != nil { logger.Fatalf(true, "Invalid previous command information. Reason: %s", err.Error()) return nil } return args }
View Source
var WritePrevArgs = func(cmdArgs []string) { b, err := json.MarshalIndent(cmdArgs, "", "\t") if err != nil { logger.Fatalf(true, "Unable to parse last run command. Error : %v", err.Error()) } prevCmdFile := filepath.Join(config.ProjectRoot, common.DotGauge, lastRunCmdFileName) dotGaugeDir := filepath.Join(config.ProjectRoot, common.DotGauge) if err = os.MkdirAll(dotGaugeDir, common.NewDirectoryPermissions); err != nil { logger.Fatalf(true, "Failed to create directory in %s. Reason: %s", dotGaugeDir, err.Error()) } err = ioutil.WriteFile(prevCmdFile, b, common.NewFilePermissions) if err != nil { logger.Fatalf(true, "Failed to write to %s. Reason: %s", prevCmdFile, err.Error()) } }
Functions ¶
func ListenFailedScenarios ¶
ListenFailedScenarios listens to execution events and writes the failed scenarios to JSON file
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.