testutil

package
v4.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package testutil provides helpers shared by pkg/modules/* unit and integration tests. They let a test build a module execution context (variable.Variable) without a real cluster.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestVariable

func NewTestVariable(hosts []string, vars map[string]any) variable.Variable

NewTestVariable creates a new variable.Variable for testing purposes. It initializes a test playbook and client via _const.NewTestPlaybook, then creates an in-memory variable source. It merges the provided vars as remote variables for the specified hosts. This allows you to customize the per-host variable context for unit tests needing module execution context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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