refactor: remove testify/suite from conformance tests for full parallelism#91
refactor: remove testify/suite from conformance tests for full parallelism#91
Conversation
…elism Replace testify/suite with a custom internal/testsuite runner that discovers Test*(t *testing.T) methods via reflection and runs them as parallel subtests. testify/suite fundamentally doesn't support t.Parallel() (open issue since 2015), and we use none of its advantages. Changes: - Add internal/testsuite package with reflection-based test runner - Refactor Suite structs: methods now take *testing.T parameter and delegate to unexported implementation functions - Change Fixture interface: StandardModel()/ReasoningModel() become NewStandardModel(t)/NewReasoningModel(t) factory methods that can call t.Skip() directly - Update all 8 provider/agent test files to use testsuite.Run() - Add t.Parallel() to all nested subtests - Wrap all fixture models with retry.WrapModel() consistently (was missing on Bedrock, OpenAICompat, DeepSeek) - Fix Google cache test: use soft assertion (assert vs require) since implicit caching is opportunistic, increase prompt to 3000 tokens - Increase Anthropic provider timeout to 5 minutes for reasoning models
d56ca93 to
6147d0f
Compare
|
@claude review |
|
Claude finished @weeco's task in 3m 23s —— View job Code Review
This is a well-executed refactor. The speed improvements are impressive (Google 90%, OpenAI 62%, Anthropic 53%), the design is minimal, and the removal of
|
| // A suite must be a pointer to a struct whose test methods have the signature: | ||
| // | ||
| // func (s *Suite) TestXxx(t *testing.T) | ||
| func Run(t *testing.T, suite any) { |
There was a problem hiding this comment.
Interesting! there's nothing standard out there that already does this?
There was a problem hiding this comment.
testify suite does exactly this but it doesnt have support for parallel test runs, thats why we rebuilt it basically
…, use idiomatic slices
This comment has been minimized.
This comment has been minimized.
The validate functions were discarding the error with `_ error`, causing misleading "Expected value not to be nil" failures when the actual issue was an API timeout or other error.
Summary
Replace
testify/suitewith a custominternal/testsuiterunner that discoversTest*(t *testing.T)methods via reflection and runs them as parallel subtests.testify/suitefundamentally doesn't supportt.Parallel()(open since 2015).Changes
internal/testsuitepackage — reflection-based test runner with parallel executionFixtureinterface:StandardModel()/ReasoningModel()→NewStandardModel(t)/NewReasoningModel(t)factory methodstestsuite.Run()retry.WrapModel()consistently (was missing on Bedrock, OpenAICompat, DeepSeek)Results
Test plan
go build ./...compilestask lintclean (no new issues)go test -short ./...unit tests pass