tests

package
v1.0.43 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestdataSource   = "dataviewer:/testdata"
	PrometheusSource = "prometheus:/prometheus/data"
)
View Source
const GraceMonitoringPeriod = 2 * 15 * time.Second

GraceMonitoringPeriod is used to compensate for the misalignment between the termination time of the container, and the next scraping of Prometheus. Normally, it should be twice the scrapping period (which by default is 15s).

View Source
const (
	User = "'':''" // Not really needed since we have no authentication in Grafana.
)

Variables

View Source
var DefaultDashboards = []string{"summary", "singleton"}

Functions

func ControlOutput

func ControlOutput(ctx context.Context, testName string, options *SubmitTestCmdOptions)

func DeleteTestCmdCompletion added in v1.0.37

func DeleteTestCmdCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func DeleteTestCmdFlags added in v1.0.37

func DeleteTestCmdFlags(cmd *cobra.Command, options *DeleteTestCmdOptions)

func FindTimeline added in v1.0.32

func FindTimeline(scenario *v1alpha1.Scenario) (from int64, to int64)
For the ending time we adhere to these rules:
 1. If the scenario is successful, we return the ConditionAllJobsAreCompleted time.
 2. If the scenario has failed, we return the Failure time.
 3. Otherwise, we report time.Now().

---------------------------------------------------

func InspectTestCmdCompletion added in v1.0.37

func InspectTestCmdCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func InspectTestCmdFlags added in v1.0.37

func InspectTestCmdFlags(cmd *cobra.Command, options *InspectTestCmdOptions)

func NewDeleteTestsCmd

func NewDeleteTestsCmd() *cobra.Command

func NewGetTestsCmd

func NewGetTestsCmd() *cobra.Command

func NewInspectTestCmd

func NewInspectTestCmd() *cobra.Command

func NewReportTestCmd added in v1.0.38

func NewReportTestCmd() *cobra.Command

func NewSaveTestsCmd

func NewSaveTestsCmd() *cobra.Command

func NewSubmitTestCmd

func NewSubmitTestCmd() *cobra.Command

func NewValidateTestCmd added in v1.0.38

func NewValidateTestCmd() *cobra.Command

func PopulateSaveTestFlags

func PopulateSaveTestFlags(cmd *cobra.Command, options *TestSaveOptions)

func ReportTestCmdCompletion added in v1.0.37

func ReportTestCmdCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func ReportTestCmdFlags added in v1.0.37

func ReportTestCmdFlags(cmd *cobra.Command, options *ReportTestCmdOptions)

func SaveData added in v1.0.37

func SaveData(ctx context.Context, grafanaClient *grafana.Client, url *grafana.URL, destDir string) error

func SavePDF added in v1.0.28

func SavePDF(exporter common.PDFExporter, dashboardURI string, dstFile string) error

SavePDF extracts the pdf from Grafana and stores it to the destination.

func SavePDFs added in v1.0.28

func SavePDFs(ctx context.Context, exporter common.PDFExporter, grafanaClient *grafana.Client, dashboardURI, destDir, dashboardUID string) error

func SaveTestCmdCompletion added in v1.0.37

func SaveTestCmdCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func SubmitTestCmdCompletion added in v1.0.38

func SubmitTestCmdCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func SubmitTestCmdFlags added in v1.0.38

func SubmitTestCmdFlags(cmd *cobra.Command, options *SubmitTestCmdOptions)

Types

type DeleteTestCmdOptions added in v1.0.37

type DeleteTestCmdOptions struct {
	DeleteAll, Force bool
	Selectors        []string
}

type InspectTestCmdOptions added in v1.0.37

type InspectTestCmdOptions struct {
	NoOverview, Events, ExternalResources, Templates bool
	Deep                                             bool
	Shell                                            string

	Logs     []string
	Loglines int
}

type ReportTestCmdOptions added in v1.0.38

type ReportTestCmdOptions struct {
	// RepositoryCache points to the location where external binaries (i.e, pdf generators) will be stored.
	RepositoryCache string

	// Dashboards select the Grafana dashboards that will be downloaded.
	Dashboards []string

	// PDF generates one PDf per each panel in the selected dashboard.
	PDF bool

	// AggregatePDF generates one PDF for all panels in the selected dashboard.
	AggregatedPDF bool

	// Data downloads data from Grafana
	Data bool

	// Force starts the reporting regardless of the status of the Scenario (data may be inconsistent).
	Force bool

	// Wait blocks until the Scenario is in terminal phase.
	Wait bool
}

type SubmitTestCmdOptions added in v1.0.38

type SubmitTestCmdOptions struct {
	CPUQuota, MemoryQuota                     string
	Watch                                     bool
	ExpectSuccess, ExpectFailure, ExpectError bool
	Timeout                                   string

	Logs []string
}

type TestSaveOptions

type TestSaveOptions struct {
	Datasource string
	Force      bool
}

Jump to

Keyboard shortcuts

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