apitesting

package
v0.110.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncResponse

type AsyncResponse struct {
	ContextIDs []string `json:"contextIds,omitempty"`
	EventIDs   []string `json:"eventIds,omitempty"`
	TaskID     string   `json:"taskId,omitempty"`
	TestIDs    []string `json:"testIds,omitempty"`
}

AsyncResponse describes the json response from the async api endpoints.

type Client

type Client struct {
	HTTPClient *http.Client
	URL        string
	Username   string
	AccessKey  string
}

Client describes an interface to the api-testing rest endpoints.

func New

func New(url string, username string, accessKey string, timeout time.Duration) Client

New returns a apitesting.Client

func (*Client) GetProject

func (c *Client) GetProject(ctx context.Context, hookID string) (Project, error)

GetProject returns Project metadata for a given hookID.

func (*Client) RunAllAsync

func (c *Client) RunAllAsync(ctx context.Context, hookID string, buildID string, tunnel config.Tunnel) ([]TestResult, error)

RunAllAsync runs all the tests for the project described by hookID and returns without waiting for their results.

func (*Client) RunAllSync

func (c *Client) RunAllSync(ctx context.Context, hookID string, buildID string, tunnel config.Tunnel) ([]TestResult, error)

RunAllSync sychronously runs all the tests for a project described by hookID.

func (*Client) RunTagAsync

func (c *Client) RunTagAsync(ctx context.Context, hookID string, testTag string, buildID string, tunnel config.Tunnel) ([]TestResult, error)

RunTagAsync runs all the tests for a testTag for a project described by hookID and returns without waiting for results.

func (*Client) RunTagSync

func (c *Client) RunTagSync(ctx context.Context, hookID string, testTag string, buildID string, tunnel config.Tunnel) ([]TestResult, error)

RunTagSync sychronously runs the all the tests tagged with testTag for a project described by hookID.

func (*Client) RunTestAsync

func (c *Client) RunTestAsync(ctx context.Context, hookID string, testID string, buildID string, tunnel config.Tunnel) ([]TestResult, error)

RunTestAsync runs a single test described by testID for the project described by hookID and returns without waiting for results.

func (*Client) RunTestSync

func (c *Client) RunTestSync(ctx context.Context, hookID string, testID string, buildID string, tunnel config.Tunnel) ([]TestResult, error)

RunTestSync sychronously runs a single testID for a project described by hookID.

type Project

type Project struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

Project describes the metadata for an api testing project.

type Test

type Test struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

Test describes a single test.

type TestResult

type TestResult struct {
	EventID       string  `json:"id,omitempty"`
	FailuresCount int     `json:"failuresCount,omitempty"`
	Project       Project `json:"project,omitempty"`
	Test          Test    `json:"test,omitempty"`
	Async         bool    `json:"-,omitempty"`
}

TestResult describes the result from running an api test.

Jump to

Keyboard shortcuts

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