operator

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Operator package hosts operators needed to interact with different applications or files

Index

Constants

View Source
const FailureTag = "test failure"

Variables

This section is empty.

Functions

This section is empty.

Types

type FailedTest

type FailedTest struct {
	Title   string
	Issues  string
	IssueNo int
}

FailedTest is used to store information about failed test

type GitOperator

type GitOperator struct {
	// contains filtered or unexported fields
}

GitOperator is an object that will do basic operations on GitHub

func NewGitOperator

func NewGitOperator(owner, repo, token string, ctx context.Context) *GitOperator

NewGitOperator provides an implementation of a GitHub Operator with authentication.

func NewUnauthenticatedGitOperator

func NewUnauthenticatedGitOperator(owner, repo string, ctx context.Context) *GitOperator

NewUnauthenticatedGitOperator provides an implementation of a GitHub Operator without authentication.

func (*GitOperator) CloseSolvedIssue

func (g *GitOperator) CloseSolvedIssue(f *FailedTest) error

CloseSolvedIssue closes the open issue based on given test.

func (*GitOperator) GetIssuesByLabel

func (g *GitOperator) GetIssuesByLabel(label string) ([]*github.Issue, error)

GetIssuesByLabel extracts all the open issues labeled with the given label. It returns a slice of github.Issues and an error.

func (*GitOperator) GetTestIssues

func (g *GitOperator) GetTestIssues() ([]*FailedTest, error)

GetTestIssues extracts test related issues from github repository and converts them into a slice of FailedTests. Extracted issues are opened and labeled with 'test failure' label.

func (*GitOperator) PostNewIssue

func (g *GitOperator) PostNewIssue(f *FailedTest) error

GetIssuesByLabel pots a new github issue based on a failing test.

type JUnitOperator

type JUnitOperator struct {
}

JUnitOperator is an object that will do basic operations on JUnit related objects

func (*JUnitOperator) GetFailedTests

func (_ *JUnitOperator) GetFailedTests(opts *options.Options) []*FailedTest

GetFailedTests extracts FailedTests from a GetFailedTests

Jump to

Keyboard shortcuts

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