@@ -90,7 +90,7 @@ func TestLauncherLaunch(t *testing.T) {
90
90
}{
91
91
{
92
92
name : "disable binary provisioning" ,
93
- k6Cmd : "run " ,
93
+ k6Cmd : "cloud " ,
94
94
disableBP : true ,
95
95
script : fakerTest ,
96
96
expectProvision : false ,
@@ -100,7 +100,7 @@ func TestLauncherLaunch(t *testing.T) {
100
100
},
101
101
{
102
102
name : "execute binary provisioned" ,
103
- k6Cmd : "run " ,
103
+ k6Cmd : "cloud " ,
104
104
script : fakerTest ,
105
105
expectProvision : true ,
106
106
expectK6Run : true ,
@@ -109,7 +109,7 @@ func TestLauncherLaunch(t *testing.T) {
109
109
},
110
110
{
111
111
name : "require unsatisfied k6 version" ,
112
- k6Cmd : "run " ,
112
+ k6Cmd : "cloud " ,
113
113
script : requireUnsatisfiedK6Version ,
114
114
expectProvision : true ,
115
115
expectK6Run : true ,
@@ -118,7 +118,7 @@ func TestLauncherLaunch(t *testing.T) {
118
118
},
119
119
{
120
120
name : "require satisfied k6 version" ,
121
- k6Cmd : "run " ,
121
+ k6Cmd : "cloud " ,
122
122
script : requireSatisfiedK6Version ,
123
123
expectProvision : false ,
124
124
expectK6Run : false ,
@@ -127,7 +127,7 @@ func TestLauncherLaunch(t *testing.T) {
127
127
},
128
128
{
129
129
name : "script with no dependencies" ,
130
- k6Cmd : "run " ,
130
+ k6Cmd : "cloud " ,
131
131
script : noDepsTest ,
132
132
expectProvision : false ,
133
133
expectK6Run : false ,
@@ -143,8 +143,16 @@ func TestLauncherLaunch(t *testing.T) {
143
143
expectOsExit : 0 ,
144
144
},
145
145
{
146
- name : "failed binary provisioning" ,
146
+ name : "binary provisioning is not enabled for run command " ,
147
147
k6Cmd : "run" ,
148
+ expectProvision : false ,
149
+ expectK6Run : false ,
150
+ expectDefault : true ,
151
+ expectOsExit : 0 ,
152
+ },
153
+ {
154
+ name : "failed binary provisioning" ,
155
+ k6Cmd : "cloud" ,
148
156
script : fakerTest ,
149
157
provisionError : errors .New ("test error" ),
150
158
expectProvision : true ,
@@ -154,7 +162,7 @@ func TestLauncherLaunch(t *testing.T) {
154
162
},
155
163
{
156
164
name : "failed k6 execution" ,
157
- k6Cmd : "run " ,
165
+ k6Cmd : "cloud " ,
158
166
script : fakerTest ,
159
167
k6ReturnCode : 108 ,
160
168
expectProvision : true ,
@@ -164,7 +172,7 @@ func TestLauncherLaunch(t *testing.T) {
164
172
},
165
173
{
166
174
name : "missing input script" ,
167
- k6Cmd : "run " ,
175
+ k6Cmd : "cloud " ,
168
176
k6Args : []string {},
169
177
script : "" ,
170
178
expectProvision : false ,
@@ -174,7 +182,7 @@ func TestLauncherLaunch(t *testing.T) {
174
182
},
175
183
{
176
184
name : "script in stdin" ,
177
- k6Cmd : "run " ,
185
+ k6Cmd : "cloud " ,
178
186
k6Args : []string {"-" },
179
187
script : "" ,
180
188
expectProvision : false ,
@@ -314,7 +322,7 @@ func TestScriptNameFromArgs(t *testing.T) {
314
322
},
315
323
{
316
324
name : "complex case with multiple flags" ,
317
- args : []string {"-v" , "--quiet" , "run" , "-o" , "output.json" , "--console-output" , "loadtest.log" , "script.js" , "--tag" , "env=staging" },
325
+ args : []string {"-v" , "--quiet" , "cloud" , " run" , "-o" , "output.json" , "--console-output" , "loadtest.log" , "script.js" , "--tag" , "env=staging" },
318
326
expected : "script.js" ,
319
327
},
320
328
{
@@ -370,26 +378,36 @@ func TestIsScriptRequired(t *testing.T) {
370
378
{
371
379
name : "run command" ,
372
380
args : []string {"run" , "script.js" },
381
+ expected : false ,
382
+ },
383
+ {
384
+ name : "cloud command" ,
385
+ args : []string {"cloud" , "script.js" },
386
+ expected : true ,
387
+ },
388
+ {
389
+ name : "cloud run command" ,
390
+ args : []string {"cloud" , "run" , "script.js" },
373
391
expected : true ,
374
392
},
375
393
{
376
394
name : "flag before command" ,
377
- args : []string {"-v" , "run " , "script.js" },
395
+ args : []string {"-v" , "cloud " , "script.js" },
378
396
expected : true ,
379
397
},
380
398
{
381
399
name : "verbose flag before command" ,
382
- args : []string {"--verbose" , "run " , "script.js" },
400
+ args : []string {"--verbose" , "cloud " , "script.js" },
383
401
expected : true ,
384
402
},
385
403
{
386
404
name : "cloud run with flag in the middle" ,
387
- args : []string {"cloud" , "-v" , "run " , "archive.tar" },
405
+ args : []string {"cloud" , "-v" , "cloud " , "archive.tar" },
388
406
expected : true ,
389
407
},
390
408
{
391
- name : "cloud command" ,
392
- args : []string {"cloud" , "script.js" },
409
+ name : "cloud upload command" ,
410
+ args : []string {"cloud" , "upload" , " script.js" },
393
411
expected : true ,
394
412
},
395
413
{
@@ -409,7 +427,7 @@ func TestIsScriptRequired(t *testing.T) {
409
427
},
410
428
{
411
429
name : "complex case with multiple flags" ,
412
- args : []string {"-v" , "--quiet" , "run" , "-o" , "output.json" , "--console-output" , "loadtest.log" , "script.js" , "--tag" , "env=staging" },
430
+ args : []string {"-v" , "--quiet" , "cloud" , " run" , "-o" , "output.json" , "--console-output" , "loadtest.log" , "script.js" , "--tag" , "env=staging" },
413
431
expected : true ,
414
432
},
415
433
}
0 commit comments