steps

package module
v0.0.0-...-6f04f12 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

README

kubernetes-godog

This project contains definition and implementation of Godog steps related to various Kubernetes objects. These steps can be easily added to existing test suite by passing ScenarioContext to the builder. Step implementations use standard kubeconfig approach to connect to Kubernetes cluster (using env variable to point to config file or config file in expected location)

Currently there are specified just namespace steps, more steps will come.

Usage

Register steps in InitializeScenario:

func InitializeScenario(ctx *godog.ScenarioContext) {
	steps.Builder().RegisterSteps(ctx)
}

Use registered steps in your feature files:

  Scenario: My complex scenario
    When create namespace dedicated-namespace

    Then namespace dedicated-namespace exists

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KubernetesStepsBuilder

type KubernetesStepsBuilder struct {
	// contains filtered or unexported fields
}

KubernetesStepsBuilder builder for Kubernetes steps

func Builder

func Builder() *KubernetesStepsBuilder

Builder returns builder for Kubernetes steps

func (*KubernetesStepsBuilder) RegisterSteps

func (builder *KubernetesStepsBuilder) RegisterSteps(ctx *godog.ScenarioContext)

RegisterSteps register Kubernetes steps

func (*KubernetesStepsBuilder) WithCreateNamespaceListener

func (builder *KubernetesStepsBuilder) WithCreateNamespaceListener(listener func(createdNamespace string)) *KubernetesStepsBuilder

WithCreateNamespaceListener register listener listening for created namespace events

func (*KubernetesStepsBuilder) WithDeleteNamespaceListener

func (builder *KubernetesStepsBuilder) WithDeleteNamespaceListener(listener func(deletedNamespace string)) *KubernetesStepsBuilder

WithDeleteNamespaceListener register listener listening for deleted namespace events

func (*KubernetesStepsBuilder) WithNamespaceNameGenerator

func (builder *KubernetesStepsBuilder) WithNamespaceNameGenerator(generator func() string) *KubernetesStepsBuilder

WithNamespaceNameGenerator provide namespace name generator to use namespace steps with implicit names

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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