Help us shape the future of Go! Take the 2026 Go Developer Survey

e2e

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReadinessReady   = "ready"
	ReadinessWarning = "warning"
	ReadinessBlocked = "blocked"
	ReadinessUnknown = "unknown"

	ReadinessActionNone    = "none"
	ReadinessActionApprove = "approve"
	ReadinessActionFund    = "fund"

	DepositCapUSDFCBaseUnits = "2000000000000000000"
	FundingBufferBaseUnits   = "500000000000000000"
)
View Source
const (
	CalibrationPrivateKeyEnv = "SYNAPS3_CALIBRATION_PRIVATE_KEY"
	TestEnvFileName          = ".env.test"
)

Variables

View Source
var CriticalReadinessChecks = []string{
	"network_match",
	"wallet_fil_gas",
	"providers",
	"storage_cost",
	"payment_funding",
	"fwss_approval",
}

Functions

func AssertS3Object

func AssertS3Object(t testing.TB, ctx context.Context, client *awss3.Client, bucket, key string, want []byte, checksum [sha256.Size]byte)

func BufferedFundingAmount

func BufferedFundingAmount(requiredText, capText, bufferText string) (string, error)

BufferedFundingAmount adds an optional buffer without reducing the required amount to fit the transaction cap.

func CriticalReadinessSatisfied

func CriticalReadinessSatisfied(result ReadinessResult) bool

func DiagnosticValue

func DiagnosticValue(value any) string

func Eventually

func Eventually[T any](
	t testing.TB,
	ctx context.Context,
	timeout time.Duration,
	description string,
	poll func(context.Context) (T, bool, error),
	options ...EventuallyOption,
) T

func LoadCalibrationPrivateKey

func LoadCalibrationPrivateKey(repoRoot string) (string, error)

func NewS3Client

func NewS3Client(endpoint, accessKey, secretKey string) *awss3.Client

func NewUnixSocketS3Client

func NewUnixSocketS3Client(socketPath, accessKey, secretKey string) *awss3.Client

func ReadDotEnvFile

func ReadDotEnvFile(path string) (map[string]string, error)

func Redact

func Redact(value string) string

func RepoRootFrom

func RepoRootFrom(start string) (string, error)

Types

type AdminClient

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

AdminClient is a small black-box client for the SynapS3 Admin API.

func NewAdminClient

func NewAdminClient(t testing.TB, baseURL string, options ...AdminClientOption) *AdminClient

NewAdminClient creates an Admin API client with cookie support.

func (*AdminClient) Authenticate

func (a *AdminClient) Authenticate(ctx context.Context, username, password string) error

func (*AdminClient) BaseURL

func (a *AdminClient) BaseURL() string

func (*AdminClient) CreateS3User

func (a *AdminClient) CreateS3User(t testing.TB, ctx context.Context) S3Credentials

func (*AdminClient) DoJSON

func (a *AdminClient) DoJSON(ctx context.Context, method, path string, payload, output any) (string, error)

func (*AdminClient) GetJSON

func (a *AdminClient) GetJSON(ctx context.Context, path string, output any) (string, error)

func (*AdminClient) Health

func (*AdminClient) Login

func (a *AdminClient) Login(t testing.TB, ctx context.Context, username, password string)

func (*AdminClient) PostJSON

func (a *AdminClient) PostJSON(t testing.TB, ctx context.Context, path string, payload, output any)

func (*AdminClient) Settings

func (a *AdminClient) Settings(ctx context.Context) (SettingsResponse, string, error)

type AdminClientOption

type AdminClientOption func(*AdminClient)

func WithAdminTimeout

func WithAdminTimeout(timeout time.Duration) AdminClientOption

type BoundedLog

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

func NewBoundedLog

func NewBoundedLog(limit int) *BoundedLog

func (*BoundedLog) String

func (b *BoundedLog) String() string

func (*BoundedLog) Write

func (b *BoundedLog) Write(p []byte) (int, error)

type DataSetObservation

type DataSetObservation struct {
	Facts struct {
		BucketName     string  `json:"bucket_name"`
		ProviderID     string  `json:"provider_id"`
		ChainDataSetID *string `json:"chain_data_set_id,omitempty"`
	} `json:"facts"`
	Signal struct {
		Status      string   `json:"status"`
		Level       string   `json:"level"`
		ReasonCodes []string `json:"reason_codes"`
		LastError   *string  `json:"last_error,omitempty"`
	} `json:"signal"`
}

type DataSetObservationPage

type DataSetObservationPage struct {
	Items   []DataSetObservation `json:"items"`
	Summary ObservabilitySummary `json:"summary"`
}

type EventuallyOption

type EventuallyOption func(*eventuallyOptions)

func WithPollInterval

func WithPollInterval(interval time.Duration) EventuallyOption

type HealthResponse

type HealthResponse struct {
	Status string   `json:"status"`
	Errors []string `json:"errors,omitempty"`
}

type ObjectListItem

type ObjectListItem struct {
	Key              string         `json:"key"`
	CurrentVersionID string         `json:"current_version_id"`
	State            string         `json:"state"`
	Status           string         `json:"status"`
	Location         ObjectLocation `json:"location"`
}

type ObjectListResponse

type ObjectListResponse struct {
	Objects []ObjectListItem `json:"objects"`
}

type ObjectLocation

type ObjectLocation struct {
	Cache    bool `json:"cache"`
	Filecoin bool `json:"filecoin"`
}

type ObservabilitySummary

type ObservabilitySummary struct {
	Total       int `json:"total"`
	Available   int `json:"available"`
	Degraded    int `json:"degraded"`
	Unavailable int `json:"unavailable"`
	Unknown     int `json:"unknown"`
}

type ProvenanceCopy

type ProvenanceCopy struct {
	Status       string `json:"status"`
	ProviderID   string `json:"provider_id"`
	DataSetID    string `json:"data_set_id"`
	PieceID      string `json:"piece_id"`
	RetrievalURL string `json:"retrieval_url"`
}

type ProvenanceResponse

type ProvenanceResponse struct {
	State           string           `json:"state"`
	Status          string           `json:"status"`
	RequestedCopies int              `json:"requested_copies"`
	SuccessCopies   int              `json:"success_copies"`
	Copies          []ProvenanceCopy `json:"copies"`
}

type ProviderObservation

type ProviderObservation struct {
	Facts struct {
		ProviderID   string  `json:"provider_id"`
		Active       *bool   `json:"active,omitempty"`
		HasPDP       *bool   `json:"has_pdp,omitempty"`
		ServiceURL   *string `json:"service_url,omitempty"`
		HealthStatus *string `json:"health_status,omitempty"`
	} `json:"facts"`
	Signal struct {
		Status      string   `json:"status"`
		Level       string   `json:"level"`
		ReasonCodes []string `json:"reason_codes"`
		LastError   *string  `json:"last_error,omitempty"`
	} `json:"signal"`
}

type ProviderObservationPage

type ProviderObservationPage struct {
	Items   []ProviderObservation `json:"items"`
	Summary ObservabilitySummary  `json:"summary"`
}

type ReadinessCheck

type ReadinessCheck struct {
	ID            string `json:"id"`
	Status        string `json:"status"`
	Message       string `json:"message"`
	Action        string `json:"action,omitempty"`
	RequiredUSDFC string `json:"required_usdfc,omitempty"`
}

func NonCriticalWarnings

func NonCriticalWarnings(result ReadinessResult) []ReadinessCheck

type ReadinessPlan

type ReadinessPlan struct {
	Action string
	Amount string
	Ready  bool
}

func PlanReadinessAction

func PlanReadinessAction(state ReadinessPlanState) (ReadinessPlan, error)

type ReadinessPlanState

type ReadinessPlanState struct {
	Readiness        ReadinessResult
	USDFCWallet      string
	ApproveAttempted bool
	FundAttempted    bool
	DepositCap       string
	FundingBuffer    string
}

type ReadinessResult

type ReadinessResult struct {
	Status        string            `json:"status"`
	Mode          string            `json:"mode"`
	Checks        []ReadinessCheck  `json:"checks"`
	PartialErrors map[string]string `json:"partial_errors,omitempty"`
}

func (ReadinessResult) Check

func (r ReadinessResult) Check(id string) (ReadinessCheck, bool)

type S3Credentials

type S3Credentials struct {
	AccessKey string `json:"access_key"`
	SecretKey string `json:"secret_key"`
	Role      string `json:"role"`
}

type SettingsResponse

type SettingsResponse struct {
	Mode             string `json:"mode"`
	RuntimeAvailable bool   `json:"runtime_available"`
}

type TaskItem

type TaskItem struct {
	ID                 int64   `json:"id"`
	Type               string  `json:"type"`
	Operation          string  `json:"operation"`
	Status             string  `json:"status"`
	PresentationStatus string  `json:"presentation_status"`
	SubjectType        *string `json:"subject_type,omitempty"`
	SubjectKey         *string `json:"subject_key,omitempty"`
	RetryCount         int     `json:"retry_count"`
	MaxAttempts        *int    `json:"max_attempts"`
	LastError          *string `json:"last_error,omitempty"`
	StatusMessage      *string `json:"status_message,omitempty"`
	WaitReason         *string `json:"wait_reason,omitempty"`
	AvailableAt        string  `json:"available_at"`
}

type TaskListResponse

type TaskListResponse struct {
	Tasks      []TaskItem `json:"tasks"`
	NextCursor *int64     `json:"next_cursor,omitempty"`
}

type WaitSnapshot

type WaitSnapshot struct {
	Description string `json:"description"`
	Last        any    `json:"last,omitempty"`
	LastError   string `json:"last_error,omitempty"`
	Elapsed     string `json:"elapsed"`
}

func NewWaitSnapshot

func NewWaitSnapshot(description string, started time.Time, last any, lastErr error) WaitSnapshot

type WalletBalances

type WalletBalances struct {
	USDFC *string `json:"usdfc"`
}

type WalletOperation

type WalletOperation struct {
	ID              int64   `json:"id"`
	Type            string  `json:"type"`
	ClientRequestID string  `json:"client_request_id"`
	Amount          string  `json:"amount"`
	Status          string  `json:"status"`
	TxHash          *string `json:"tx_hash,omitempty"`
	LastError       *string `json:"last_error,omitempty"`
}

type WalletOperationResponse

type WalletOperationResponse struct {
	Operation WalletOperation `json:"operation"`
}

type WalletOperationsResponse

type WalletOperationsResponse struct {
	Operations []WalletOperation `json:"operations"`
}

type WalletResponse

type WalletResponse struct {
	WalletBalances *WalletBalances `json:"wallet_balances,omitempty"`
}

Jump to

Keyboard shortcuts

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