Documentation ¶
Index ¶
- func DeleteResources(t *Harness, opts CreateDeleteTestOptions)
- func MaybeSkip(t *testing.T, name string, resources []*unstructured.Unstructured)
- func RunCreateDeleteTest(t *Harness, opt CreateDeleteTestOptions)
- func SetupNamespacesAndApplyDefaults(t *Harness, resources []*unstructured.Unstructured, project testgcp.GCPProject)
- func WaitForReady(h *Harness, unstructs ...*unstructured.Unstructured)
- type CreateDeleteTestOptions
- type Harness
- type HarnessOptions
- type Sample
- type SampleKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteResources ¶ added in v1.111.0
func DeleteResources(t *Harness, opts CreateDeleteTestOptions)
func MaybeSkip ¶ added in v1.101.0
func MaybeSkip(t *testing.T, name string, resources []*unstructured.Unstructured)
func RunCreateDeleteTest ¶
func RunCreateDeleteTest(t *Harness, opt CreateDeleteTestOptions)
func SetupNamespacesAndApplyDefaults ¶
func SetupNamespacesAndApplyDefaults(t *Harness, resources []*unstructured.Unstructured, project testgcp.GCPProject)
func WaitForReady ¶ added in v1.114.1
func WaitForReady(h *Harness, unstructs ...*unstructured.Unstructured)
Types ¶
type CreateDeleteTestOptions ¶ added in v1.112.0
type CreateDeleteTestOptions struct { // Create is the set of objects to create Create []*unstructured.Unstructured // Updates is the set of objects to update (after all objects have been created) Updates []*unstructured.Unstructured // CleanupResources is true if we should delete resources when we are done CleanupResources bool // SkipWaitForDelete true means that we don't wait to query that a resource has been deleted. SkipWaitForDelete bool // SkipWaitForReady true is mainly used for Paused resources as we don't emit an event for those yet. SkipWaitForReady bool // CreateInOrder true means that we create each object and wait for the object to be ready. // This requires that objects be sorted in creation order. CreateInOrder bool // DeleteInOrder true means that we delete each object and wait for deletion to complete. // This requires that objects be sorted in deletion order. DeleteInOrder bool }
type Harness ¶
type Harness struct { *testing.T Ctx context.Context Events *test.MemoryEventSink KubeEvents *test.MemoryEventSink Project testgcp.GCPProject VCRRecorderDCL *recorder.Recorder VCRRecorderTF *recorder.Recorder VCRRecorderOauth *recorder.Recorder // contains filtered or unexported fields }
func NewHarnessWithManager ¶ added in v1.101.0
NewHarnessWithManager builds a Harness for an existing manager. deprecated: Prefer NewHarness, which can construct a manager and mock gcp etc.
func NewHarnessWithOptions ¶ added in v1.117.0
func (*Harness) CompareGoldenFile ¶ added in v1.111.0
func (*Harness) ExportParams ¶ added in v1.111.0
func (h *Harness) ExportParams() exportparameters.Parameters
ExportParams returns the default parameters.Parameters to use for an export
func (*Harness) MustReadFile ¶ added in v1.111.0
func (*Harness) NoExtraGoldenFiles ¶ added in v1.114.1
type HarnessOptions ¶ added in v1.117.0
type HarnessOptions struct {
VCRPath string
}
type Sample ¶
type Sample struct { Name string Resources []*unstructured.Unstructured }
func LoadAllSamples ¶ added in v1.113.0
func LoadAllSamples(t *testing.T, project testgcp.GCPProject) []Sample
LoadAllSamples loads all the samples.
func LoadMatchingSamples ¶ added in v1.113.0
LoadMatchingSamples loads the samples that match the regex
func LoadSample ¶ added in v1.113.0
LoadSample loads one sample
type SampleKey ¶ added in v1.113.0
type SampleKey struct { Name string // contains filtered or unexported fields }
SampleKey contains the metadata for a sample. This lets us defer variable substitution.
func ListAllSamples ¶ added in v1.113.0
ListAllSamples gets the keys for all the samples without loading them.
Click to show internal directories.
Click to hide internal directories.