tests

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package tests contains REST API tests for following endpoints:

apiPrefix

Package tests contains REST API tests for following endpoints:

apiPrefix

apiPrefix+"organizations"

apiPrefix+"report/{organization}/{cluster}"

apiPrefix+"clusters/{cluster}/rules/{rule_id}/like"

apiPrefix+"clusters/{cluster}/rules/{rule_id}/dislike"

apiPrefix+"clusters/{cluster}/rules/{rule_id}/reset_vote"

apiPrefix+"organizations/{organization}/clusters"

Index

Constants

View Source
const (

	// ContentTypeJSON represents MIME type for JSON format
	ContentTypeJSON = "application/json; charset=utf-8"

	// ContentTypeText represents MIME type for plain text format
	ContentTypeText = "text/plain; charset=utf-8"
)

common constants used by REST API tests

Variables

This section is empty.

Functions

func BasicTests

func BasicTests()

BasicTests implements basic tests for REST API apiPrefix

func ClustersDetailTests added in v1.2.6

func ClustersDetailTests()

ClustersDetailTests implements tests for REST API endpoints apiPrefix+"rules/{rule_selector}/organizations/{org_id}/users/{user_id}/clusters_detail"

func ClustersTests

func ClustersTests()

ClustersTests implements tests for REST API endpoints apiPrefix+"report/{organization}/{cluster}"

func DisableRuleTests added in v1.1.4

func DisableRuleTests()

DisableRuleTests implements tests for REST API endpoints for disabling etc. rules

func MultipleReportsTests added in v1.1.2

func MultipleReportsTests()

MultipleReportsTests function implements tests for REST API endpoints apiPrefix+"organizations/{organization}/clusters/{clusterList}/reports"

func MultipleReportsTestsUsingPostMethod added in v1.1.2

func MultipleReportsTestsUsingPostMethod()

MultipleReportsTestsUsingPostMethod function implements tests for REST API endpoints apiPrefix+"organizations/{organization}/clusters/reports" in a variant that accepts cluster list in request payload

func OrganizationsTests

func OrganizationsTests()

OrganizationsTests implements tests for REST API endpoints apiPrefix+"organizations"

func ReportsMetadataTests added in v1.2.2

func ReportsMetadataTests()

ReportsMetadataTests implements tests for REST API endpoints apiPrefix+"report/{organization}/{cluster}/info"

func ReportsTests

func ReportsTests()

ReportsTests implements tests for REST API endpoints apiPrefix+"report/{organization}/{cluster}"

func ServerTests

func ServerTests()

ServerTests run all tests for basic REST API endpoints

func VoteTests

func VoteTests()

VoteTests implements tests for REST API endpoints for voting about rules

Types

type ClusterInfo added in v1.2.6

type ClusterInfo struct {
	Cluster string `json:"cluster"`
	// Name     string `json:"cluster_name"`
	// LastSeen string `json:"last_checked_at"`
	Meta ClusterInfoMeta `json:"meta"`
}

ClusterInfo represents the cluster information

type ClusterInfoMeta added in v1.2.6

type ClusterInfoMeta struct {
	Version string `json:"cluster_version"`
}

ClusterInfoMeta represents the cluster metadata information

type ClusterInfoResponse added in v1.2.6

type ClusterInfoResponse struct {
	Clusters []ClusterInfo `json:"clusters"`
	Status   string        `json:"status"`
}

ClusterInfoResponse represents the response containing the cluster information and status

type ClusterListInRequest added in v1.1.2

type ClusterListInRequest struct {
	Clusters []string `json:"clusters"`
}

ClusterListInRequest represents request body containing list of clusters

type ClustersResponse

type ClustersResponse struct {
	Clusters []string `json:"clusters"`
	Status   string   `json:"status"`
}

ClustersResponse represents response containing list of clusters for given organization

type InfoResponse added in v1.1.11

type InfoResponse struct {
	Info   map[string]string `json:"info"`
	Status string            `json:"status"`
}

InfoResponse represents response from /info endpoint

type MultipleReportsResponse added in v1.1.2

type MultipleReportsResponse struct {
	Clusters    []string               `json:"clusters"`
	Errors      []string               `json:"errors"`
	Reports     map[string]interface{} `json:"reports"`
	GeneratedAt string                 `json:"generated_at"`
	Status      string                 `json:"status"`
}

MultipleReportsResponse represents response from the server that contains results for multiple clusters together with overall status

type OrganizationsResponse

type OrganizationsResponse struct {
	Organizations []int  `json:"organizations"`
	Status        string `json:"status"`
}

OrganizationsResponse represents response containing list of organizations

type RuleVoteResponse

type RuleVoteResponse struct {
	RuleVote int    `json:"vote"`
	Status   string `json:"status"`
}

RuleVoteResponse represents response containing rule votes

type StatusOnlyResponse

type StatusOnlyResponse struct {
	Status string `json:"status"`
}

StatusOnlyResponse represents response containing just a status

Jump to

Keyboard shortcuts

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