-
Notifications
You must be signed in to change notification settings - Fork 310
[Go SDK] Test helpers + fixture library #515
Copy link
Copy link
Open
Labels
ai-friendlyWell-documented task suitable for AI-assisted developmentWell-documented task suitable for AI-assisted developmentarea:sdkCross-SDK (Python + Go + TS) parity workCross-SDK (Python + Go + TS) parity workenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededsdk:goGo SDK relatedGo SDK related
Milestone
Metadata
Metadata
Assignees
Labels
ai-friendlyWell-documented task suitable for AI-assisted developmentWell-documented task suitable for AI-assisted developmentarea:sdkCross-SDK (Python + Go + TS) parity workCross-SDK (Python + Go + TS) parity workenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededsdk:goGo SDK relatedGo SDK related
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
Add Go test helpers and a captured-fixture library so reasoners can be unit-tested without spinning up a control plane, mirroring the Python
agentfield/testing.pysurface.Part of the epic #508.
Scope
New Files
sdk/go/triggers/testing.goSimulateEvent(t, handler, fixture)andSimulateSchedule(t, handler, opts)— build a*triggers.Contextfrom a fixture and invoke the handler in the same shape the dispatch path usessdk/go/triggers/testdata/*.jsonsdk/python/agentfield/fixtures/triggers/so behavioural parity is provable against the same JSON filessdk/go/triggers/load_fixture.goLoadFixture(t, name)— small helper that openstestdata/nameand unmarshals into the dispatcher envelope shapeInterface
Acceptance
go test -race ./sdk/go/triggers/...passesSimulateEventruns the handler against each of the six fixture files (Stripe, GitHub, Slack, generic_hmac, generic_bearer, cron) and produces the expected*triggers.ContextshapeReferences
sdk/python/agentfield/testing.pyand the fixtures undersdk/python/agentfield/fixtures/triggers/