Documentation ¶
Index ¶
- Constants
- Variables
- func FormatInitStatus(tr *tmv1beta1.Testrun) string
- func FormatStatus(tr *tmv1beta1.Testrun, dashboardUrl string) string
- type Run
- type Runs
- func (r *Runs) Add(event *github.GenericRequestEvent, tr *v1beta1.Testrun) error
- func (r *Runs) CreateTestrun(ctx context.Context, log logr.Logger, statusUpdater *StatusUpdater, ...) error
- func (r *Runs) GetClient() client.Client
- func (r *Runs) GetRunning(event *github.GenericRequestEvent) (*Run, bool)
- func (r *Runs) IsRunning(event *github.GenericRequestEvent) bool
- func (r *Runs) Remove(event *github.GenericRequestEvent)
- func (r *Runs) Watch(log logr.Logger, ctx context.Context, statusUpdater *StatusUpdater, ...) (*tmv1beta1.Testrun, error)
- type StatusUpdater
- func (u *StatusUpdater) GetCommentID() int64
- func (u *StatusUpdater) Init(ctx context.Context, tr *tmv1beta1.Testrun) error
- func (u *StatusUpdater) SetGitHubContext(ctx string)
- func (u *StatusUpdater) Update(ctx context.Context, tr *tmv1beta1.Testrun, dashboardUrl string) error
- func (u *StatusUpdater) UpdateComment(comment string) error
- func (u *StatusUpdater) UpdateStatus(ctx context.Context, state github.State, description string) error
- type TestConfig
Constants ¶
View Source
const (
GitHubCtxPrefix = "TM/"
)
Variables ¶
View Source
var GitHubState = map[argov1.WorkflowPhase]github.State{ tmv1beta1.RunPhaseInit: github.StatePending, tmv1beta1.RunPhasePending: github.StatePending, tmv1beta1.RunPhaseRunning: github.StatePending, tmv1beta1.RunPhaseSuccess: github.StateSuccess, tmv1beta1.RunPhaseFailed: github.StateFailure, tmv1beta1.RunPhaseError: github.StateError, tmv1beta1.RunPhaseTimeout: github.StateError, }
Functions ¶
func FormatInitStatus ¶
Types ¶
type Run ¶
type Run struct { Testrun *v1beta1.Testrun Event *github.GenericRequestEvent }
func GetRunning ¶
func GetRunning(event *github.GenericRequestEvent) (*Run, bool)
GetRunning returns the currently running Testrun for a Event (org, repo, pr)
type Runs ¶
type Runs struct {
// contains filtered or unexported fields
}
func (*Runs) CreateTestrun ¶
func (*Runs) GetRunning ¶
func (r *Runs) GetRunning(event *github.GenericRequestEvent) (*Run, bool)
GetRunning returns the currently running Testrun for a Event (org, repo, pr)
func (*Runs) IsRunning ¶
func (r *Runs) IsRunning(event *github.GenericRequestEvent) bool
IsRunning indicates if a test is running for a Event (org, repo, pr)
func (*Runs) Remove ¶
func (r *Runs) Remove(event *github.GenericRequestEvent)
type StatusUpdater ¶
type StatusUpdater struct {
// contains filtered or unexported fields
}
func NewStatusUpdater ¶
func NewStatusUpdater(log logr.Logger, ghClient github.Client, event *github.GenericRequestEvent) *StatusUpdater
func NewStatusUpdaterFromCommentID ¶
func NewStatusUpdaterFromCommentID(log logr.Logger, ghClient github.Client, event *github.GenericRequestEvent, commentID int64) *StatusUpdater
func (*StatusUpdater) GetCommentID ¶
func (u *StatusUpdater) GetCommentID() int64
func (*StatusUpdater) SetGitHubContext ¶
func (u *StatusUpdater) SetGitHubContext(ctx string)
SetGitHubContext overwrites the default github context that is used as identifier in the github's status.
func (*StatusUpdater) Update ¶
func (u *StatusUpdater) Update(ctx context.Context, tr *tmv1beta1.Testrun, dashboardUrl string) error
Update updates the comment and the github state of the current PR
func (*StatusUpdater) UpdateComment ¶
func (u *StatusUpdater) UpdateComment(comment string) error
UpdateComment updates the current comment of the status updater
func (*StatusUpdater) UpdateStatus ¶
func (u *StatusUpdater) UpdateStatus(ctx context.Context, state github.State, description string) error
UpdateStatus updates the GitHub status of the current PR
type TestConfig ¶
type TestConfig struct { // FilePath is the path to the testrun file that is executed. FilePath string `json:"testrunPath"` // Template configures the test to template the given file before execution. Template bool `json:"template"` // SetValues are the additional values that are used to template a testrun. SetValues []string }
SubTestConfig configures a specific test when called with the test command and the defined sub command
Click to show internal directories.
Click to hide internal directories.