hive

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseURL = "https://hive.ethpandaops.io"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientSummary added in v0.0.13

type ClientSummary struct {
	ClientName    string
	ClientVersion string
	TotalTests    int
	PassedTests   int
	FailedTests   int
	PassRate      float64
	TestTypes     []string
}

ClientSummary represents a summary of test results for a specific client.

type Config

type Config struct {
	BaseURL string
}

Config contains configuration for Hive.

type Hive

type Hive interface {
	// Snapshot takes a screenshot of the test coverage for a specific client.
	Snapshot(ctx context.Context, cfg SnapshotConfig) ([]byte, error)
	// IsAvailable checks if Hive is available for a given network.
	IsAvailable(ctx context.Context, network string) (bool, error)
	// GetBaseURL returns the base URL of the Hive instance.
	GetBaseURL() string
	// FetchTestResults fetches the latest test results for a network.
	FetchTestResults(ctx context.Context, network string) ([]TestResult, error)
	// ProcessSummary processes test results into a summary.
	ProcessSummary(results []TestResult) *SummaryResult
	// MapNetworkName maps the network name to the corresponding Hive network name.
	MapNetworkName(network string) string
}

Hive is the interface for Hive operations.

func NewHive

func NewHive(cfg *Config, httpClient *http.Client) Hive

NewHive creates a new Hive client.

type HiveSummaryAlert added in v0.0.13

type HiveSummaryAlert struct {
	Network        string    `json:"network"`
	DiscordChannel string    `json:"discordChannel"`
	DiscordGuildID string    `json:"discordGuildId"`
	Enabled        bool      `json:"enabled"`
	Schedule       string    `json:"schedule"`
	CreatedAt      time.Time `json:"createdAt"`
	UpdatedAt      time.Time `json:"updatedAt"`
}

HiveSummaryAlert represents a Hive summary alert configuration.

type SnapshotConfig

type SnapshotConfig struct {
	Network       string
	ConsensusNode string
	ExecutionNode string
}

SnapshotConfig contains configuration for taking a screenshot of the test coverage.

func (*SnapshotConfig) Validate

func (c *SnapshotConfig) Validate() error

Validate validates the snapshot configuration.

type SummaryResult added in v0.0.13

type SummaryResult struct {
	Network         string
	Timestamp       time.Time
	TotalTests      int
	TotalPasses     int
	TotalFails      int
	OverallPassRate float64
	ClientResults   map[string]*ClientSummary
	TestTypes       map[string]struct{} // Set of unique test types.
}

SummaryResult represents the overall summary of Hive test results.

type TestResult added in v0.0.13

type TestResult struct {
	Name        string            `json:"name"`
	Client      string            `json:"client"`
	Version     string            `json:"version"`
	NTests      int               `json:"ntests"`
	Passes      int               `json:"passes"`
	Fails       int               `json:"fails"`
	FileName    string            `json:"fileName"`
	Timestamp   time.Time         `json:"timestamp"`
	TestSuiteID string            `json:"testSuiteId"`
	Clients     []string          `json:"clients"`
	Versions    map[string]string `json:"versions"`
}

TestResult represents a single test result from Hive.

Jump to

Keyboard shortcuts

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