@@ -15,7 +15,7 @@ import (
1515func TestAutoRegisterModels (t * testing.T ) {
1616 t .Parallel ()
1717
18- cfg , err := Load (t .Context (), testfileSource ("testdata/autoregister.yaml" ))
18+ cfg , err := Load (t .Context (), NewFileSource ("testdata/autoregister.yaml" ))
1919 require .NoError (t , err )
2020
2121 assert .Len (t , cfg .Models , 2 )
@@ -28,7 +28,7 @@ func TestAutoRegisterModels(t *testing.T) {
2828func TestAutoRegisterAlloy (t * testing.T ) {
2929 t .Parallel ()
3030
31- cfg , err := Load (t .Context (), testfileSource ("testdata/autoregister_alloy.yaml" ))
31+ cfg , err := Load (t .Context (), NewFileSource ("testdata/autoregister_alloy.yaml" ))
3232 require .NoError (t , err )
3333
3434 assert .Len (t , cfg .Models , 2 )
@@ -41,7 +41,7 @@ func TestAutoRegisterAlloy(t *testing.T) {
4141func TestAlloyModelComposition (t * testing.T ) {
4242 t .Parallel ()
4343
44- cfg , err := Load (t .Context (), testfileSource ("testdata/alloy_model_composition.yaml" ))
44+ cfg , err := Load (t .Context (), NewFileSource ("testdata/alloy_model_composition.yaml" ))
4545 require .NoError (t , err )
4646
4747 // The alloy model should be expanded to its constituent models
@@ -57,7 +57,7 @@ func TestAlloyModelComposition(t *testing.T) {
5757func TestAlloyModelNestedComposition (t * testing.T ) {
5858 t .Parallel ()
5959
60- cfg , err := Load (t .Context (), testfileSource ("testdata/alloy_model_nested.yaml" ))
60+ cfg , err := Load (t .Context (), NewFileSource ("testdata/alloy_model_nested.yaml" ))
6161 require .NoError (t , err )
6262
6363 // The nested alloy should be fully expanded to all constituent models
@@ -72,7 +72,7 @@ func TestAlloyModelNestedComposition(t *testing.T) {
7272func TestMigrate_v0_v1_provider (t * testing.T ) {
7373 t .Parallel ()
7474
75- cfg , err := Load (t .Context (), testfileSource ("testdata/provider_v0.yaml" ))
75+ cfg , err := Load (t .Context (), NewFileSource ("testdata/provider_v0.yaml" ))
7676 require .NoError (t , err )
7777
7878 assert .Equal (t , "openai" , cfg .Models ["gpt" ].Provider )
@@ -81,7 +81,7 @@ func TestMigrate_v0_v1_provider(t *testing.T) {
8181func TestMigrate_v1_provider (t * testing.T ) {
8282 t .Parallel ()
8383
84- cfg , err := Load (t .Context (), testfileSource ("testdata/provider_v1.yaml" ))
84+ cfg , err := Load (t .Context (), NewFileSource ("testdata/provider_v1.yaml" ))
8585 require .NoError (t , err )
8686
8787 assert .Equal (t , "openai" , cfg .Models ["gpt" ].Provider )
@@ -90,7 +90,7 @@ func TestMigrate_v1_provider(t *testing.T) {
9090func TestMigrate_v0_v1_todo (t * testing.T ) {
9191 t .Parallel ()
9292
93- cfg , err := Load (t .Context (), testfileSource ("testdata/todo_v0.yaml" ))
93+ cfg , err := Load (t .Context (), NewFileSource ("testdata/todo_v0.yaml" ))
9494 require .NoError (t , err )
9595
9696 assert .Len (t , cfg .Agents .First ().Toolsets , 2 )
@@ -102,7 +102,7 @@ func TestMigrate_v0_v1_todo(t *testing.T) {
102102func TestMigrate_v1_todo (t * testing.T ) {
103103 t .Parallel ()
104104
105- cfg , err := Load (t .Context (), testfileSource ("testdata/todo_v1.yaml" ))
105+ cfg , err := Load (t .Context (), NewFileSource ("testdata/todo_v1.yaml" ))
106106 require .NoError (t , err )
107107
108108 assert .Len (t , cfg .Agents .First ().Toolsets , 2 )
@@ -114,7 +114,7 @@ func TestMigrate_v1_todo(t *testing.T) {
114114func TestMigrate_v0_v1_shared_todo (t * testing.T ) {
115115 t .Parallel ()
116116
117- cfg , err := Load (t .Context (), testfileSource ("testdata/shared_todo_v0.yaml" ))
117+ cfg , err := Load (t .Context (), NewFileSource ("testdata/shared_todo_v0.yaml" ))
118118 require .NoError (t , err )
119119
120120 assert .Len (t , cfg .Agents .First ().Toolsets , 2 )
@@ -126,7 +126,7 @@ func TestMigrate_v0_v1_shared_todo(t *testing.T) {
126126func TestMigrate_v1_shared_todo (t * testing.T ) {
127127 t .Parallel ()
128128
129- cfg , err := Load (t .Context (), testfileSource ("testdata/shared_todo_v1.yaml" ))
129+ cfg , err := Load (t .Context (), NewFileSource ("testdata/shared_todo_v1.yaml" ))
130130 require .NoError (t , err )
131131
132132 assert .Len (t , cfg .Agents .First ().Toolsets , 2 )
@@ -138,7 +138,7 @@ func TestMigrate_v1_shared_todo(t *testing.T) {
138138func TestMigrate_v0_v1_think (t * testing.T ) {
139139 t .Parallel ()
140140
141- cfg , err := Load (t .Context (), testfileSource ("testdata/think_v0.yaml" ))
141+ cfg , err := Load (t .Context (), NewFileSource ("testdata/think_v0.yaml" ))
142142 require .NoError (t , err )
143143
144144 assert .Len (t , cfg .Agents .First ().Toolsets , 2 )
@@ -149,7 +149,7 @@ func TestMigrate_v0_v1_think(t *testing.T) {
149149func TestMigrate_v1_think (t * testing.T ) {
150150 t .Parallel ()
151151
152- cfg , err := Load (t .Context (), testfileSource ("testdata/think_v1.yaml" ))
152+ cfg , err := Load (t .Context (), NewFileSource ("testdata/think_v1.yaml" ))
153153 require .NoError (t , err )
154154
155155 assert .Len (t , cfg .Agents .First ().Toolsets , 2 )
@@ -160,7 +160,7 @@ func TestMigrate_v1_think(t *testing.T) {
160160func TestMigrate_v0_v1_memory (t * testing.T ) {
161161 t .Parallel ()
162162
163- cfg , err := Load (t .Context (), testfileSource ("testdata/memory_v0.yaml" ))
163+ cfg , err := Load (t .Context (), NewFileSource ("testdata/memory_v0.yaml" ))
164164 require .NoError (t , err )
165165
166166 assert .Len (t , cfg .Agents .First ().Toolsets , 2 )
@@ -172,7 +172,7 @@ func TestMigrate_v0_v1_memory(t *testing.T) {
172172func TestMigrate_v1_memory (t * testing.T ) {
173173 t .Parallel ()
174174
175- cfg , err := Load (t .Context (), testfileSource ("testdata/memory_v1.yaml" ))
175+ cfg , err := Load (t .Context (), NewFileSource ("testdata/memory_v1.yaml" ))
176176 require .NoError (t , err )
177177
178178 assert .Len (t , cfg .Agents .First ().Toolsets , 2 )
@@ -184,7 +184,7 @@ func TestMigrate_v1_memory(t *testing.T) {
184184func TestMigrate_v1 (t * testing.T ) {
185185 t .Parallel ()
186186
187- _ , err := Load (t .Context (), testfileSource ("testdata/v1.yaml" ))
187+ _ , err := Load (t .Context (), NewFileSource ("testdata/v1.yaml" ))
188188 require .NoError (t , err )
189189}
190190
@@ -262,7 +262,7 @@ func TestCheckRequiredEnvVars(t *testing.T) {
262262 t .Run (test .yaml , func (t * testing.T ) {
263263 t .Parallel ()
264264
265- cfg , err := Load (t .Context (), testfileSource ("testdata/env/" + test .yaml ))
265+ cfg , err := Load (t .Context (), NewFileSource ("testdata/env/" + test .yaml ))
266266 require .NoError (t , err )
267267
268268 err = CheckRequiredEnvVars (t .Context (), cfg , "" , & noEnvProvider {})
@@ -282,7 +282,7 @@ func TestCheckRequiredEnvVars(t *testing.T) {
282282func TestCheckRequiredEnvVarsWithModelGateway (t * testing.T ) {
283283 t .Parallel ()
284284
285- cfg , err := Load (t .Context (), testfileSource ("testdata/env/all.yaml" ))
285+ cfg , err := Load (t .Context (), NewFileSource ("testdata/env/all.yaml" ))
286286 require .NoError (t , err )
287287
288288 err = CheckRequiredEnvVars (t .Context (), cfg , "gateway:8080" , & noEnvProvider {})
0 commit comments