Skip to content

Commit 4d87ae0

Browse files
committed
test: add smoke test based on examples/samples-readme.md
Signed-off-by: Nick Hale <[email protected]>
1 parent 92308bd commit 4d87ae0

File tree

7 files changed

+11566
-2
lines changed

7 files changed

+11566
-2
lines changed

pkg/tests/judge/judge.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ func New[T any](client *openai.Client) (*Judge[T], error) {
8484
}
8585

8686
func (j *Judge[T]) Equal(ctx context.Context, expected, actual T, criteria string) (equal bool, reasoning string, err error) {
87-
comparisonJSON, err := json.MarshalIndent(&comparison[T]{
87+
comparisonJSON, err := json.Marshal(&comparison[T]{
8888
Expected: expected,
8989
Actual: actual,
90-
}, "", " ")
90+
})
9191
if err != nil {
9292
return false, "", fmt.Errorf("failed to marshal judge testcase JSON: %w", err)
9393
}

pkg/tests/smoke/smoke_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ func getActualEvents(t *testing.T, eventsFile string) []event {
175175

176176
var e event
177177
require.NoError(t, json.Unmarshal([]byte(line), &e))
178+
179+
if e.Type == runner.EventTypeCallProgress {
180+
continue
181+
}
182+
178183
events = append(events, e)
179184
}
180185

pkg/tests/smoke/testdata/SamplesReadme/claude-3-5-sonnet-20240620-expected.json

Lines changed: 3871 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)