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: ? 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

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