envtestutil

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package envtestutil holds what the tests of the `krci env` verbs that take <deployment> <env> share: a mock portal and the checks every such verb passes.

Index

Constants

View Source
const (
	Deployment   = "my-pipeline"
	Env          = "dev"
	Namespace    = "my-pipeline-dev"
	LocalCluster = "in-cluster"
)

The environment Portal serves.

Variables

This section is empty.

Functions

func CheckInvalidTarget

func CheckInvalidTarget[T any](t *testing.T, cmd newCmd[T])

CheckInvalidTarget checks that the verb rejects a wrong number of positionals, an invalid deployment or env and an unknown output format before its run function.

func CheckNotFound

func CheckNotFound[T any](t *testing.T, cmd newCmd[T], kind, items string)

CheckNotFound checks the message of the verb for a missing deployment and for a missing environment, on stderr and in the JSON error envelope. kind and items are what Portal serves in the environment namespace.

func CheckRemoteCluster

func CheckRemoteCluster[T any](t *testing.T, cmd newCmd[T], kind, items string)

CheckRemoteCluster checks that the verb refuses an environment on another cluster with a message that names the cluster.

func Portal

func Portal(cluster, kind, items string) http.Handler

Portal returns a mock portal with one deployment and its one environment on the given cluster. A list of kind answers with items (comma-separated JSON objects), a list of any other kind is empty, and any other deployment is not found.

Types

This section is empty.

Jump to

Keyboard shortcuts

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