@@ -24,6 +24,8 @@ import (
24
24
"k8s.io/klog/v2"
25
25
)
26
26
27
+ const qwenModelName = "Qwen/Qwen2-0.5B"
28
+
27
29
func createSimConfig (args []string ) (* configuration , error ) {
28
30
oldArgs := os .Args
29
31
defer func () {
@@ -66,7 +68,7 @@ var _ = Describe("Simulator configuration", func() {
66
68
// Config from config.yaml file
67
69
c = newConfig ()
68
70
c .Port = 8001
69
- c .Model = "Qwen/Qwen2-0.5B"
71
+ c .Model = qwenModelName
70
72
c .ServedModelNames = []string {"model1" , "model2" }
71
73
c .MaxLoras = 2
72
74
c .MaxCPULoras = 5
@@ -128,7 +130,7 @@ var _ = Describe("Simulator configuration", func() {
128
130
"{\" name\" :\" lora3\" ,\" path\" :\" /path/to/lora3\" }" ,
129
131
}
130
132
test = testCase {
131
- name : "config file with command line args" ,
133
+ name : "config file with command line args with different format " ,
132
134
args : []string {"cmd" , "--model" , model , "--config" , "../../manifests/config.yaml" , "--port" , "8002" ,
133
135
"--served-model-name" ,
134
136
"--lora-modules={\" name\" :\" lora3\" ,\" path\" :\" /path/to/lora3\" }" ,
@@ -153,7 +155,7 @@ var _ = Describe("Simulator configuration", func() {
153
155
"{\" name\" :\" lora3\" ,\" path\" :\" /path/to/lora3\" }" ,
154
156
}
155
157
test = testCase {
156
- name : "config file with command line args" ,
158
+ name : "config file with command line args with empty string " ,
157
159
args : []string {"cmd" , "--model" , model , "--config" , "../../manifests/config.yaml" , "--port" , "8002" ,
158
160
"--served-model-name" , "" ,
159
161
"--lora-modules" , "{\" name\" :\" lora3\" ,\" path\" :\" /path/to/lora3\" }" ,
@@ -162,6 +164,44 @@ var _ = Describe("Simulator configuration", func() {
162
164
}
163
165
tests = append (tests , test )
164
166
167
+ // Config from config.yaml file plus command line args with empty string for loras
168
+ c = newConfig ()
169
+ c .Port = 8001
170
+ c .Model = qwenModelName
171
+ c .ServedModelNames = []string {"model1" , "model2" }
172
+ c .MaxLoras = 2
173
+ c .MaxCPULoras = 5
174
+ c .MaxNumSeqs = 5
175
+ c .TimeToFirstToken = 2
176
+ c .InterTokenLatency = 1
177
+ c .LoraModules = []loraModule {}
178
+ c .LoraModulesString = []string {}
179
+ test = testCase {
180
+ name : "config file with command line args with empty string for loras" ,
181
+ args : []string {"cmd" , "--config" , "../../manifests/config.yaml" , "--lora-modules" , "" },
182
+ expectedConfig : c ,
183
+ }
184
+ tests = append (tests , test )
185
+
186
+ // Config from config.yaml file plus command line args with empty parameter for loras
187
+ c = newConfig ()
188
+ c .Port = 8001
189
+ c .Model = qwenModelName
190
+ c .ServedModelNames = []string {"model1" , "model2" }
191
+ c .MaxLoras = 2
192
+ c .MaxCPULoras = 5
193
+ c .MaxNumSeqs = 5
194
+ c .TimeToFirstToken = 2
195
+ c .InterTokenLatency = 1
196
+ c .LoraModules = []loraModule {}
197
+ c .LoraModulesString = []string {}
198
+ test = testCase {
199
+ name : "config file with command line args with empty parameter for loras" ,
200
+ args : []string {"cmd" , "--config" , "../../manifests/config.yaml" , "--lora-modules" },
201
+ expectedConfig : c ,
202
+ }
203
+ tests = append (tests , test )
204
+
165
205
// Invalid configurations
166
206
test = testCase {
167
207
name : "invalid model" ,
@@ -205,17 +245,19 @@ var _ = Describe("Simulator configuration", func() {
205
245
Entry (tests [2 ].name , tests [2 ].args , tests [2 ].expectedConfig ),
206
246
Entry (tests [3 ].name , tests [3 ].args , tests [3 ].expectedConfig ),
207
247
Entry (tests [4 ].name , tests [4 ].args , tests [4 ].expectedConfig ),
248
+ Entry (tests [5 ].name , tests [5 ].args , tests [5 ].expectedConfig ),
249
+ Entry (tests [6 ].name , tests [6 ].args , tests [6 ].expectedConfig ),
208
250
)
209
251
210
252
DescribeTable ("invalid configurations" ,
211
253
func (args []string ) {
212
254
_ , err := createSimConfig (args )
213
255
Expect (err ).To (HaveOccurred ())
214
256
},
215
- Entry (tests [5 ].name , tests [5 ].args ),
216
- Entry (tests [6 ].name , tests [6 ].args ),
217
257
Entry (tests [7 ].name , tests [7 ].args ),
218
258
Entry (tests [8 ].name , tests [8 ].args ),
219
259
Entry (tests [9 ].name , tests [9 ].args ),
260
+ Entry (tests [10 ].name , tests [10 ].args ),
261
+ Entry (tests [11 ].name , tests [11 ].args ),
220
262
)
221
263
})
0 commit comments