forked from mtusi2026/mtusi2026lab6
feat: add bounded observability and verified SLO incident alerts
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"gitea.privcloud.tech/vlad_marlo/mtusi2026lab6/internal/config"
|
||||
)
|
||||
|
||||
// TestTelemetryInvalidConfiguration rejects invalid sampling before lifecycle registration.
|
||||
func TestTelemetryInvalidConfiguration(t *testing.T) {
|
||||
t.Setenv("OTEL_SAMPLE_RATIO", "invalid")
|
||||
if _, err := apiTelemetry(nil); err == nil {
|
||||
t.Fatal("invalid sampling accepted")
|
||||
}
|
||||
}
|
||||
|
||||
// TestObservedObjectsInvalidEndpoint propagates S3 construction errors before instrumentation.
|
||||
func TestObservedObjectsInvalidEndpoint(t *testing.T) {
|
||||
if _, err := observedObjects(&config.ObjectStore{Endpoint: "http://invalid/path"}, nil); err == nil {
|
||||
t.Fatal("invalid object endpoint accepted")
|
||||
}
|
||||
}
|
||||
|
||||
// TestObservedHTTPInvalidConfiguration rejects invalid listener settings before adding an observer.
|
||||
func TestObservedHTTPInvalidConfiguration(t *testing.T) {
|
||||
if _, err := observedHTTP(observedHTTPParams{Config: &config.Controller{}}); err == nil {
|
||||
t.Fatal("invalid listener accepted")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user