testutil

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package testutil provides shared testify mocks reused across the test suites of multiple packages. It is only ever imported from _test.go files, so it never becomes part of the production binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockGitService

type MockGitService struct {
	mock.Mock
}

MockGitService is a shared mock covering every method exposed by internal/git.GitService across the various narrower interfaces that consume it.

func (*MockGitService) AddFileToStaging

func (m *MockGitService) AddFileToStaging(ctx context.Context, file string) error

func (*MockGitService) CreateCommit

func (m *MockGitService) CreateCommit(ctx context.Context, message string) error

func (*MockGitService) CreateTag

func (m *MockGitService) CreateTag(ctx context.Context, version, message string) error

func (*MockGitService) FetchTags

func (m *MockGitService) FetchTags(ctx context.Context) error

func (*MockGitService) GetChangedFiles

func (m *MockGitService) GetChangedFiles(ctx context.Context) ([]string, error)

func (*MockGitService) GetChangedFilesWithStatus

func (m *MockGitService) GetChangedFilesWithStatus(ctx context.Context) ([]models.GitChange, error)

func (*MockGitService) GetCommitCount

func (m *MockGitService) GetCommitCount(ctx context.Context) (int, error)

func (*MockGitService) GetCommitsBetweenTags

func (m *MockGitService) GetCommitsBetweenTags(ctx context.Context, fromTag, toTag string) ([]models.Commit, error)

func (*MockGitService) GetCommitsSinceTag

func (m *MockGitService) GetCommitsSinceTag(ctx context.Context, tag string) ([]models.Commit, error)

func (*MockGitService) GetCurrentBranch

func (m *MockGitService) GetCurrentBranch(ctx context.Context) (string, error)

func (*MockGitService) GetDiff

func (m *MockGitService) GetDiff(ctx context.Context) (string, error)

func (*MockGitService) GetDiffForFiles

func (m *MockGitService) GetDiffForFiles(ctx context.Context, files []string) (string, error)

func (*MockGitService) GetLastTag

func (m *MockGitService) GetLastTag(ctx context.Context) (string, error)

func (*MockGitService) GetRecentCommitMessages

func (m *MockGitService) GetRecentCommitMessages(ctx context.Context, count int) ([]string, error)

func (*MockGitService) GetRepoInfo

func (m *MockGitService) GetRepoInfo(ctx context.Context) (string, string, string, error)

func (*MockGitService) GetRepoRoot

func (m *MockGitService) GetRepoRoot(ctx context.Context) (string, error)

func (*MockGitService) GetTagDate

func (m *MockGitService) GetTagDate(ctx context.Context, tag string) (string, error)

func (*MockGitService) HasStagedChanges

func (m *MockGitService) HasStagedChanges(ctx context.Context) bool

func (*MockGitService) Push

func (m *MockGitService) Push(ctx context.Context) error

func (*MockGitService) PushTag

func (m *MockGitService) PushTag(ctx context.Context, version string) error

func (*MockGitService) StageAllChanges

func (m *MockGitService) StageAllChanges(ctx context.Context) error

func (*MockGitService) ValidateGitConfig

func (m *MockGitService) ValidateGitConfig(ctx context.Context) error

func (*MockGitService) ValidateTagExists

func (m *MockGitService) ValidateTagExists(ctx context.Context, tag string) error

type MockVCSClient

type MockVCSClient struct {
	mock.Mock
}

MockVCSClient is a shared mock implementing internal/vcs.VCSClient, reused across packages that need to stub a version control provider in tests.

func (*MockVCSClient) AddLabelsToPR

func (m *MockVCSClient) AddLabelsToPR(ctx context.Context, prNumber int, labels []string) error

func (*MockVCSClient) CreateIssue

func (m *MockVCSClient) CreateIssue(ctx context.Context, title string, body string, labels []string, assignees []string) (*models.Issue, error)

func (*MockVCSClient) CreateLabel

func (m *MockVCSClient) CreateLabel(ctx context.Context, name, color, description string) error

func (*MockVCSClient) CreateRelease

func (m *MockVCSClient) CreateRelease(ctx context.Context, release *models.Release, notes *models.ReleaseNotes, draft bool, buildBinaries bool, progressCh chan<- models.BuildProgress) error

func (*MockVCSClient) GetAuthenticatedUser

func (m *MockVCSClient) GetAuthenticatedUser(ctx context.Context) (string, error)

func (*MockVCSClient) GetClosedIssuesBetweenTags

func (m *MockVCSClient) GetClosedIssuesBetweenTags(ctx context.Context, previousTag, currentTag string) ([]models.Issue, error)

func (*MockVCSClient) GetContributorsBetweenTags

func (m *MockVCSClient) GetContributorsBetweenTags(ctx context.Context, previousTag, currentTag string) ([]string, error)

func (*MockVCSClient) GetFileAtTag

func (m *MockVCSClient) GetFileAtTag(ctx context.Context, tag, filepath string) (string, error)

func (*MockVCSClient) GetFileStatsBetweenTags

func (m *MockVCSClient) GetFileStatsBetweenTags(ctx context.Context, previousTag, currentTag string) (*models.FileStatistics, error)

func (*MockVCSClient) GetIssue

func (m *MockVCSClient) GetIssue(ctx context.Context, issueNumber int) (*models.Issue, error)

func (*MockVCSClient) GetMergedPRsBetweenTags

func (m *MockVCSClient) GetMergedPRsBetweenTags(ctx context.Context, previousTag, currentTag string) ([]models.PullRequest, error)

func (*MockVCSClient) GetPR

func (m *MockVCSClient) GetPR(ctx context.Context, prNumber int) (models.PRData, error)

func (*MockVCSClient) GetPRIssues

func (m *MockVCSClient) GetPRIssues(ctx context.Context, branchName string, commits []string, prDescription string) ([]models.Issue, error)

func (*MockVCSClient) GetRelease

func (m *MockVCSClient) GetRelease(ctx context.Context, version string) (*models.VCSRelease, error)

func (*MockVCSClient) GetRepoLabels

func (m *MockVCSClient) GetRepoLabels(ctx context.Context) ([]string, error)

func (*MockVCSClient) GetRepoLabelsWithDescriptions

func (m *MockVCSClient) GetRepoLabelsWithDescriptions(ctx context.Context) ([]models.RepoLabel, error)

func (*MockVCSClient) ListOpenIssues

func (m *MockVCSClient) ListOpenIssues(ctx context.Context) ([]models.Issue, error)

func (*MockVCSClient) UpdatePR

func (m *MockVCSClient) UpdatePR(ctx context.Context, prNumber int, summary models.PRSummary) error

func (*MockVCSClient) UpdateRelease

func (m *MockVCSClient) UpdateRelease(ctx context.Context, version, body string) error

Jump to

Keyboard shortcuts

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