testutils

package
v1.43.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ProviderFactories is a static map containing only the main provider instance
	// It is configured from the main provider package when the test suite is initialized
	// but it is used in tests of every package
	ProviderFactories map[string]func() (*schema.Provider, error)

	// Provider is the "main" provider instance
	//
	// This Provider can be used in testing code for API calls without requiring
	// the use of saving and referencing specific ProviderFactories instances.
	//
	// It is configured from the main provider package when the test suite is initialized
	// but it is used in tests of every package
	Provider *schema.Provider
)

Functions

func AccTestsEnabled

func AccTestsEnabled(envVarName string) bool

func CheckCloudAPITestsEnabled

func CheckCloudAPITestsEnabled(t *testing.T)

CheckCloudTestsEnabled checks if the cloud tests are enabled. This should be the first line of any test that tests Cloud API features

func CheckCloudInstanceTestsEnabled

func CheckCloudInstanceTestsEnabled(t *testing.T)

CheckCloudInstanceTestsEnabled checks if tests that run on cloud instances are enabled. This should be the first line of any test that tests Grafana Cloud Pro features

func CheckEnterpriseTestsEnabled

func CheckEnterpriseTestsEnabled(t *testing.T)

CheckEnterpriseTestsEnabled checks if the enterprise tests are enabled. This should be the first line of any test that tests Grafana Enterprise features

func CheckEnvVarsSet

func CheckEnvVarsSet(t *testing.T, envVars ...string)

func CheckOSSTestsEnabled

func CheckOSSTestsEnabled(t *testing.T)

CheckOSSTestsEnabled checks if the OSS acceptance tests are enabled. This should be the first line of any test that uses Grafana OSS features only

func CheckOSSTestsSemver

func CheckOSSTestsSemver(t *testing.T, semverConstraint string)

CheckOSSTestsSemver allows to skip tests that are not supported by the Grafana OSS version

func IsUnitTest

func IsUnitTest(t *testing.T)

func TestAccExample

func TestAccExample(t *testing.T, path string) string

TestAccExample returns an example config from the examples directory. Examples are used for both documentation and acceptance tests.

func TestAccExampleWithReplace

func TestAccExampleWithReplace(t *testing.T, path string, replaceMap map[string]string) string

TestAccExampleWithReplace works like testAccExample, but replaces strings in the example.

Types

This section is empty.

Jump to

Keyboard shortcuts

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