discovery

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package discovery attempts to discover test configs from well known directories.

Index

Constants

View Source
const (
	SetupDir    = "setup"    // known setup directory
	FixtureDir  = "fixtures" // known fixtures directory
	ExamplesDir = "examples" // known fixtures directory
)
View Source
const (
	DefaultTestConfigFilename = "test.yaml"
)

Variables

This section is empty.

Functions

func FindTestConfigs

func FindTestConfigs(t testing.TB, intTestDir string) map[string]string

FindTestConfigs attempts to auto discover configs to test and is expected to be executed from a directory containing explicit integration tests. Order of discovery is all explicit tests, followed by all fixtures that do not have explicit tests, followed by all examples that do not have fixtures nor explicit tests.

func GetConfigDirFromTestDir

func GetConfigDirFromTestDir(testDir string) (string, error)

GetConfigDirFromTestDir attempts to autodiscover config for a given explicit test based on dirpath for the test.

func GetKnownDirInParents

func GetKnownDirInParents(dir string, max int) (string, error)

GetKnownDirInParents checks if a well known dir exists in parent dir upto max parents.

Types

type BlueprintTestConfig

type BlueprintTestConfig struct {
	yaml.ResourceMeta `json:",inline" yaml:",inline"`
	Spec              struct {
		Skip bool `json:"skip" yaml:"skip"`
	} `json:"spec" yaml:"spec"`
	Path string
}

func GetTestConfig

func GetTestConfig(path string) (BlueprintTestConfig, error)

GetTestConfig returns BlueprintTestConfig if found

Jump to

Keyboard shortcuts

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