@@ -17,6 +17,8 @@ limitations under the License.
17
17
package webhook
18
18
19
19
import (
20
+ "time"
21
+
20
22
"github.com/google/go-cmp/cmp/cmpopts"
21
23
"github.com/onsi/ginkgo/v2"
22
24
"github.com/onsi/gomega"
@@ -26,6 +28,10 @@ import (
26
28
"github.com/inftyai/llmaz/test/util/wrapper"
27
29
)
28
30
31
+ var (
32
+ testTime = metav1 .Date (2025 , 6 , 20 , 10 , 0 , 0 , 0 , time .UTC )
33
+ )
34
+
29
35
var _ = ginkgo .Describe ("model default and validation" , func () {
30
36
31
37
// Delete all the Models for each case.
@@ -75,6 +81,14 @@ var _ = ginkgo.Describe("model default and validation", func() {
75
81
return wrapper .MakeModel ("llama3-8b" ).ModelSourceWithModelID ("LLM-Research/Meta-Llama-3-8B" , "" , "main" , nil , nil ).ModelSourceWithModelHub ("ModelScope" ).FamilyName ("llama3" ).Label (coreapi .ModelFamilyNameLabelKey , "llama3" ).OwnedBy ("custom-owner" ).Obj ()
76
82
},
77
83
}),
84
+ ginkgo .Entry ("set custom createdAt" , & testDefaultingCase {
85
+ model : func () * coreapi.OpenModel {
86
+ return wrapper .MakeModel ("llama3-8b" ).FamilyName ("llama3" ).ModelSourceWithModelHub ("ModelScope" ).ModelSourceWithModelID ("LLM-Research/Meta-Llama-3-8B" , "" , "" , nil , nil ).CreatedAt (testTime ).Obj ()
87
+ },
88
+ wantModel : func () * coreapi.OpenModel {
89
+ return wrapper .MakeModel ("llama3-8b" ).ModelSourceWithModelID ("LLM-Research/Meta-Llama-3-8B" , "" , "main" , nil , nil ).ModelSourceWithModelHub ("ModelScope" ).FamilyName ("llama3" ).Label (coreapi .ModelFamilyNameLabelKey , "llama3" ).OwnedBy (coreapi .DefaultOwnedBy ).CreatedAt (testTime ).Obj ()
90
+ },
91
+ }),
78
92
)
79
93
80
94
type testValidatingCase struct {
0 commit comments