Documentation
¶
Overview ¶
Package integration provides integration test utilities and fixtures.
Index ¶
- func RequireGitVersion(t testing.TB, minVersion string)
- type TestRepo
- func (r *TestRepo) AnnotatedTag(name, message string)
- func (r *TestRepo) Branch(name string)
- func (r *TestRepo) Checkout(ref string)
- func (r *TestRepo) Commit(message string) string
- func (r *TestRepo) CommitWithDate(message string, date time.Time) string
- func (r *TestRepo) CurrentBranch() string
- func (r *TestRepo) Git(args ...string) string
- func (r *TestRepo) GitMayFail(args ...string) (string, error)
- func (r *TestRepo) HeadHash() string
- func (r *TestRepo) Path(relPath string) string
- func (r *TestRepo) SetupBreakingChangeCommits()
- func (r *TestRepo) SetupConventionalCommits()
- func (r *TestRepo) SetupVersionedTags()
- func (r *TestRepo) Tag(name string)
- func (r *TestRepo) WriteFile(path, content string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequireGitVersion ¶
RequireGitVersion checks if git is installed and meets the minimum version.
Types ¶
type TestRepo ¶
type TestRepo struct {
Dir string
// contains filtered or unexported fields
}
TestRepo represents a temporary git repository for testing.
func NewTestRepo ¶
NewTestRepo creates a new temporary git repository for testing. The repository is automatically cleaned up when the test completes.
func (*TestRepo) AnnotatedTag ¶
AnnotatedTag creates an annotated tag at the current HEAD.
func (*TestRepo) CommitWithDate ¶
CommitWithDate creates a commit with a specific date.
func (*TestRepo) CurrentBranch ¶
CurrentBranch returns the current branch name.
func (*TestRepo) GitMayFail ¶
GitMayFail runs a git command that may fail, returning the output and error.
func (*TestRepo) SetupBreakingChangeCommits ¶
func (r *TestRepo) SetupBreakingChangeCommits()
SetupBreakingChangeCommits creates commits with breaking changes.
func (*TestRepo) SetupConventionalCommits ¶
func (r *TestRepo) SetupConventionalCommits()
SetupConventionalCommits creates a series of conventional commits for testing.
func (*TestRepo) SetupVersionedTags ¶
func (r *TestRepo) SetupVersionedTags()
SetupVersionedTags creates tags with semantic versions.