test

package
v0.0.0-...-bc69434 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDummyFile

func CreateDummyFile(t *testing.T, size int64) []byte

CreateDummyFile create a dummy file

func LoadGolden

func LoadGolden(t *testing.T, goldenFile string) string

LoadGolden load golden file

func LoadInput

func LoadInput(t *testing.T, inputFile string) []string

LoadInput load input file

func ParseIssues

func ParseIssues(output string, format string) []issue.Issue

ParseIssues parse integration test output

Types

type File

type File struct {
	FileName    string
	FileContent []byte
}

File data structure

type GitSuite

type GitSuite struct {
	BarePath       string
	ClonePath      string
	LastCommit     plumbing.Hash
	OutputFormat   string
	PreviousCommit plumbing.Hash
	Repository     *git.Repository
	RootDirectory  string
	Server         *git.Repository
	// contains filtered or unexported fields
}

GitSuite data structure

func (*GitSuite) AnnotatedTag

func (suite *GitSuite) AnnotatedTag(tag string, hash plumbing.Hash) (*bytes.Buffer, error)

AnnotatedTag create annotated tag

func (*GitSuite) Clean

func (suite *GitSuite) Clean() error

Clean clean data

func (*GitSuite) CommitAndPush

func (suite *GitSuite) CommitAndPush(ref string, files []File, commitMessage string, signature *object.Signature) (*bytes.Buffer, error)

CommitAndPush commit and push multiple files to bare repository

func (*GitSuite) CreateBranch

func (suite *GitSuite) CreateBranch(ref string) (*bytes.Buffer, error)

CreateBranch create new branch

func (*GitSuite) LightweightTag

func (suite *GitSuite) LightweightTag(tag string, hash plumbing.Hash) (*bytes.Buffer, error)

LightweightTag create new lightweight tag

func (*GitSuite) Push

func (suite *GitSuite) Push(ref string) (*bytes.Buffer, error)

Push to remote repository

func (*GitSuite) PushFile

func (suite *GitSuite) PushFile(ref string, fileName string, fileContent []byte, commitMessage string, signature *object.Signature) (*bytes.Buffer, error)

PushFile commit and push single file to bare repository

func (*GitSuite) ResetLastCommit

func (suite *GitSuite) ResetLastCommit() error

ResetLastCommit git reset --hard [origin/master|hash

func (*GitSuite) SetUp

func (suite *GitSuite) SetUp() error

SetUp initialize bare and clone git repository

func (*GitSuite) SetUpBareRepository

func (suite *GitSuite) SetUpBareRepository() error

SetUpBareRepository create new bare repository

func (*GitSuite) SetUpCloneRepository

func (suite *GitSuite) SetUpCloneRepository() error

SetUpCloneRepository clone git repository

Jump to

Keyboard shortcuts

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