planitest

package
v0.98.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

planitest

What is it?

Test helpers for Ops Manager tile developers. Given the set of tile options selected by the operator, what should the generated BOSH manifest look like?

It can be prohibitively expensive to deploy your tile in each of these configurations - planitest lets you make assertions about the staged manifest.

Usage

See the tested example

What do you need?

There are two ways to run planitest, using a real Ops Manager as backend renderer or using a generator tool to provide faster feedback.

Use om as renderer
  1. Set environment variable RENDERER to om
  2. An Ops Manager instance to test against. It should have the BOSH tile deployed.
  3. The om CLI, n.b. requires om 0.42.0+
  4. The bosh CLI
  5. A config file usable by om configure-product, see om documentation
  6. The tile you want to test. It should be already uploaded to Ops Manager, along with the stemcell it depends on.
Rough Edges for om:
  1. Don't attempt to run tests in parallel as different examples will step on each other
  2. It runs om with the --skip-ssl-validation flag
  3. Rendering a staged manifest for a large product on Ops Manager can be slooooow
Use ops-manifest as renderer
  1. Set environment variable RENDERER to ops-manifest
  2. The ops-manifest CLI
  3. The metadata.yml file extracted from a tile
  4. A configuration file exported with om staged-config
Rough edges for ops-manifest:
  1. ops-manifest is also under heavy construction; it may render differently from an Ops Manager
  2. Config file may be hard to configure. It requires appropriate product-properties and network-properties fields.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest

type Manifest string

func (Manifest) FindInstanceGroupJob

func (m Manifest) FindInstanceGroupJob(instanceGroup, job string) (Manifest, error)

func (Manifest) Path

func (m Manifest) Path(path string) (any, error)

func (Manifest) Property

func (m Manifest) Property(path string) (any, error)

func (Manifest) String

func (m Manifest) String() string

type ProductConfig

type ProductConfig struct {
	TileFile   io.ReadSeeker
	ConfigFile io.ReadSeeker
}

type ProductService

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

func NewProductService

func NewProductService(config ProductConfig) (*ProductService, error)

func (*ProductService) RenderManifest

func (p *ProductService) RenderManifest(additionalProperties map[string]any) (Manifest, error)

Directories

Path Synopsis
fakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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