test_framework

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneRepo added in v0.4.0

func CloneRepo(b *testing.B, repoPath, repoURL string, createdTagCount int) *git.Repository

func TestDir

func TestDir(t Namer) string

TestDir returns the appropriate test dir, creating it if necessary

Types

type GitOperation

type GitOperation struct {
	Message string   `yaml:"message"`
	Files   []string `yaml:"files"`
	Tag     string   `yaml:"tag"`
}

type MyRepo

type MyRepo struct {
	*git.Repository
	Path string
}

func New

func New(path string) (*MyRepo, error)

func NewFromTest

func NewFromTest(t Namer) (*MyRepo, error)

NewFromTest returns a repo in an output directory, and the directory

func (MyRepo) Run

func (r MyRepo) Run(ops []GitOperation) error

Run runs the operations on this repo

func (MyRepo) RunCommit

func (r MyRepo) RunCommit(op GitOperation, n int) error

func (*MyRepo) RunFile

func (r *MyRepo) RunFile(file string) error

RunFile loads a YAML file of git operations into the repository

func (MyRepo) RunTag

func (r MyRepo) RunTag(op GitOperation) error

type Namer added in v0.4.0

type Namer interface {
	Name() string
}

Jump to

Keyboard shortcuts

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