testhelper

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTestRing

func GetTestRing(logger log.Logger) ring.AcmeManagerRing

Types

type VaultTest

type VaultTest struct {
	Client vaultStorage.Client
	// contains filtered or unexported fields
}

VaultTest wraps a client bound to a per-test AppRole and KV v2 mount on the Vault instance started by `make compose-up`.

func GetTestVaultServer

func GetTestVaultServer(t *testing.T, _ bool) VaultTest

GetTestVaultServer returns a Vault client authenticated against a KV v2 mount created for this test alone.

It talks to an external Vault dev server (VAULT_ADDR, default http://127.0.0.1:8200) instead of an in-process test cluster. Running Vault as a container alongside Pebble keeps github.com/hashicorp/vault and its transitive tree — Docker, database drivers, cloud SDKs — out of the module graph entirely.

The debug argument is kept for backwards compatibility and ignored: server logs now belong to the container.

func (VaultTest) Cleanup added in v0.9.0

func (v VaultTest) Cleanup()

Cleanup removes the mount, role and policy created for the test. Vault runs in dev mode and is discarded with the container, but every test shares the same instance, so each one tidies up after itself.

Jump to

Keyboard shortcuts

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