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 DiscoveryEntry ¶ added in v0.0.35
type DiscoveryEntry struct {
Name string `json:"name"`
Address string `json:"address"`
GithubWorkflows []string `json:"github_workflows"` //nolint:tagliatelle // API uses snake_case
}
DiscoveryEntry represents an entry in the Hive discovery.json response.
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, suiteFilter 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
// FetchAvailableNetworks fetches the list of available networks from discovery.json.
FetchAvailableNetworks(ctx context.Context) ([]string, error)
// FetchAvailableSuites fetches unique test suite types for a network.
FetchAvailableSuites(ctx context.Context, network string) ([]string, error)
}
Hive is the interface for Hive operations.
type HiveSummaryAlert ¶ added in v0.0.13
type HiveSummaryAlert struct {
Network string `json:"network"`
Suite string `json:"suite,omitempty"` // Optional suite filter - empty means all suites
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.