Summary
A few coverage gaps surfaced during code review. Bundling them so they can be tackled together (or split into separate PRs per package as appropriate).
Cancellation tests for each engine
PR #81 fixed a Starlark goroutine leak by switching to context.AfterFunc, but no test asserts cancellation actually halts execution within a bounded time. Add:
Race test for concurrent AddDataToContext
Tracked also under #93 (ContextProvider thread-safety). Add go test -race goroutines hammering the same parent context.
CompositeProvider edge-case branches
platform/data/compositeProvider.go:138-146 has two subtle branches — "static-only-and-they-all-error" and "non-static-and-all-fail". Add explicit table cases in compositeProvider_test.go.
HTTP loader error-path tests
platform/script/loader/fromHTTP_test.go doesn't cover:
Adapter package coverage
engines/risor/adapters/interfaces.go and engines/starlark/adapters/interfaces.go have zero *_test.go files. They're intentionally tiny interface stubs, but a build-time var _ Adapter = (*sdk.Whatever)(nil) check would catch SDK-side breaking changes early.
Files
engines/{extism,risor,starlark}/evaluator/evaluator_test.go
platform/data/contextProvider_test.go
platform/data/compositeProvider_test.go
platform/script/loader/fromHTTP_test.go
engines/risor/adapters/ (new test file)
engines/starlark/adapters/ (new test file)
Summary
A few coverage gaps surfaced during code review. Bundling them so they can be tackled together (or split into separate PRs per package as appropriate).
Cancellation tests for each engine
PR #81 fixed a Starlark goroutine leak by switching to
context.AfterFunc, but no test asserts cancellation actually halts execution within a bounded time. Add:instance.CallWithContextand should respect context cancellation; verify it does.Race test for concurrent AddDataToContext
Tracked also under #93 (ContextProvider thread-safety). Add
go test -racegoroutines hammering the same parent context.CompositeProvider edge-case branches
platform/data/compositeProvider.go:138-146has two subtle branches — "static-only-and-they-all-error" and "non-static-and-all-fail". Add explicit table cases incompositeProvider_test.go.HTTP loader error-path tests
platform/script/loader/fromHTTP_test.godoesn't cover:Adapter package coverage
engines/risor/adapters/interfaces.goandengines/starlark/adapters/interfaces.gohave zero*_test.gofiles. They're intentionally tiny interface stubs, but a build-timevar _ Adapter = (*sdk.Whatever)(nil)check would catch SDK-side breaking changes early.Files
engines/{extism,risor,starlark}/evaluator/evaluator_test.goplatform/data/contextProvider_test.goplatform/data/compositeProvider_test.goplatform/script/loader/fromHTTP_test.goengines/risor/adapters/(new test file)engines/starlark/adapters/(new test file)