Documentation
¶
Overview ¶
Package contracttest supplies reusable candidate extension contract suites.
Index ¶
- func AdminBody(t *testing.T, f AdminBodyFixture)
- func Attribution(t *testing.T, p attribution.Policy, v attribution.Value)
- func CheckSinkCancellation(ctx context.Context, s event.Sink) error
- func Configuration(t *testing.T, registrations []extension.Registration, ...)
- func EventSink(t *testing.T, newSink func(context.Context) (event.Sink, error))
- func Registry(t *testing.T, registrations []extension.Registration)
- func SecretReferences(t *testing.T, registrations []extension.Registration, ...)
- type AdminBodyFixture
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminBody ¶
func AdminBody(t *testing.T, f AdminBodyFixture)
func Attribution ¶
func Attribution(t *testing.T, p attribution.Policy, v attribution.Value)
Attribution checks every field, explicit absence and defensive context copies. The caller supplies its assembly policy and one valid populated fixture.
func CheckSinkCancellation ¶
CheckSinkCancellation invokes each lifecycle operation with an already canceled context. A stalled callback returns sink_nonconforming at the caller deadline. Test goroutines are probes, never the production delivery model.
func Configuration ¶
func Configuration(t *testing.T, registrations []extension.Registration, input []extension.Envelope)
Configuration expects a complete valid runtime configuration and any required environment references supplied by the caller. It checks local validation, persistence failure isolation, concurrent reads and repeated lifecycle close.
func EventSink ¶
EventSink proves cancellation plus FIFO/barrier and exactly-once concurrent close using independently owned sink implementations. Factories must return a fresh sink for each fixture.
func Registry ¶
func Registry(t *testing.T, registrations []extension.Registration)
Registry checks deterministic, pointer-free projection and ownership isolation.
func SecretReferences ¶
func SecretReferences(t *testing.T, registrations []extension.Registration, input []extension.Envelope, variable, secret string)
SecretReferences checks syntax-only validation with an absent/present env variable and reference-preserving manager/store round trips. Input must use a declared env reference to variable; factories own resolution assertions.
Types ¶
type AdminBodyFixture ¶
type AdminBodyFixture struct {
URL string
Method string
Body []byte
SuccessStatus int
Send func(*http.Request) (*http.Response, error)
CheckUnchanged func(*testing.T)
}
AdminBody checks the shared HTTP body/CORS contract through a real mount. Send adds deployment credentials and performs the request. URL must identify a write accepting Body with SuccessStatus. CheckUnchanged verifies the domain state after each rejected request; no mutation may occur on trailing oversize.