testutils

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecCmd

func ExecCmd(name string, arg []string, workingDirectory string) (stdout, stderr string, err error)

func FolderDiff

func FolderDiff(d Differ, dir1, dir2 string, ignores []string) (string, error)

Types

type Differ

type Differ interface {
	Diff(dir1, dir2 string, ignores []string) (string, error)
}

func NewExecDiffer

func NewExecDiffer() Differ

type DifferExec

type DifferExec struct {
}

func (*DifferExec) Diff

func (de *DifferExec) Diff(dir1, dir2 string, ignores []string) (string, error)

type ReplaceStdContent added in v1.5.3

type ReplaceStdContent struct {
	Search  string `yaml:"search"`
	Replace string `yaml:"replace"`
}

type SnapshotData

type SnapshotData struct {
	Path     string `yaml:"path"`
	FileName string `yaml:"file_name"`
	Content  string `yaml:"content"`
}

type SnapshotSuite

type SnapshotSuite struct {
	Name                 string              `yaml:"name,omitempty"`
	Command              string              `yaml:"command,omitempty"`
	ConfigFileName       string              `yaml:"config_file_name,omitempty"`
	Config               string              `yaml:"config_content,omitempty"`
	InitSnapshot         []SnapshotData      `yaml:"init_snapshot,omitempty"`
	ExpectedSnapshot     []SnapshotData      `yaml:"expected_snapshot,omitempty"`
	ExpectedStdOut       string              `yaml:"expected_stdout,omitempty"`
	ExpectedStdErr       string              `yaml:"expected_stderr,omitempty"`
	ReplaceStdOutContent []ReplaceStdContent `yaml:"replace_stdout_content,omitempty"`
	ReplaceStdErrContent []ReplaceStdContent `yaml:"replace_stderr_content,omitempty"`
}

func GetYmlSnapshotSuites

func GetYmlSnapshotSuites(folder string) ([]*SnapshotSuite, error)

GetYmlSnapshotSuites returns list of snapshot suite from yml files

func (*SnapshotSuite) CrateConfig

func (s *SnapshotSuite) CrateConfig(dir string) error

func (*SnapshotSuite) CreateSnapshotData

func (s *SnapshotSuite) CreateSnapshotData(snapshotData []SnapshotData, dir string) error

CreateSnapshotData creates filesystem data from the given snapshotData. For example, SnapshotData struct descrive the filesystem structure └── /folder

├── settings/
│   ├── billing-svc
│   └── all/
│       ├── foo
└── bar

Jump to

Keyboard shortcuts

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