MCPcopy Create free account
hub / github.com/astercloud/aster / TestRunBatch_StopOnError

Function TestRunBatch_StopOnError

pkg/evals/batch_test.go:179–204  ·  view source on GitHub ↗

TestRunBatch_StopOnError 测试遇错停止

(t *testing.T)

Source from the content-addressed store, hash-verified

177
178// TestRunBatch_StopOnError 测试遇错停止
179func TestRunBatch_StopOnError(t *testing.T) {
180 // 创建一个会失败的 Scorer
181 failingScorer := &failingTestScorer{}
182
183 testCases := make([]*BatchTestCase, 5)
184 for i := range 5 {
185 testCases[i] = &BatchTestCase{
186 ID: string(rune('A' + i)),
187 Input: &TextEvalInput{Answer: "测试"},
188 }
189 }
190
191 cfg := &BatchConfig{
192 TestCases: testCases,
193 Scorers: []Scorer{failingScorer},
194 Concurrency: 1,
195 StopOnError: true,
196 }
197
198 _, err := RunBatch(context.Background(), cfg)
199
200 // 应该返回错误
201 if err == nil {
202 t.Error("RunBatch() expected error with StopOnError=true")
203 }
204}
205
206// TestRunBatch_EmptyTestCases 测试空测试用例
207func TestRunBatch_EmptyTestCases(t *testing.T) {

Callers

nothing calls this directly

Calls 2

RunBatchFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected