@@ -24,6 +24,8 @@ import (
2424 "k8s.io/klog/v2"
2525)
2626
27+ const qwenModelName = "Qwen/Qwen2-0.5B"
28+
2729func createSimConfig (args []string ) (* configuration , error ) {
2830 oldArgs := os .Args
2931 defer func () {
@@ -66,7 +68,7 @@ var _ = Describe("Simulator configuration", func() {
6668 // Config from config.yaml file
6769 c = newConfig ()
6870 c .Port = 8001
69- c .Model = "Qwen/Qwen2-0.5B"
71+ c .Model = qwenModelName
7072 c .ServedModelNames = []string {"model1" , "model2" }
7173 c .MaxLoras = 2
7274 c .MaxCPULoras = 5
@@ -128,7 +130,7 @@ var _ = Describe("Simulator configuration", func() {
128130 "{\" name\" :\" lora3\" ,\" path\" :\" /path/to/lora3\" }" ,
129131 }
130132 test = testCase {
131- name : "config file with command line args" ,
133+ name : "config file with command line args with different format " ,
132134 args : []string {"cmd" , "--model" , model , "--config" , "../../manifests/config.yaml" , "--port" , "8002" ,
133135 "--served-model-name" ,
134136 "--lora-modules={\" name\" :\" lora3\" ,\" path\" :\" /path/to/lora3\" }" ,
@@ -153,7 +155,7 @@ var _ = Describe("Simulator configuration", func() {
153155 "{\" name\" :\" lora3\" ,\" path\" :\" /path/to/lora3\" }" ,
154156 }
155157 test = testCase {
156- name : "config file with command line args" ,
158+ name : "config file with command line args with empty string " ,
157159 args : []string {"cmd" , "--model" , model , "--config" , "../../manifests/config.yaml" , "--port" , "8002" ,
158160 "--served-model-name" , "" ,
159161 "--lora-modules" , "{\" name\" :\" lora3\" ,\" path\" :\" /path/to/lora3\" }" ,
@@ -162,6 +164,44 @@ var _ = Describe("Simulator configuration", func() {
162164 }
163165 tests = append (tests , test )
164166
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+
165205 // Invalid configurations
166206 test = testCase {
167207 name : "invalid model" ,
@@ -205,17 +245,19 @@ var _ = Describe("Simulator configuration", func() {
205245 Entry (tests [2 ].name , tests [2 ].args , tests [2 ].expectedConfig ),
206246 Entry (tests [3 ].name , tests [3 ].args , tests [3 ].expectedConfig ),
207247 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 ),
208250 )
209251
210252 DescribeTable ("invalid configurations" ,
211253 func (args []string ) {
212254 _ , err := createSimConfig (args )
213255 Expect (err ).To (HaveOccurred ())
214256 },
215- Entry (tests [5 ].name , tests [5 ].args ),
216- Entry (tests [6 ].name , tests [6 ].args ),
217257 Entry (tests [7 ].name , tests [7 ].args ),
218258 Entry (tests [8 ].name , tests [8 ].args ),
219259 Entry (tests [9 ].name , tests [9 ].args ),
260+ Entry (tests [10 ].name , tests [10 ].args ),
261+ Entry (tests [11 ].name , tests [11 ].args ),
220262 )
221263})
0 commit comments