report

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

* Copyright 2021 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	PluginName = "report"
)

Variables

View Source
var HandshakeConfig = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "REPORT_PLUGIN",
	MagicCookieValue: "generator",
}

handshakeConfigs are used to just do a basic handshake between a plugin and host. If the handshake fails, a user friendly error is shown. This prevents users from executing bad plugins or executing a plugin directory. It is a UX feature, not a security feature.

View Source
var PluginMap = map[string]plugin.Plugin{
	PluginName: &ReportPlugin{},
}

pluginMap is the map of plugins we can dispense.

Functions

This section is empty.

Types

type Generator

type Generator interface {
	Config([]byte) error
	Generate(*TestReport) error
}

Generate interface for the report plugin

func NewGenerator

func NewGenerator(name string) (Generator, error)

type ReportPlugin

type ReportPlugin struct {
	// Concrete implementation, written in Go. This is only used for plugins
	// that are written in Go.
	Impl Generator
}

ReportPlugin is the implementation of plugin.Plugin so we can serve/consume this.

func (*ReportPlugin) Client

func (*ReportPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*ReportPlugin) Server

func (p *ReportPlugin) Server(*plugin.MuxBroker) (interface{}, error)

type ReportRPCClient

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

Here is an implementation that talks over RPC

func (*ReportRPCClient) Config

func (m *ReportRPCClient) Config(cfgb []byte) error

func (*ReportRPCClient) Generate

func (m *ReportRPCClient) Generate(tr *TestReport) error

type ReportRPCServer

type ReportRPCServer struct {
	// This is the real implementation
	Impl Generator
}

Here is the RPC server that GenerateRPC talks to, conforming to the requirements of net/rpc

func (*ReportRPCServer) Config

func (m *ReportRPCServer) Config(cfgb []byte, resp *interface{}) error

func (*ReportRPCServer) Generate

func (m *ReportRPCServer) Generate(trb []byte, resp *interface{}) error

type TestReport

type TestReport struct {
	XMLName   *xml.Name          `xml:"testreport" json:"-,omitempty"`
	Name      string             `xml:"name,attr,omitempty" json:"name,omitempty"`
	Version   string             `xml:"version,attr,omitempty" json:"version,omitempty"`
	TestSuite []*junit.TestSuite `xml:"testsuite" json:"testsuite"`
	Total     int                `xml:"tests,attr" json:"tests"`
	Passed    int                `xml:"passed,attr" json:"passed"`
	Skipped   int                `xml:"skipped,attr" json:"skipped"`
	Failures  int                `xml:"failures,attr" json:"failures"`
	Errors    int                `xml:"errors,attr" json:"errors"`
	Started   time.Time          `xml:"started,attr" json:"timestamp"`
	Time      time.Duration      `xml:"time,attr" json:"time"`
}

TestReport is the toplevel object for the plaxrun test report

func NewTestReport

func NewTestReport() *TestReport

NewTestReport builds the TestReport

func (*TestReport) Finish

func (tr *TestReport) Finish(message ...string)

Finish the TestReport

func (*TestReport) Generate

func (tr *TestReport) Generate(name string, cfgb []byte) error

Generate the TestReport

func (*TestReport) HasError

func (tr *TestReport) HasError() bool

HasError determines if test report has any errors

Jump to

Keyboard shortcuts

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