@@ -15,9 +15,7 @@ import (
1515func TestAutoRegisterModels (t * testing.T ) {
1616 t .Parallel ()
1717
18- root := openRoot (t , "testdata" )
19-
20- cfg , err := LoadConfig (t .Context (), "autoregister.yaml" , root )
18+ cfg , err := Load (t .Context (), fileSource ("testdata/autoregister.yaml" ))
2119 require .NoError (t , err )
2220
2321 assert .Len (t , cfg .Models , 2 )
@@ -30,9 +28,7 @@ func TestAutoRegisterModels(t *testing.T) {
3028func TestAutoRegisterAlloy (t * testing.T ) {
3129 t .Parallel ()
3230
33- root := openRoot (t , "testdata" )
34-
35- cfg , err := LoadConfig (t .Context (), "autoregister_alloy.yaml" , root )
31+ cfg , err := Load (t .Context (), fileSource ("testdata/autoregister_alloy.yaml" ))
3632 require .NoError (t , err )
3733
3834 assert .Len (t , cfg .Models , 2 )
@@ -45,9 +41,7 @@ func TestAutoRegisterAlloy(t *testing.T) {
4541func TestMigrate_v0_v1_provider (t * testing.T ) {
4642 t .Parallel ()
4743
48- root := openRoot (t , "testdata" )
49-
50- cfg , err := LoadConfig (t .Context (), "provider_v0.yaml" , root )
44+ cfg , err := Load (t .Context (), fileSource ("testdata/provider_v0.yaml" ))
5145 require .NoError (t , err )
5246
5347 assert .Equal (t , "openai" , cfg .Models ["gpt" ].Provider )
@@ -56,9 +50,7 @@ func TestMigrate_v0_v1_provider(t *testing.T) {
5650func TestMigrate_v1_provider (t * testing.T ) {
5751 t .Parallel ()
5852
59- root := openRoot (t , "testdata" )
60-
61- cfg , err := LoadConfig (t .Context (), "provider_v1.yaml" , root )
53+ cfg , err := Load (t .Context (), fileSource ("testdata/provider_v1.yaml" ))
6254 require .NoError (t , err )
6355
6456 assert .Equal (t , "openai" , cfg .Models ["gpt" ].Provider )
@@ -67,9 +59,7 @@ func TestMigrate_v1_provider(t *testing.T) {
6759func TestMigrate_v0_v1_todo (t * testing.T ) {
6860 t .Parallel ()
6961
70- root := openRoot (t , "testdata" )
71-
72- cfg , err := LoadConfig (t .Context (), "todo_v0.yaml" , root )
62+ cfg , err := Load (t .Context (), fileSource ("testdata/todo_v0.yaml" ))
7363 require .NoError (t , err )
7464
7565 assert .Len (t , cfg .Agents ["root" ].Toolsets , 2 )
@@ -81,9 +71,7 @@ func TestMigrate_v0_v1_todo(t *testing.T) {
8171func TestMigrate_v1_todo (t * testing.T ) {
8272 t .Parallel ()
8373
84- root := openRoot (t , "testdata" )
85-
86- cfg , err := LoadConfig (t .Context (), "todo_v1.yaml" , root )
74+ cfg , err := Load (t .Context (), fileSource ("testdata/todo_v1.yaml" ))
8775 require .NoError (t , err )
8876
8977 assert .Len (t , cfg .Agents ["root" ].Toolsets , 2 )
@@ -95,9 +83,7 @@ func TestMigrate_v1_todo(t *testing.T) {
9583func TestMigrate_v0_v1_shared_todo (t * testing.T ) {
9684 t .Parallel ()
9785
98- root := openRoot (t , "testdata" )
99-
100- cfg , err := LoadConfig (t .Context (), "shared_todo_v0.yaml" , root )
86+ cfg , err := Load (t .Context (), fileSource ("testdata/shared_todo_v0.yaml" ))
10187 require .NoError (t , err )
10288
10389 assert .Len (t , cfg .Agents ["root" ].Toolsets , 2 )
@@ -109,9 +95,7 @@ func TestMigrate_v0_v1_shared_todo(t *testing.T) {
10995func TestMigrate_v1_shared_todo (t * testing.T ) {
11096 t .Parallel ()
11197
112- root := openRoot (t , "testdata" )
113-
114- cfg , err := LoadConfig (t .Context (), "shared_todo_v1.yaml" , root )
98+ cfg , err := Load (t .Context (), fileSource ("testdata/shared_todo_v1.yaml" ))
11599 require .NoError (t , err )
116100
117101 assert .Len (t , cfg .Agents ["root" ].Toolsets , 2 )
@@ -123,9 +107,7 @@ func TestMigrate_v1_shared_todo(t *testing.T) {
123107func TestMigrate_v0_v1_think (t * testing.T ) {
124108 t .Parallel ()
125109
126- root := openRoot (t , "testdata" )
127-
128- cfg , err := LoadConfig (t .Context (), "think_v0.yaml" , root )
110+ cfg , err := Load (t .Context (), fileSource ("testdata/think_v0.yaml" ))
129111 require .NoError (t , err )
130112
131113 assert .Len (t , cfg .Agents ["root" ].Toolsets , 2 )
@@ -136,9 +118,7 @@ func TestMigrate_v0_v1_think(t *testing.T) {
136118func TestMigrate_v1_think (t * testing.T ) {
137119 t .Parallel ()
138120
139- root := openRoot (t , "testdata" )
140-
141- cfg , err := LoadConfig (t .Context (), "think_v1.yaml" , root )
121+ cfg , err := Load (t .Context (), fileSource ("testdata/think_v1.yaml" ))
142122 require .NoError (t , err )
143123
144124 assert .Len (t , cfg .Agents ["root" ].Toolsets , 2 )
@@ -149,9 +129,7 @@ func TestMigrate_v1_think(t *testing.T) {
149129func TestMigrate_v0_v1_memory (t * testing.T ) {
150130 t .Parallel ()
151131
152- root := openRoot (t , "testdata" )
153-
154- cfg , err := LoadConfig (t .Context (), "memory_v0.yaml" , root )
132+ cfg , err := Load (t .Context (), fileSource ("testdata/memory_v0.yaml" ))
155133 require .NoError (t , err )
156134
157135 assert .Len (t , cfg .Agents ["root" ].Toolsets , 2 )
@@ -163,9 +141,7 @@ func TestMigrate_v0_v1_memory(t *testing.T) {
163141func TestMigrate_v1_memory (t * testing.T ) {
164142 t .Parallel ()
165143
166- root := openRoot (t , "testdata" )
167-
168- cfg , err := LoadConfig (t .Context (), "memory_v1.yaml" , root )
144+ cfg , err := Load (t .Context (), fileSource ("testdata/memory_v1.yaml" ))
169145 require .NoError (t , err )
170146
171147 assert .Len (t , cfg .Agents ["root" ].Toolsets , 2 )
@@ -177,9 +153,7 @@ func TestMigrate_v1_memory(t *testing.T) {
177153func TestMigrate_v1 (t * testing.T ) {
178154 t .Parallel ()
179155
180- root := openRoot (t , "testdata" )
181-
182- _ , err := LoadConfig (t .Context (), "v1.yaml" , root )
156+ _ , err := Load (t .Context (), fileSource ("testdata/v1.yaml" ))
183157 require .NoError (t , err )
184158}
185159
@@ -257,9 +231,7 @@ func TestCheckRequiredEnvVars(t *testing.T) {
257231 t .Run (test .yaml , func (t * testing.T ) {
258232 t .Parallel ()
259233
260- root := openRoot (t , "testdata/env" )
261-
262- cfg , err := LoadConfig (t .Context (), test .yaml , root )
234+ cfg , err := Load (t .Context (), fileSource ("testdata/env/" + test .yaml ))
263235 require .NoError (t , err )
264236
265237 err = CheckRequiredEnvVars (t .Context (), cfg , "" , & noEnvProvider {})
@@ -277,9 +249,7 @@ func TestCheckRequiredEnvVars(t *testing.T) {
277249func TestCheckRequiredEnvVarsWithModelGateway (t * testing.T ) {
278250 t .Parallel ()
279251
280- root := openRoot (t , "testdata/env" )
281-
282- cfg , err := LoadConfig (t .Context (), "all.yaml" , root )
252+ cfg , err := Load (t .Context (), fileSource ("testdata/env/all.yaml" ))
283253 require .NoError (t , err )
284254
285255 err = CheckRequiredEnvVars (t .Context (), cfg , "gateway:8080" , & noEnvProvider {})
0 commit comments