lokitest

package
v0.0.0-...-bd7144e Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package lokitest provides test methods using which the plugins can validate whether they implement loki correctly or not.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateAfterKill

func ValidateAfterKill(ctx context.Context, t *testing.T, plugin *Plugin, config *Configuration)

ValidateAfterKill validates that validation fails if called immediately after few resources are killed. So we check that when system is not in desired state, validation fails.

func ValidateAfterSystemLoad

func ValidateAfterSystemLoad(ctx context.Context, t *testing.T, plugin *Plugin)

ValidateAfterSystemLoad validates that validation passes if called immediately after system is loaded. So we check that when system is in desired state, validation succeeds.

func ValidateAll

func ValidateAll(ctx context.Context, t *testing.T, plugin *Plugin, config *Configuration)

ValidateAll validates all functionalities of the plugin.

func ValidateDestroyerParse

func ValidateDestroyerParse(ctx context.Context, t *testing.T, plugin *Plugin, config *Configuration)

ValidateDestroyerParse validates that destroyer can parse destroy section without error.

Types

type Configuration

type Configuration struct {
	// Identifiers is the list of resource IDs which should be killed to validate that system shows validation as false.
	Identifiers loki.Identifiers
	// DestroySection is sample destroy section to validate that destroyer can parse without error.
	DestroySection map[string]interface{}
}

Configuration contains data needed to run tests through which a plugin can be validated.

type Plugin

type Plugin struct {
	// System implementation of plugin.
	System loki.System
	// Destroyer implementation of plugin.
	Destroyer loki.Destroyer
	// Killer implementation of plugin.
	Killer loki.Killer
}

Plugin represents a plugin implementation consisting of System, Destroyer and Killer.

Jump to

Keyboard shortcuts

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