@@ -17,6 +17,8 @@ limitations under the License.
1717package webhook
1818
1919import (
20+ "time"
21+
2022 "github.com/google/go-cmp/cmp/cmpopts"
2123 "github.com/onsi/ginkgo/v2"
2224 "github.com/onsi/gomega"
@@ -26,6 +28,10 @@ import (
2628 "github.com/inftyai/llmaz/test/util/wrapper"
2729)
2830
31+ var (
32+ testTime = metav1 .Date (2025 , 6 , 20 , 10 , 0 , 0 , 0 , time .UTC )
33+ )
34+
2935var _ = ginkgo .Describe ("model default and validation" , func () {
3036
3137 // Delete all the Models for each case.
@@ -75,6 +81,14 @@ var _ = ginkgo.Describe("model default and validation", func() {
7581 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 ()
7682 },
7783 }),
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+ }),
7892 )
7993
8094 type testValidatingCase struct {
0 commit comments