internal

package
v0.0.0-...-dbff1ec Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderTemplate

func RenderTemplate(customTemplate string, examples []RspecExample) (string, error)

func ReportFlakies

func ReportFlakies(reporter Reporter, flakies []RspecExample) error

Types

type Config

type Config struct {
	Command         string        `toml:"command,omitempty"`
	Arguments       string        `toml:"arguments,omitempty"`
	RerunArguments  string        `toml:"rerun_arguments,omitempty"`
	PersistenceFile string        `toml:"persistence_file,omitempty"`
	Github          *GithubConfig `toml:"github,omitempty"`
	Jira            *JiraConfig   `toml:"jira,omitempty"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

func (*Config) CollectExamples

func (c *Config) CollectExamples() ([]RspecExample, error)

func (*Config) GetReporter

func (c *Config) GetReporter() Reporter

func (*Config) RerunCommand

func (c *Config) RerunCommand(pattern []string) string

func (*Config) RunCommand

func (c *Config) RunCommand(pattern []string) string

type GithubConfig

type GithubConfig struct {
	Owner    string   `toml:"owner,omitempty"`
	Repo     string   `toml:"repo,omitempty"`
	Template string   `toml:"template,omitempty"`
	Labels   []string `toml:"labels,omitempty"`
	Reopen   bool     `toml:"reopen,omitempty"`
	// contains filtered or unexported fields
}

func (*GithubConfig) GetToken

func (gc *GithubConfig) GetToken() string

func (*GithubConfig) Prepare

func (gc *GithubConfig) Prepare() error

type GithubReporter

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

func NewGithubReporter

func NewGithubReporter(gc *GithubConfig) *GithubReporter

func (*GithubReporter) Init

func (gr *GithubReporter) Init() error

func (*GithubReporter) ReportFlaky

func (gr *GithubReporter) ReportFlaky(flakies []RspecExample) error

func (*GithubReporter) Verify

func (gr *GithubReporter) Verify() error

type JiraConfig

type JiraConfig struct {
	EpicId     string   `toml:"epic_id,omitempty"`
	ProjectId  string   `toml:"project_id,omitempty"`
	TaskTypeId string   `toml:"task_type_id,omitempty"`
	Template   string   `toml:"template,omitempty"`
	Labels     []string `toml:"labels,omitempty"`
	// contains filtered or unexported fields
}

func (*JiraConfig) GetHost

func (jc *JiraConfig) GetHost() string

func (*JiraConfig) GetToken

func (jc *JiraConfig) GetToken() string

func (*JiraConfig) GetUser

func (jc *JiraConfig) GetUser() string

func (*JiraConfig) Prepare

func (jc *JiraConfig) Prepare() error

type JiraReporter

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

func NewJiraReporter

func NewJiraReporter(jc *JiraConfig) *JiraReporter

func (*JiraReporter) Init

func (jr *JiraReporter) Init() error

func (*JiraReporter) ReportFlaky

func (jr *JiraReporter) ReportFlaky(flakies []RspecExample) error

func (*JiraReporter) Verify

func (jr *JiraReporter) Verify() error

type JiraSimpleComment

type JiraSimpleComment struct {
	Body string `json:"body"`
}

type NullReporter

type NullReporter struct{}

func (*NullReporter) Init

func (r *NullReporter) Init() error

func (*NullReporter) ReportFlaky

func (r *NullReporter) ReportFlaky(flakies []RspecExample) error

func (*NullReporter) Verify

func (r *NullReporter) Verify() error

type Reporter

type Reporter interface {
	Init() error
	ReportFlaky([]RspecExample) error
	Verify() error
}

type RspecExample

type RspecExample struct {
	Id     string
	Status string
}

func FindFlakies

func FindFlakies(firstRun []RspecExample, secondRun []RspecExample) []RspecExample

func ParseRspecExample

func ParseRspecExample(line string) RspecExample

func (*RspecExample) Failed

func (r *RspecExample) Failed() bool

func (*RspecExample) Filename

func (r *RspecExample) Filename() string

func (*RspecExample) Passed

func (r *RspecExample) Passed() bool

type Runner

type Runner struct {
	Settings *Settings
}

func (*Runner) Run

func (r *Runner) Run() RunnerResult

type RunnerResult

type RunnerResult struct {
	StatusCode    int
	Error         error
	FlakyExamples []RspecExample
}

func (*RunnerResult) HasFlakies

func (rr *RunnerResult) HasFlakies() bool

type Settings

type Settings struct {
	SkipRerun  bool
	ConfigPath string
	Config     Config
	Pattern    []string
}

func (*Settings) Load

func (s *Settings) Load(cCtx *cli.Context) error

func (*Settings) Validate

func (s *Settings) Validate() error

type TemplateData

type TemplateData struct {
	Examples []RspecExample
	Env      map[string]string
}

Jump to

Keyboard shortcuts

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