@@ -13,9 +13,11 @@ import (
1313
1414func TestPackageFileAsOCIToStore (t * testing.T ) {
1515 testFile := filepath .Join (t .TempDir (), "test.yaml" )
16- testContent := `name: test-app
17- version: v1.0.0
18- description: "Test application"
16+ testContent := `version: "2"
17+ agents:
18+ root:
19+ model: auto
20+ description: A helpful AI assistant
1921`
2022 require .NoError (t , os .WriteFile (testFile , []byte (testContent ), 0o644 ))
2123 store , err := content .NewStore (content .WithBaseDir (t .TempDir ()))
@@ -24,9 +26,7 @@ description: "Test application"
2426 tag := "test-app:v1.0.0"
2527 digest , err := PackageFileAsOCIToStore (t .Context (), testFile , tag , store )
2628 require .NoError (t , err )
27-
2829 assert .NotEmpty (t , digest )
29-
3030 t .Cleanup (func () {
3131 if err := store .DeleteArtifact (digest ); err != nil {
3232 t .Logf ("Failed to clean up artifact: %v" , err )
@@ -35,7 +35,6 @@ description: "Test application"
3535
3636 img , err := store .GetArtifactImage (tag )
3737 require .NoError (t , err )
38-
3938 assert .NotNil (t , img )
4039
4140 metadata , err := store .GetArtifactMetadata (tag )
@@ -67,61 +66,3 @@ func TestPackageFileAsOCIToStoreInvalidTag(t *testing.T) {
6766 _ , err = PackageFileAsOCIToStore (t .Context (), testFile , "" , store )
6867 require .Error (t , err )
6968}
70-
71- func TestPackageFileAsOCIToStoreDifferentFileTypes (t * testing.T ) {
72- testCases := []struct {
73- name string
74- filename string
75- content string
76- tag string
77- }{
78- {
79- name : "yaml file" ,
80- filename : "config.yaml" ,
81- content : "key: value\n other: data" ,
82- tag : "config:yaml" ,
83- },
84- {
85- name : "json file" ,
86- filename : "data.json" ,
87- content : `{"key": "value", "number": 42}` ,
88- tag : "data:json" ,
89- },
90- {
91- name : "text file" ,
92- filename : "readme.txt" ,
93- content : "This is a simple text file\n with multiple lines" ,
94- tag : "readme:txt" ,
95- },
96- }
97-
98- store , err := content .NewStore (content .WithBaseDir (t .TempDir ()))
99- require .NoError (t , err )
100-
101- var digests []string
102-
103- for _ , tc := range testCases {
104- t .Run (tc .name , func (t * testing.T ) {
105- testFile := filepath .Join (t .TempDir (), tc .filename )
106- require .NoError (t , os .WriteFile (testFile , []byte (tc .content ), 0o644 ))
107-
108- // Package the file as OCI artifact
109- digest , err := PackageFileAsOCIToStore (t .Context (), testFile , tc .tag , store )
110- require .NoError (t , err )
111-
112- digests = append (digests , digest )
113-
114- img , err := store .GetArtifactImage (tc .tag )
115- require .NoError (t , err )
116- assert .NotNil (t , img )
117- })
118- }
119-
120- t .Cleanup (func () {
121- for _ , digest := range digests {
122- if err := store .DeleteArtifact (digest ); err != nil {
123- t .Logf ("Failed to clean up artifact %s: %v" , digest , err )
124- }
125- }
126- })
127- }
0 commit comments