engine

package
v0.0.0-...-5ce2981 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 19 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionInfo

type SessionInfo struct {
	BaseDir       string
	WorkDir       string
	LanguageName  string
	ToolchainName string
	AutoPush      bool
	CommitOnFail  bool
	BranchName    string
}

SessionInfo contains TCR session information. Used mainly to exchange information between TCR engine and UI

type TcrEngine

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

TcrEngine is the engine running all TCR operations

func (*TcrEngine) GetCurrentRole

func (tcr *TcrEngine) GetCurrentRole() role.Role

GetCurrentRole returns the role currently used for running TCR. Returns nil when TCR engine is in standby

func (*TcrEngine) GetSessionInfo

func (tcr *TcrEngine) GetSessionInfo() SessionInfo

GetSessionInfo provides the information related to the current TCR session. Used mainly by the user interface packages to retrieve and display this information

func (*TcrEngine) Init

func (tcr *TcrEngine) Init(u ui.UserInterface, p params.Params)

Init initializes the TCR engine with the provided parameters, and wires it to the user interface. This function should be called only once during the lifespan of the application

func (*TcrEngine) PrintLog

func (tcr *TcrEngine) PrintLog(p params.Params)

PrintLog prints the TCR git commit history

func (*TcrEngine) PrintStats

func (tcr *TcrEngine) PrintStats(p params.Params)

PrintStats prints the TCR execution stats

func (*TcrEngine) Quit

func (*TcrEngine) Quit()

Quit is the exit point for TCR application

func (*TcrEngine) ReportMobTimerStatus

func (tcr *TcrEngine) ReportMobTimerStatus()

ReportMobTimerStatus reports the status of the mob timer

func (*TcrEngine) RunAsDriver

func (tcr *TcrEngine) RunAsDriver()

RunAsDriver tells TCR engine to start running with driver role

func (*TcrEngine) RunAsNavigator

func (tcr *TcrEngine) RunAsNavigator()

RunAsNavigator tells TCR engine to start running with navigator role

func (*TcrEngine) RunCheck

func (*TcrEngine) RunCheck(p params.Params)

RunCheck checks the provided parameters and prints out corresponding report

func (*TcrEngine) RunTCRCycle

func (tcr *TcrEngine) RunTCRCycle()

RunTCRCycle is the core of TCR engine: e.g. it runs one test && commit || revert cycle

func (*TcrEngine) SetAutoPush

func (tcr *TcrEngine) SetAutoPush(ap bool)

SetAutoPush sets git auto-push to the provided value

func (*TcrEngine) SetCommitOnFail

func (tcr *TcrEngine) SetCommitOnFail(flag bool)

SetCommitOnFail sets git commit-on-fail option to the provided value

func (*TcrEngine) SetRunMode

func (tcr *TcrEngine) SetRunMode(m runmode.RunMode)

SetRunMode sets the run mode for TCR engine

func (*TcrEngine) Stop

func (tcr *TcrEngine) Stop()

Stop is the entry point for telling TCR engine to stop its current operations

func (*TcrEngine) ToggleAutoPush

func (tcr *TcrEngine) ToggleAutoPush()

ToggleAutoPush toggles git auto-push state

type TcrInterface

type TcrInterface interface {
	Init(u ui.UserInterface, p params.Params)

	ToggleAutoPush()
	SetAutoPush(flag bool)
	SetCommitOnFail(flag bool)
	GetCurrentRole() role.Role
	RunAsDriver()
	RunAsNavigator()
	Stop()
	RunTCRCycle()

	GetSessionInfo() SessionInfo
	ReportMobTimerStatus()
	SetRunMode(m runmode.RunMode)
	RunCheck(p params.Params)
	PrintLog(p params.Params)
	PrintStats(p params.Params)
	Quit()
	// contains filtered or unexported methods
}

TcrInterface provides the API for interacting with TCR engine

var (
	// Tcr is TCR Engine singleton instance
	Tcr TcrInterface
)

func NewTcrEngine

func NewTcrEngine() TcrInterface

NewTcrEngine instantiates TCR engine instance

Jump to

Keyboard shortcuts

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