forked from mtusi2026/mtusi2026lab6
30 lines
985 B
Go
30 lines
985 B
Go
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")
|
|
}
|
|
}
|