rerun

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "rerun bugreport",
	Short: "Rerun the query from a given bug report",
	Args:  cobra.ExactArgs(1),
	Long: `This command allows you to rerun a query from a bug report.

By passing a generated bug report, this command reads in the included query and runs it against the target database.
This is useful for ensuring a bug's validity, for example if a new version of the target got released.
For debugging dinkel by regenerating a query given a bug report's byte string, check dinkel regenerate.`,
	Run: func(cmd *cobra.Command, args []string) {
		bugreport, err := config.ReadBugreport(args[0])
		if err != nil {
			logrus.Fatalf("Failed to get bugreport - %v", err)
		}

		targetConfig, err := cmd.Flags().GetString("target-config")
		if err != nil {
			logrus.Fatalf("Couldn't get target config - %v", err)
		}

		conf, err := config.GetConfigForTarget(bugreport.Target, targetConfig)
		if err != nil {
			logrus.Fatalf("Couldn't read target from supplied bugreport: %v", err)
		}

		res, err := Rerun(bugreport, conf)
		if err != nil && res != dbms.Crash {
			logrus.Fatalf("Rerunning bugreport didn't result in valid run - %v", err)
		}

		switch res {
		case dbms.Valid:
			logrus.Infof("Query was valid - %v", err)
		case dbms.Crash:
			logrus.Infof("Query caused database to crash - %v", err)
		default:
			logrus.Infof("statement resulted in non valid return type: %s", res.ToString())
		}
	},
}

Functions

func Rerun

func Rerun(bugreport *config.BugReport, conf scheduler.Config) (dbms.QueryResultType, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL