@@ -63,10 +63,6 @@ func defineProgrammableModel(r *registry.Registry) *programmableModel {
63
63
}
64
64
65
65
func TestGenerateAction (t * testing.T ) {
66
- cmpopts := cmp.Options {
67
- cmpopts .EquateEmpty (),
68
- }
69
-
70
66
data , err := os .ReadFile ("../../tests/specs/generate.yaml" )
71
67
if err != nil {
72
68
t .Fatalf ("failed to read spec file: %v" , err )
@@ -105,6 +101,9 @@ func TestGenerateAction(t *testing.T) {
105
101
}
106
102
resp := tc .ModelResponses [reqCounter ]
107
103
resp .Request = req
104
+ resp .Custom = map [string ]any {}
105
+ resp .Request .Output = & ModelRequestOutput {}
106
+ resp .Usage = & GenerationUsage {}
108
107
reqCounter ++
109
108
return resp , nil
110
109
}
@@ -128,7 +127,7 @@ func TestGenerateAction(t *testing.T) {
128
127
t .Errorf ("chunks mismatch (-want +got):\n %s" , diff )
129
128
}
130
129
131
- if diff := cmp .Diff (tc .ExpectResponse , resp , cmpopts ); diff != "" {
130
+ if diff := cmp .Diff (tc .ExpectResponse , resp , cmp. Options { cmpopts . EquateEmpty ()} ); diff != "" {
132
131
t .Errorf ("response mismatch (-want +got):\n %s" , diff )
133
132
}
134
133
} else {
@@ -137,7 +136,7 @@ func TestGenerateAction(t *testing.T) {
137
136
t .Fatalf ("action failed: %v" , err )
138
137
}
139
138
140
- if diff := cmp .Diff (tc .ExpectResponse , resp , cmpopts ); diff != "" {
139
+ if diff := cmp .Diff (tc .ExpectResponse , resp , cmp. Options { cmpopts . EquateEmpty ()} ); diff != "" {
141
140
t .Errorf ("response mismatch (-want +got):\n %s" , diff )
142
141
}
143
142
}
0 commit comments