Documentation ¶
Index ¶
- func AddCollaborator(approver string, repo *scm.Repository, botClient *scm.Client, ...) error
- func AddHoldLabelToPullRequestWithChatOpsCommand(lhClient scmprovider.SCMClient, pr *scm.PullRequest) error
- func AddReviewerToPullRequestWithChatOpsCommand(lhClient scmprovider.SCMClient, pr *scm.PullRequest, reviewer string) error
- func AddWIPLabelToPullRequestByUpdatingTitle(lhClient scmprovider.SCMClient, scmClient *scm.Client, pr *scm.PullRequest) error
- func ApplyConfigAndPluginsConfigMaps(cfg *config.Config, pluginsCfg *plugins.Configuration) error
- func ApprovePullRequest(lhClient scmprovider.SCMClient, approverclient scmprovider.SCMClient, ...) error
- func AttemptToLGTMOwnPullRequest(lhClient scmprovider.SCMClient, pr *scm.PullRequest) error
- func CreateBaseRepository(botUser, approver string, botClient *scm.Client, gitClient git.Client) (*scm.Repository, *git.Repo, error)
- func CreateGitClient(gitServerURL string, userFunc func() string, tokenFunc func() (string, error)) (git.Client, error)
- func CreateHMACToken() (string, error)
- func CreateSCMClient(userFunc func() string, tokenFunc func() (string, error)) (*scm.Client, scmprovider.SCMClient, string, error)
- func CreateWebHook(scmClient *scm.Client, repo *scm.Repository, hmacToken string) error
- func ExpectCommandExecution(dir string, commandTimeout time.Duration, exitCode int, c string, ...)
- func ExpectThatPullRequestDoesNotHaveLabel(lhClient scmprovider.SCMClient, pullRequestNumber int, ...) error
- func ExpectThatPullRequestHasCommentMatching(lhClient scmprovider.SCMClient, pr *scm.PullRequest, ...) error
- func ExpectThatPullRequestHasLabel(lhClient scmprovider.SCMClient, pullRequestNumber int, ...) error
- func ExpectThatPullRequestMatches(lhClient scmprovider.SCMClient, pullRequestNumber int, owner, repo string, ...) error
- func GetApproverName() string
- func GetApproverSCMToken() (string, error)
- func GetBotName() string
- func GetPrimarySCMToken() (string, error)
- func GitKind() string
- func ProcessConfigAndPlugins(owner, repo, namespace, agent string) (*config.Config, *plugins.Configuration, error)
- func RunWithReporters(t *testing.T, suiteID string)
- func WaitForPullRequestCommitStatus(lhClient scmprovider.SCMClient, pr *scm.PullRequest, contexts []string, ...)
- func WaitForPullRequestToMerge(lhClient scmprovider.SCMClient, pr *scm.PullRequest)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCollaborator ¶
func AddCollaborator(approver string, repo *scm.Repository, botClient *scm.Client, approverClient *scm.Client) error
AddCollaborator adds the approver user to the repo
func AddHoldLabelToPullRequestWithChatOpsCommand ¶
func AddHoldLabelToPullRequestWithChatOpsCommand(lhClient scmprovider.SCMClient, pr *scm.PullRequest) error
AddHoldLabelToPullRequestWithChatOpsCommand returns an error of the command fails to add the do-not-merge/hold label
func AddReviewerToPullRequestWithChatOpsCommand ¶
func AddReviewerToPullRequestWithChatOpsCommand(lhClient scmprovider.SCMClient, pr *scm.PullRequest, reviewer string) error
AddReviewerToPullRequestWithChatOpsCommand returns an error of the command fails to add the reviewer to either the reviewers list or the assignees list
func AddWIPLabelToPullRequestByUpdatingTitle ¶
func AddWIPLabelToPullRequestByUpdatingTitle(lhClient scmprovider.SCMClient, scmClient *scm.Client, pr *scm.PullRequest) error
AddWIPLabelToPullRequestByUpdatingTitle adds the WIP label by adding WIP to a pull request's title
func ApplyConfigAndPluginsConfigMaps ¶
func ApplyConfigAndPluginsConfigMaps(cfg *config.Config, pluginsCfg *plugins.Configuration) error
ApplyConfigAndPluginsConfigMaps takes the config and plugins and creates/applies the config maps in the cluster using kubectl
func ApprovePullRequest ¶
func ApprovePullRequest(lhClient scmprovider.SCMClient, approverclient scmprovider.SCMClient, pr *scm.PullRequest) error
ApprovePullRequest attempts to /approve a PR with the given approver git provider, then verify the label is there with the default provider
func AttemptToLGTMOwnPullRequest ¶
func AttemptToLGTMOwnPullRequest(lhClient scmprovider.SCMClient, pr *scm.PullRequest) error
AttemptToLGTMOwnPullRequest return an error if the /lgtm fails to add the lgtm label to PR
func CreateBaseRepository ¶
func CreateBaseRepository(botUser, approver string, botClient *scm.Client, gitClient git.Client) (*scm.Repository, *git.Repo, error)
CreateBaseRepository creates the repository that will be used for tests
func CreateGitClient ¶
func CreateGitClient(gitServerURL string, userFunc func() string, tokenFunc func() (string, error)) (git.Client, error)
CreateGitClient creates the git client used for cloning and making changes to the test repository
func CreateHMACToken ¶
CreateHMACToken creates an HMAC token for use in webhooks, defaulting to the E2E_HMAC_TOKEN env var if set
func CreateSCMClient ¶
func CreateSCMClient(userFunc func() string, tokenFunc func() (string, error)) (*scm.Client, scmprovider.SCMClient, string, error)
CreateSCMClient takes functions that return the username and token to use, and creates the scm.Client and Lighthouse SCM client
func CreateWebHook ¶
CreateWebHook creates a webhook on the SCM provider for the repository
func ExpectCommandExecution ¶
func ExpectCommandExecution(dir string, commandTimeout time.Duration, exitCode int, c string, args ...string)
ExpectCommandExecution performs the given command in the current work directory and asserts that it completes successfully
func ExpectThatPullRequestDoesNotHaveLabel ¶
func ExpectThatPullRequestDoesNotHaveLabel(lhClient scmprovider.SCMClient, pullRequestNumber int, owner, repo, label string) error
ExpectThatPullRequestDoesNotHaveLabel returns an error if the PR does have the specified label
func ExpectThatPullRequestHasCommentMatching ¶
func ExpectThatPullRequestHasCommentMatching(lhClient scmprovider.SCMClient, pr *scm.PullRequest, matchFunc func(comments []*scm.Comment) error) error
ExpectThatPullRequestHasCommentMatching returns an error if the PR does not have a comment matching the provided function
func ExpectThatPullRequestHasLabel ¶
func ExpectThatPullRequestHasLabel(lhClient scmprovider.SCMClient, pullRequestNumber int, owner, repo, label string) error
ExpectThatPullRequestHasLabel returns an error if the PR does not have the specified label
func ExpectThatPullRequestMatches ¶
func ExpectThatPullRequestMatches(lhClient scmprovider.SCMClient, pullRequestNumber int, owner, repo string, matchFunc func(request *scm.PullRequest) error) error
ExpectThatPullRequestMatches returns an error if the PR does not satisfy the provided funciton
func GetApproverName ¶
func GetApproverName() string
GetApproverName gets the approver user's username
func GetApproverSCMToken ¶
GetApproverSCMToken gets the token used by the approver
func GetPrimarySCMToken ¶
GetPrimarySCMToken gets the token used by the bot/primary user
func ProcessConfigAndPlugins ¶
func ProcessConfigAndPlugins(owner, repo, namespace, agent string) (*config.Config, *plugins.Configuration, error)
ProcessConfigAndPlugins reads the templates for the config and plugins config maps and replaces the owner, repo, and namespace in them
func RunWithReporters ¶
RunWithReporters runs a suite with better logging and gathering of test results
func WaitForPullRequestCommitStatus ¶
func WaitForPullRequestCommitStatus(lhClient scmprovider.SCMClient, pr *scm.PullRequest, contexts []string, desiredStatuses ...string)
WaitForPullRequestCommitStatus checks a pull request until either it reaches a given status in all the contexts supplied or a timeout is reached.
func WaitForPullRequestToMerge ¶
func WaitForPullRequestToMerge(lhClient scmprovider.SCMClient, pr *scm.PullRequest)
WaitForPullRequestToMerge checks the PR's status until it's merged or timed out.
Types ¶
This section is empty.