matrix

package
v1.27.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

README

Matrix Tests

Matrix tests are employed to validate all variations of values.yaml file to render helm chart.

Usage

Create the file named values_matrix_test.yaml in your chart directory.

Example for 1x1 matrix (values_matrix_test.yaml):

replicas: 1
image: registry.example.com
environment:
- test
- prod

To create increase your matrix dimensional you should use special functions:

Choices

Choices allow splitting values.yaml.

  • __ConstantChoices__ - array of items you split values.yaml with.

Example values_matrix_test.yaml:

replicas: 
  __ConstantChoices__: [1, 2]
image: registry.example.com
environment:
- test
- prod

It creates two different values.yaml files for tests:

replicas: 1
image: registry.example.com
environment:
- test
- prod
replicas: 2
image: registry.example.com
environment:
- test
- prod

You can add additional choice to create more variants:

Example values_matrix_test.yaml:

replicas: 
  __ConstantChoices__: [1, 2]
image: registry.example.com
environment:
  __ConstantChoices__:
  - ["test", "prod"]
  - ["dev", "stage"]

It creates four values.yaml files for tests:

replicas: 1
image: registry.example.com
environment:
- test
- prod
replicas: 2
image: registry.example.com
environment:
- test
- prod
replicas: 1
image: registry.example.com
environment:
- dev
- stage
replicas: 2
image: registry.example.com
environment:
- dev
- stage

And so on.

Items

Special values.yaml that can be used in values_matrix_test.yaml.

  • __EmptyItem__ - completely delete object

Example values_matrix_test.yaml:

replicas: 1
image: 
  __ConstantChoices__: [registry.example.com, __EmptyItem__]

Generated values.yaml:

replicas: 1
image: registry.example.com
replicas: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorOccurred

func ErrorOccurred() types.GomegaMatcher

Types

type LintErrorOccurredMatcher

type LintErrorOccurredMatcher struct {
}

func (*LintErrorOccurredMatcher) FailureMessage

func (matcher *LintErrorOccurredMatcher) FailureMessage(actual interface{}) (message string)

func (*LintErrorOccurredMatcher) Match

func (matcher *LintErrorOccurredMatcher) Match(actual interface{}) (success bool, err error)

func (*LintErrorOccurredMatcher) NegatedFailureMessage

func (matcher *LintErrorOccurredMatcher) NegatedFailureMessage(actual interface{}) (message string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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