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 ¶
- type MockGitService
- func (m *MockGitService) AddFileToStaging(ctx context.Context, file string) error
- func (m *MockGitService) CreateCommit(ctx context.Context, message string) error
- func (m *MockGitService) CreateTag(ctx context.Context, version, message string) error
- func (m *MockGitService) FetchTags(ctx context.Context) error
- func (m *MockGitService) GetChangedFiles(ctx context.Context) ([]string, error)
- func (m *MockGitService) GetChangedFilesWithStatus(ctx context.Context) ([]models.GitChange, error)
- func (m *MockGitService) GetCommitCount(ctx context.Context) (int, error)
- func (m *MockGitService) GetCommitsBetweenTags(ctx context.Context, fromTag, toTag string) ([]models.Commit, error)
- func (m *MockGitService) GetCommitsSinceTag(ctx context.Context, tag string) ([]models.Commit, error)
- func (m *MockGitService) GetCurrentBranch(ctx context.Context) (string, error)
- func (m *MockGitService) GetDiff(ctx context.Context) (string, error)
- func (m *MockGitService) GetDiffForFiles(ctx context.Context, files []string) (string, error)
- func (m *MockGitService) GetLastTag(ctx context.Context) (string, error)
- func (m *MockGitService) GetRecentCommitMessages(ctx context.Context, count int) ([]string, error)
- func (m *MockGitService) GetRepoInfo(ctx context.Context) (string, string, string, error)
- func (m *MockGitService) GetRepoRoot(ctx context.Context) (string, error)
- func (m *MockGitService) GetTagDate(ctx context.Context, tag string) (string, error)
- func (m *MockGitService) HasStagedChanges(ctx context.Context) bool
- func (m *MockGitService) Push(ctx context.Context) error
- func (m *MockGitService) PushTag(ctx context.Context, version string) error
- func (m *MockGitService) StageAllChanges(ctx context.Context) error
- func (m *MockGitService) ValidateGitConfig(ctx context.Context) error
- func (m *MockGitService) ValidateTagExists(ctx context.Context, tag string) error
- type MockVCSClient
- func (m *MockVCSClient) AddLabelsToPR(ctx context.Context, prNumber int, labels []string) error
- func (m *MockVCSClient) CreateIssue(ctx context.Context, title string, body string, labels []string, ...) (*models.Issue, error)
- func (m *MockVCSClient) CreateLabel(ctx context.Context, name, color, description string) error
- func (m *MockVCSClient) CreateRelease(ctx context.Context, release *models.Release, notes *models.ReleaseNotes, ...) error
- func (m *MockVCSClient) GetAuthenticatedUser(ctx context.Context) (string, error)
- func (m *MockVCSClient) GetClosedIssuesBetweenTags(ctx context.Context, previousTag, currentTag string) ([]models.Issue, error)
- func (m *MockVCSClient) GetContributorsBetweenTags(ctx context.Context, previousTag, currentTag string) ([]string, error)
- func (m *MockVCSClient) GetFileAtTag(ctx context.Context, tag, filepath string) (string, error)
- func (m *MockVCSClient) GetFileStatsBetweenTags(ctx context.Context, previousTag, currentTag string) (*models.FileStatistics, error)
- func (m *MockVCSClient) GetIssue(ctx context.Context, issueNumber int) (*models.Issue, error)
- func (m *MockVCSClient) GetMergedPRsBetweenTags(ctx context.Context, previousTag, currentTag string) ([]models.PullRequest, error)
- func (m *MockVCSClient) GetPR(ctx context.Context, prNumber int) (models.PRData, error)
- func (m *MockVCSClient) GetPRIssues(ctx context.Context, branchName string, commits []string, prDescription string) ([]models.Issue, error)
- func (m *MockVCSClient) GetRelease(ctx context.Context, version string) (*models.VCSRelease, error)
- func (m *MockVCSClient) GetRepoLabels(ctx context.Context) ([]string, error)
- func (m *MockVCSClient) GetRepoLabelsWithDescriptions(ctx context.Context) ([]models.RepoLabel, error)
- func (m *MockVCSClient) ListOpenIssues(ctx context.Context) ([]models.Issue, error)
- func (m *MockVCSClient) UpdatePR(ctx context.Context, prNumber int, summary models.PRSummary) error
- func (m *MockVCSClient) UpdateRelease(ctx context.Context, version, body string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockGitService ¶
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) GetChangedFiles ¶
func (m *MockGitService) GetChangedFiles(ctx context.Context) ([]string, error)
func (*MockGitService) GetChangedFilesWithStatus ¶
func (*MockGitService) GetCommitCount ¶
func (m *MockGitService) GetCommitCount(ctx context.Context) (int, error)
func (*MockGitService) GetCommitsBetweenTags ¶
func (*MockGitService) GetCommitsSinceTag ¶
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 (*MockGitService) GetLastTag ¶
func (m *MockGitService) GetLastTag(ctx context.Context) (string, error)
func (*MockGitService) GetRecentCommitMessages ¶
func (*MockGitService) GetRepoInfo ¶
func (*MockGitService) GetRepoRoot ¶
func (m *MockGitService) GetRepoRoot(ctx context.Context) (string, error)
func (*MockGitService) GetTagDate ¶
func (*MockGitService) HasStagedChanges ¶
func (m *MockGitService) HasStagedChanges(ctx context.Context) bool
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 ¶
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 (*MockVCSClient) CreateIssue ¶
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 (*MockVCSClient) GetContributorsBetweenTags ¶
func (*MockVCSClient) GetFileAtTag ¶
func (*MockVCSClient) GetFileStatsBetweenTags ¶
func (m *MockVCSClient) GetFileStatsBetweenTags(ctx context.Context, previousTag, currentTag string) (*models.FileStatistics, error)
func (*MockVCSClient) GetMergedPRsBetweenTags ¶
func (m *MockVCSClient) GetMergedPRsBetweenTags(ctx context.Context, previousTag, currentTag string) ([]models.PullRequest, error)
func (*MockVCSClient) GetPRIssues ¶
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 (*MockVCSClient) ListOpenIssues ¶
func (*MockVCSClient) UpdateRelease ¶
func (m *MockVCSClient) UpdateRelease(ctx context.Context, version, body string) error
Click to show internal directories.
Click to hide internal directories.