execution

package
v1.3.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Overview

Package execution handles the execution of cases and sequences.

This includes showing the templates for the different parts of the execution (start page, step page, summary page), saving the results of a step and the protocol of the completed execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaseExecutionPost

func CaseExecutionPost(protocolLister test.ProtocolLister, caseProtocolStore CaseProtocolStore,
	caseSession CaseSession, sequenceSessionGetter SequenceSessionGetter,

	sequenceSession SequenceSession, sequenceProtocolAdder SequenceProtocolAdder,
	progress progressMeter, testSequenceVersion *test.SequenceVersion, testCaseGetter handler.TestCaseGetter) http.HandlerFunc

CaseExecutionPost handles all post requests during a testcase execution. It is a meta handler that further calls it's sub handlers.

func CaseStartPageGet

func CaseStartPageGet(cs CaseSession, ss SequenceSessionGetter) http.HandlerFunc

CaseStartPageGet serves the start page for testcase executions.

func SequenceExecutionPost

func SequenceExecutionPost(caseProtocolLister, sequenceProtocolLister test.ProtocolLister,
	caseProtocolStore CaseProtocolStore, sequenceProtocolAdder SequenceProtocolAdder,
	caseSession CaseSession, sequenceSession SequenceSession, tcg handler.TestCaseGetter, tsg middleware.TestSequenceStore) http.HandlerFunc

SequenceExecutionPost returns a handler capable of handling every request during the execution of a sequence.

func SequenceStarPageGet

func SequenceStarPageGet(time TimeSession, caseGetter CaseProtocolGetter,
	getter SequenceSessionGetter) http.HandlerFunc

SequenceStarPageGet serves the start page for a testsequence execution.

Types

type CaseProtocolAdder

type CaseProtocolAdder interface {
	// AddCaseProtocol adds the given protocol to the store
	AddCaseProtocol(r *test.CaseExecutionProtocol, testCaseVersion test.CaseVersion) (err error)
}

CaseProtocolAdder is used to add new testcase protocols to the store.

type CaseProtocolCleaner

type CaseProtocolCleaner interface {
	CaseSessionGetter
	//RemoveCurrentCaseProtocol removes the current case protocol from the session.
	RemoveCurrentCaseProtocol(w http.ResponseWriter, r *http.Request) error
}

CaseProtocolCleaner is used to clean the testcase session after a new protocol has been successfully added.

type CaseProtocolGetter

type CaseProtocolGetter interface {
	// GetCaseExecutionProtocol gets the protocol with the given id for the testcase with given id,
	// which is part of the project with given id.
	GetCaseExecutionProtocol(protocolID id.ProtocolID) (test.CaseExecutionProtocol, error)
}

CaseProtocolGetter is used to get testcase protocols from the store.

type CaseProtocolStore

type CaseProtocolStore interface {
	CaseProtocolAdder
	CaseProtocolGetter
	// GetCaseExecutionProtocols gets the protocols for the testcase with given id,
	// which is part of the project with given id.
	GetCaseExecutionProtocols(testCaseID id.TestID) ([]test.CaseExecutionProtocol, error)
}

CaseProtocolStore interface for storing testcase protocols.

type CaseSession

type CaseSession interface {
	CaseSessionUpdater
	//RemoveCurrentCaseProtocol removes the current case protocol from the session.
	RemoveCurrentCaseProtocol(w http.ResponseWriter, r *http.Request) error
	TimeSession
}

CaseSession is used to manage the session for testcases during execution.

type CaseSessionGetter

type CaseSessionGetter interface {
	//GetCurrentCaseProtocol returns the protocol to the currently running case execution to the given request.
	//If there is no case execution running, the function will return nil, nil
	//If an error occurs nil and the error will be returned
	GetCurrentCaseProtocol(r *http.Request) (*test.CaseExecutionProtocol, error)
}

CaseSessionGetter is used to get the testcase currently contained within a session.

type CaseSessionSetter

type CaseSessionSetter interface {
	//SetCurrentCaseProtocol saves the given protocol to the session.
	//After this call, you can get the current case protocol via the GetCurrentCaseProtocol-function
	SetCurrentCaseProtocol(w http.ResponseWriter, r *http.Request, protocol *test.CaseExecutionProtocol) error
}

CaseSessionSetter is used to set the managed testcase during a session.

type CaseSessionUpdater

type CaseSessionUpdater interface {
	CaseSessionGetter
	CaseSessionSetter
}

CaseSessionUpdater is used to update the testcase currently contained within a session.

type SequenceProtocolAdder

type SequenceProtocolAdder interface {
	// AddSequenceProtocol adds the given protocol to the store
	AddSequenceProtocol(r *test.SequenceExecutionProtocol, sequenceVersion test.SequenceVersion) (err error)
}

SequenceProtocolAdder interface for storing testsequence protocols.

type SequenceProtocolStore

type SequenceProtocolStore interface {
	SequenceProtocolAdder
	// GetSequenceExecutionProtocols gets the protocols for the testsequence with given id,
	// which is part of the project with given id.
	GetSequenceExecutionProtocols(projectID, sequenceID string) ([]test.SequenceExecutionProtocol, error)
	// GetSequenceExecutionProtocol gets the protocol with the given id for the testsequence with given id,
	// which is part of the project with given id.
	GetSequenceExecutionProtocol(projectID, sequenceID string, protocolID int) (test.SequenceExecutionProtocol, error)
}

SequenceProtocolStore interface for storing testsequence protocols.

type SequenceSession

type SequenceSession interface {
	SequenceSessionSetter
	//RemoveCurrentSequenceProtocol removes the current sequence protocol from the session.
	RemoveCurrentSequenceProtocol(w http.ResponseWriter, r *http.Request) error
	SequenceSessionGetter
	TimeSession
}

SequenceSession is the session that stores sequence data during execution of a testsequence.

type SequenceSessionGetter

type SequenceSessionGetter interface {
	//GetCurrentSequenceProtocol returns the protocol to the currently running sequence execution to the given request.
	//If there is no sequence execution running, the function will return nil, nil
	//If an error occurs nil and the error will be returned
	GetCurrentSequenceProtocol(r *http.Request) (*test.SequenceExecutionProtocol, error)
}

SequenceSessionGetter interface for retrieving testsequence protocols.

type SequenceSessionSetter

type SequenceSessionSetter interface {
	//SetCurrentSequenceProtocol saves the given protocol to the session.
	//After this call, you can get the current sequence protocol via the GetCurrentSequenceProtocol-function
	SetCurrentSequenceProtocol(w http.ResponseWriter, r *http.Request,
		protocol *test.SequenceExecutionProtocol) error
}

SequenceSessionSetter is used to set the managed testsequence protocol during requests.

type TimeSession

type TimeSession interface {
	//GetDuration returns the duration needed in this execution til now.
	//If there is no sequence execution running, the function will return nil, nil
	//If an error occurs nil and the error will be returned
	GetDuration(r *http.Request) (*duration.Duration, error)
	//SetDuration saves the given duration to the session.
	//After this call, you can get the current duration via the GetDuration-function
	SetDuration(w http.ResponseWriter, r *http.Request, duration *duration.Duration) error
}

TimeSession is used to store time in during requests.

Jump to

Keyboard shortcuts

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