attach

package
v0.0.0-...-1d50e38 Latest Latest
Warning

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

Go to latest
Published: May 30, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttachPluginName      = "attach"
	AttachResultsCmd      = "results"
	AttachXunitResultsCmd = "xunit_results"

	AttachResultsAPIEndpoint = "results"
	AttachLogsAPIEndpoint    = "test_logs"

	AttachResultsPostRetries   = 5
	AttachResultsRetrySleepSec = 10 * time.Second
)

Variables

This section is empty.

Functions

func AttachResultsHandler

func AttachResultsHandler(w http.ResponseWriter, r *http.Request)

XXX remove this once the transition is complete... AttachResultsHandler is an API hook for receiving and updating test results

func SendJSONLogs

func SendJSONLogs(pluginLogger plugin.Logger, pluginCom plugin.PluginCommunicator, logs *model.TestLog) (string, error)

SendJSONLogs is responsible for sending the specified logs to the API Server. If successful, it returns a log ID that can be used to refer to the log object in test results.

func SendJSONResults

func SendJSONResults(taskConfig *model.TaskConfig,
	pluginLogger plugin.Logger, pluginCom plugin.PluginCommunicator,
	results *task.TestResults) error

SendJSONResults is responsible for sending the specified file to the API Server

Types

type AttachPlugin

type AttachPlugin struct{}

AttachPlugin has commands for uploading task results and links to files, for display and easy access in the UI.

func (*AttachPlugin) Configure

func (self *AttachPlugin) Configure(map[string]interface{}) error

func (*AttachPlugin) GetAPIHandler

func (self *AttachPlugin) GetAPIHandler() http.Handler

func (*AttachPlugin) GetPanelConfig

func (self *AttachPlugin) GetPanelConfig() (*plugin.PanelConfig, error)

GetPanelConfig returns a plugin.PanelConfig struct representing panels that will be added to the Task and Build pages.

func (*AttachPlugin) GetUIHandler

func (self *AttachPlugin) GetUIHandler() http.Handler

func (*AttachPlugin) Name

func (self *AttachPlugin) Name() string

Name returns the name of this plugin - it serves to satisfy the 'Plugin' interface

func (*AttachPlugin) NewCommand

func (self *AttachPlugin) NewCommand(cmdName string) (plugin.Command,
	error)

NewCommand returns the AttachPlugin - this is to satisfy the 'Plugin' interface

type AttachResultsCommand

type AttachResultsCommand struct {
	// FileLoc describes the relative path of the file to be sent.
	// Note that this can also be described via expansions.
	FileLoc string `mapstructure:"file_location" plugin:"expand"`
}

AttachResultsCommand is used to attach MCI test results in json format to the task page.

func (*AttachResultsCommand) Execute

func (self *AttachResultsCommand) Execute(pluginLogger plugin.Logger,
	pluginCom plugin.PluginCommunicator,
	taskConfig *model.TaskConfig,
	stop chan bool) error

Execute carries out the AttachResultsCommand command - this is required to satisfy the 'Command' interface

func (*AttachResultsCommand) Name

func (self *AttachResultsCommand) Name() string

func (*AttachResultsCommand) ParseParams

func (self *AttachResultsCommand) ParseParams(params map[string]interface{}) error

ParseParams decodes the S3 push command parameters that are specified as part of an AttachPlugin command; this is required to satisfy the 'Command' interface

func (*AttachResultsCommand) Plugin

func (self *AttachResultsCommand) Plugin() string

type AttachXUnitResultsCommand

type AttachXUnitResultsCommand struct {
	// File describes the relative path of the file to be sent. Supports globbing.
	// Note that this can also be described via expansions.
	File  string   `mapstructure:"file" plugin:"expand"`
	Files []string `mapstructure:"files" plugin:"expand"`
}

AttachXUnitResultsCommand reads in an xml file of xunit type results and converts them to a format MCI can use

func (*AttachXUnitResultsCommand) Execute

func (c *AttachXUnitResultsCommand) Execute(pluginLogger plugin.Logger,
	pluginCom plugin.PluginCommunicator,
	taskConfig *model.TaskConfig,
	stop chan bool) error

Execute carries out the AttachResultsCommand command - this is required to satisfy the 'Command' interface

func (*AttachXUnitResultsCommand) Name

func (*AttachXUnitResultsCommand) ParseParams

func (c *AttachXUnitResultsCommand) ParseParams(
	params map[string]interface{}) error

ParseParams reads and validates the command parameters. This is required to satisfy the 'Command' interface

func (*AttachXUnitResultsCommand) Plugin

func (c *AttachXUnitResultsCommand) Plugin() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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