e2e

package
v5.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 44 Imported by: 0

README

Lava E2E

If you wish you can also run E2E tests independently

Lava Protocol E2E

go test ./testutil/e2e/ -run ^TestLavaProtocol$ -v -timeout 1200s

This E2E performs the steps below to test if the system is working as expected.

  1. Start lava in developer mode (equivalent to running the command "ignite chain serve" ).
  2. Check if lava is done booting up by sending a GRPC request.
  3. Send Spec and Plan proposals and stake providers and clients.
  4. Check if the proposals and stakes are properly executed.
  5. Start the JSONRPC Proxy.
  6. Start the JSONRPC Provider.
  7. Start the JSONRPC Gateway.
  8. Check if the JSONRPC Gateway is working as expected by sending a query through the gateway.
  9. Start the Tendermint Provider using the running lava process as RPC.
  10. Start the Tenderming Gateway.
  11. Check if the Tendermint Gateway is working as expected by sending a query through the gateway.
  12. Start the REST Provider using the running lava process as RPC.
  13. Start the REST Provider.
  14. Check if the REST Gateway is working as expected by sending a query through the gateway.
  15. Send multiple requests through each gateway.
  16. Check if a gateway responds with an error.
  17. Check if payments are paid.
  18. Start lava in emergency mode.
  19. Wait until downtime and 2 virtual epochs will be passed.
  20. Send requests to check that max CU was increased.

After the steps above are finished (even if a step fails and the E2E ends) the E2E will save all the captured logs.

Allowed Error List

The allowed error list contains a list of errors that is allowed to happen during tests. The key is the error substring that can be seen in the logs. The value is the description on why this error is allowed.

Documentation

Index

Constants

View Source
const (
	EmergencyModeStartLine     = "+++++++++++ EMERGENCY MODE START ++++++++++"
	EmergencyModeEndLine       = "+++++++++++ EMERGENCY MODE END ++++++++++"
	NumberOfSpecsExpectedInE2E = 10
)
View Source
const OKstr = " OK"

Variables

This section is empty.

Functions

func ExampleStructuredLogging added in v5.5.0

func ExampleStructuredLogging()

Example usage in tests:

Types

type LogEntry added in v5.5.0

type LogEntry struct {
	Timestamp   time.Time              `json:"timestamp"`
	Level       LogLevel               `json:"level"`
	Component   string                 `json:"component"`
	Message     string                 `json:"message"`
	Error       string                 `json:"error,omitempty"`
	Fields      map[string]interface{} `json:"fields,omitempty"`
	StackTrace  string                 `json:"stack_trace,omitempty"`
	ProcessName string                 `json:"process_name,omitempty"`
	ProcessPID  int                    `json:"process_pid,omitempty"`
}

LogEntry represents a structured log entry

type LogLevel added in v5.5.0

type LogLevel string

LogLevel represents the severity of a log entry

const (
	LogLevelDebug   LogLevel = "DEBUG"
	LogLevelInfo    LogLevel = "INFO"
	LogLevelWarning LogLevel = "WARN"
	LogLevelError   LogLevel = "ERROR"
	LogLevelFatal   LogLevel = "FATAL"
)

type ProcessLogger added in v5.5.0

type ProcessLogger struct {
	*StructuredLogger
	// contains filtered or unexported fields
}

ProcessLogger wraps a logger for a specific process

func NewProcessLogger added in v5.5.0

func NewProcessLogger(logger *StructuredLogger, processName string, pid int) *ProcessLogger

NewProcessLogger creates a logger for a specific process

func (*ProcessLogger) Log added in v5.5.0

func (pl *ProcessLogger) Log(level LogLevel, message string, fields map[string]interface{})

Log adds process information to the log entry

func (*ProcessLogger) Write added in v5.5.0

func (pl *ProcessLogger) Write(p []byte) (n int, err error)

Write implements io.Writer interface for process output capture

type SafeBuffer added in v5.7.0

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

SafeBuffer is a thread-safe buffer for capturing command output

func (*SafeBuffer) Bytes added in v5.7.0

func (sb *SafeBuffer) Bytes() []byte

func (*SafeBuffer) String added in v5.7.0

func (sb *SafeBuffer) String() string

func (*SafeBuffer) Write added in v5.7.0

func (sb *SafeBuffer) Write(p []byte) (n int, err error)

func (*SafeBuffer) WriteString added in v5.7.0

func (sb *SafeBuffer) WriteString(s string) (n int, err error)

type StructuredLogger added in v5.5.0

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

StructuredLogger provides thread-safe structured logging

func NewStructuredLogger added in v5.5.0

func NewStructuredLogger(component string) *StructuredLogger

NewStructuredLogger creates a new structured logger

func (*StructuredLogger) AddWriter added in v5.5.0

func (sl *StructuredLogger) AddWriter(w io.Writer)

AddWriter adds an output writer (file, stdout, etc)

func (*StructuredLogger) Debug added in v5.5.0

func (sl *StructuredLogger) Debug(message string, fields ...map[string]interface{})

Debug logs a debug message

func (*StructuredLogger) Error added in v5.5.0

func (sl *StructuredLogger) Error(message string, err error, fields ...map[string]interface{})

Error logs an error message

func (*StructuredLogger) Fatal added in v5.5.0

func (sl *StructuredLogger) Fatal(message string, err error, fields ...map[string]interface{})

Fatal logs a fatal message

func (*StructuredLogger) GetEntriesByLevel added in v5.5.0

func (sl *StructuredLogger) GetEntriesByLevel(level LogLevel) []LogEntry

GetEntriesByLevel returns all entries of a specific level

func (*StructuredLogger) GetEntriesByTimeRange added in v5.5.0

func (sl *StructuredLogger) GetEntriesByTimeRange(start, end time.Time) []LogEntry

GetEntriesByTimeRange returns entries within a time range

func (*StructuredLogger) GetErrors added in v5.5.0

func (sl *StructuredLogger) GetErrors(includeAllowed bool) []LogEntry

GetErrors returns all error entries, optionally filtering out allowed errors

func (*StructuredLogger) Info added in v5.5.0

func (sl *StructuredLogger) Info(message string, fields ...map[string]interface{})

Info logs an info message

func (*StructuredLogger) Log added in v5.5.0

func (sl *StructuredLogger) Log(level LogLevel, message string, fields map[string]interface{})

Log adds a structured log entry

func (*StructuredLogger) SetAllowedErrors added in v5.5.0

func (sl *StructuredLogger) SetAllowedErrors(errors map[string]bool)

SetAllowedErrors sets the map of allowed error patterns

func (*StructuredLogger) SetAllowedErrorsFromMap added in v5.5.0

func (sl *StructuredLogger) SetAllowedErrorsFromMap(errors map[string]string)

SetAllowedErrorsFromMap converts a map[string]string to map[string]bool

func (*StructuredLogger) SetEmergencyMode added in v5.5.0

func (sl *StructuredLogger) SetEmergencyMode(enabled bool)

SetEmergencyMode toggles emergency mode

func (*StructuredLogger) Summary added in v5.5.0

func (sl *StructuredLogger) Summary() map[string]int

Summary returns a summary of log entries

func (*StructuredLogger) Warning added in v5.5.0

func (sl *StructuredLogger) Warning(message string, fields ...map[string]interface{})

Warning logs a warning message

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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