tests

package
v1.0.36 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

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

	SummaryDashboardUID = "summary"
)
View Source
const (
	TestdataSource   = "dataviewer:/testdata"
	PrometheusSource = "prometheus:/prometheus/data"
)

Variables

View Source
var (
	// FastPDFExporter is fast on individual panels, but does not render dashboard with many panels.
	FastPDFExporter string

	// LongPDFExporter can render dashboards with many panels, but it's a bit slow.
	LongPDFExporter string
)

Functions

func ControlOutput

func ControlOutput(testName string, options *TestSubmitOptions)

func FindTimeline added in v1.0.32

func FindTimeline(scenario *v1alpha1.Scenario) (from int64, to int64)

FindTimeline parses the scenario to find timeline that make sense (formatted into time.UnixMilli). ---------------------------------------------------*

	For the starting time we adhere to these rules:
	 1. If possible, we use the time that the first job was scheduled.
	 2. Otherwise, we use the Creation time.

	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 GenerateQuotedURL added in v1.0.28

func GenerateQuotedURL(grafanaEndpoint string, dashboard string, from int64, to int64, postfix string) string

func InstallPDFExporter added in v1.0.28

func InstallPDFExporter(location string)

func NewDeleteTestsCmd

func NewDeleteTestsCmd() *cobra.Command

func NewGetTestsCmd

func NewGetTestsCmd() *cobra.Command

func NewInspectTestCmd

func NewInspectTestCmd() *cobra.Command

func NewReportTestsCmd added in v1.0.28

func NewReportTestsCmd() *cobra.Command

func NewSaveTestsCmd

func NewSaveTestsCmd() *cobra.Command

func NewSubmitTestCmd

func NewSubmitTestCmd() *cobra.Command

func NewValidateCmd added in v1.0.30

func NewValidateCmd() *cobra.Command

func PopulateInspectFlags

func PopulateInspectFlags(cmd *cobra.Command, options *InspectOptions)

func PopulateReportTestFlags added in v1.0.28

func PopulateReportTestFlags(cmd *cobra.Command, options *TestReportOptions)

func PopulateSaveTestFlags

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

func PopulateTestDeleteFlags

func PopulateTestDeleteFlags(cmd *cobra.Command, options *TestDeleteOptions)

func PopulateTestSubmitFlags

func PopulateTestSubmitFlags(cmd *cobra.Command, options *TestSubmitOptions)

func PopulateTestValidateFlags added in v1.0.30

func PopulateTestValidateFlags(cmd *cobra.Command, options *TestSubmitOptions)

func SavePDF added in v1.0.28

func SavePDF(options *TestReportOptions, dashboardURI string, destination string) error

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

func SavePDFs added in v1.0.28

func SavePDFs(options *TestReportOptions, dashboardURI, destDir string, grafanaEndpoint string, dashboardUID string) error

Types

type InspectOptions

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

	Logs     []string
	Loglines int
}

type TestDeleteOptions

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

type TestReportOptions added in v1.0.28

type TestReportOptions struct {
	Force, Aggregate bool
	DashboardUID     string
	RepositoryCache  string
}

type TestSaveOptions

type TestSaveOptions struct {
	Force      bool
	Datasource string
}

type TestSubmitOptions

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

	Logs     []string
	Loglines int
}

type TestValidateOptions added in v1.0.30

type TestValidateOptions struct{}

Jump to

Keyboard shortcuts

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