@@ -172,15 +172,26 @@ public function testErrors() {
172
172
$ this ->drush ('cc ' , array ('drush ' ), array (), NULL , $ this ->webroot ());
173
173
174
174
// No alias error message.
175
- $ this ->drush ('deploy 2>&1 ' , array (), array ('y ' => TRUE , 'branch ' => '' , 'sha ' => '04256b5992d8b4a4fae25c7cb7888583749fabc0 ' ), NULL , $ this ->webroot (), self ::EXIT_ERROR );
175
+ $ this ->drush ('deploy 2>&1 ' , array (), array (
176
+ 'y ' => TRUE ,
177
+ 'branch ' => '' ,
178
+ 'sha ' => '04256b5992d8b4a4fae25c7cb7888583749fabc0 ' ,
179
+ ), NULL , $ this ->webroot (), self ::EXIT_ERROR );
176
180
$ this ->assertRegExp ('/No alias given/ ' , $ this ->getOutput ());
177
181
178
182
// Bad alias error.
179
- $ this ->drush ('deploy 2>&1 ' , array ('@badalias ' ), array ('y ' => TRUE , 'branch ' => '' , 'sha ' => '04256b5992d8b4a4fae25c7cb7888583749fabc0 ' ), NULL , $ this ->webroot (), self ::EXIT_ERROR );
183
+ $ this ->drush ('deploy 2>&1 ' , array ('@badalias ' ), array (
184
+ 'y ' => TRUE , 'branch ' => '' ,
185
+ 'sha ' => '04256b5992d8b4a4fae25c7cb7888583749fabc0 ' ,
186
+ ), NULL , $ this ->webroot (), self ::EXIT_ERROR );
180
187
$ this ->assertRegExp ('/Invalid alias/ ' , $ this ->getOutput ());
181
188
182
189
// Also check that aborting works.
183
- $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array ('n ' => TRUE , 'branch ' => '' , 'sha ' => '04256b5992d8b4a4fae25c7cb7888583749fabc0 ' ), NULL , $ this ->webroot ());
190
+ $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array (
191
+ 'n ' => TRUE ,
192
+ 'branch ' => '' ,
193
+ 'sha ' => '04256b5992d8b4a4fae25c7cb7888583749fabc0 ' ,
194
+ ), NULL , $ this ->webroot ());
184
195
$ this ->assertRegExp ('/Aborting/ ' , $ this ->getOutput ());
185
196
$ this ->assertNotRegExp ('/Done/ ' , $ this ->getOutput ());
186
197
}
@@ -203,15 +214,30 @@ public function testBasic() {
203
214
$ this ->assertFileExists ($ this ->deploySite () . '/VERSION.txt ' );
204
215
205
216
// Check that a invalid tag/branch prints the proper error message.
206
- $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array ('y ' => TRUE , 'branch ' => '' , 'tag ' => 'slipstream ' , 'sha ' => '' ), NULL , $ this ->webroot (), self ::EXIT_ERROR );
217
+ $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array (
218
+ 'y ' => TRUE ,
219
+ 'branch ' => '' ,
220
+ 'tag ' => 'slipstream ' ,
221
+ 'sha ' => '' ,
222
+ ), NULL , $ this ->webroot (), self ::EXIT_ERROR );
207
223
$ this ->assertRegExp ('/Error finding SHA for tag/ ' , $ this ->getOutput ());
208
224
209
225
// Check that a invalid SHA prints the proper error message.
210
- $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array ('y ' => TRUE , 'branch ' => '' , 'tag ' => '' , 'sha ' => 'deadc0de ' ), NULL , $ this ->webroot (), self ::EXIT_ERROR );
226
+ $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array (
227
+ 'y ' => TRUE ,
228
+ 'branch ' => '' ,
229
+ 'tag ' => '' ,
230
+ 'sha ' => 'deadc0de ' ,
231
+ ), NULL , $ this ->webroot (), self ::EXIT_ERROR );
211
232
$ this ->assertRegExp ('/Unknown SHA/ ' , $ this ->getOutput ());
212
233
213
234
// Check that missing branch/tag/sha prints the proper error message.
214
- $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array ('y ' => TRUE , 'branch ' => '' , 'tag ' => '' , 'sha ' => '' ), NULL , $ this ->webroot (), self ::EXIT_ERROR );
235
+ $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array (
236
+ 'y ' => TRUE ,
237
+ 'branch ' => '' ,
238
+ 'tag ' => '' ,
239
+ 'sha ' => '' ,
240
+ ), NULL , $ this ->webroot (), self ::EXIT_ERROR );
215
241
$ this ->assertRegExp ('/You must provide at least one of --branch, --tag or --sha/ ' , $ this ->getOutput ());
216
242
217
243
// Check that a dirty checkout makes deployment fail..
@@ -227,7 +253,11 @@ public function testBasic() {
227
253
// Fix the the checkout and check that we can now deploy, and throw in
228
254
// no-confirm for coverage.
229
255
exec ('cd ' . $ this ->deploySite () . ' && git reset --hard ' );
230
- $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array ('no-confirm ' => TRUE , 'branch ' => '' , 'sha ' => 'b9471948c3f83a665dd4f106aba3de8962d69b42 ' ), NULL , $ this ->webroot ());
256
+ $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array (
257
+ 'no-confirm ' => TRUE ,
258
+ 'branch ' => '' ,
259
+ 'sha ' => 'b9471948c3f83a665dd4f106aba3de8962d69b42 ' ,
260
+ ), NULL , $ this ->webroot ());
231
261
$ this ->assertRegExp ('/HEAD now at b9471948c3f83a665dd4f106aba3de8962d69b42/ ' , $ this ->getOutput ());
232
262
233
263
// VERSION.txt should still exist.
@@ -328,7 +358,11 @@ public function testOmg() {
328
358
$ this ->drush ('cc ' , array ('drush ' ), array (), NULL , $ this ->webroot ());
329
359
330
360
// Start with a simple deployment.
331
- $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array ('y ' => TRUE , 'branch ' => '' , 'sha ' => '04256b5992d8b4a4fae25c7cb7888583749fabc0 ' ), NULL , $ this ->webroot ());
361
+ $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array (
362
+ 'y ' => TRUE ,
363
+ 'branch ' => '' ,
364
+ 'sha ' => '04256b5992d8b4a4fae25c7cb7888583749fabc0 ' ,
365
+ ), NULL , $ this ->webroot ());
332
366
$ this ->assertRegExp ('/HEAD now at 04256b5992d8b4a4fae25c7cb7888583749fabc0/ ' , $ this ->getOutput ());
333
367
334
368
// Set a variable.
@@ -338,7 +372,11 @@ public function testOmg() {
338
372
$ this ->assertRegExp ("/magic_variable: .bumblebee./ " , $ this ->getOutput ());
339
373
340
374
// Deploy another version.
341
- $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array ('y ' => TRUE , 'branch ' => '' , 'sha ' => 'b9471948c3f83a665dd4f106aba3de8962d69b42 ' ), NULL , $ this ->webroot ());
375
+ $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array (
376
+ 'y ' => TRUE ,
377
+ 'branch ' => '' ,
378
+ 'sha ' => 'b9471948c3f83a665dd4f106aba3de8962d69b42 ' ,
379
+ ), NULL , $ this ->webroot ());
342
380
$ this ->assertRegExp ('/HEAD now at b9471948c3f83a665dd4f106aba3de8962d69b42/ ' , $ this ->getOutput ());
343
381
344
382
// And a third time.
@@ -437,7 +475,11 @@ public function testNoDeploy() {
437
475
$ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array ('y ' => TRUE ), NULL , $ this ->webroot ());
438
476
$ this ->assertRegExp ('/HEAD now at fbcaa29d45716edcbedc3c325bfbab828f1ce838/ ' , $ this ->getOutput ());
439
477
440
- $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array ('y ' => TRUE , 'no-deploy ' => TRUE , 'flowdock-token ' => $ this ->flowdockToken ), NULL , $ this ->webroot ());
478
+ $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array (
479
+ 'y ' => TRUE ,
480
+ 'no-deploy ' => TRUE ,
481
+ 'flowdock-token ' => $ this ->flowdockToken ,
482
+ ), NULL , $ this ->webroot ());
441
483
// Check VERSION.txt message.
442
484
$ this ->assertRegExp ('/No version deployed, not creating\/updating VERSION.txt/ ' , $ this ->getOutput ());
443
485
@@ -466,7 +508,12 @@ public function testDumpFilePurging() {
466
508
// any.
467
509
foreach (range (1 , 2 ) as $ num ) {
468
510
foreach ($ shas as $ sha ) {
469
- $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array ('y ' => TRUE , 'branch ' => '' , 'sha ' => $ sha , 'num-dumps ' => 0 ), NULL , $ this ->webroot ());
511
+ $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array (
512
+ 'y ' => TRUE ,
513
+ 'branch ' => '' ,
514
+ 'sha ' => $ sha ,
515
+ 'num-dumps ' => 0 ,
516
+ ), NULL , $ this ->webroot ());
470
517
$ this ->assertRegExp ('/HEAD now at ' . $ sha . '/ ' , $ this ->getOutput ());
471
518
$ this ->assertRegExp ('/Not purging any dumps/ ' , $ this ->getOutput ());
472
519
$ expected_num_dumps ++;
@@ -481,7 +528,11 @@ public function testDumpFilePurging() {
481
528
$ expected_dumps = array_slice ($ dumps , 0 , 4 );
482
529
483
530
// Don't specify num-dumps, which should default to 5.
484
- $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array ('y ' => TRUE , 'branch ' => '' , 'sha ' => $ sha ), NULL , $ this ->webroot ());
531
+ $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array (
532
+ 'y ' => TRUE ,
533
+ 'branch ' => '' ,
534
+ 'sha ' => $ sha ,
535
+ ), NULL , $ this ->webroot ());
485
536
$ this ->assertRegExp ('/HEAD now at ' . $ sha . '/ ' , $ this ->getOutput ());
486
537
$ this ->assertRegExp ('/Purge the following dump files/ ' , $ this ->getOutput ());
487
538
$ this ->assertCount (5 , $ this ->fileList ($ this ->dumpPath ()));
@@ -495,7 +546,12 @@ public function testDumpFilePurging() {
495
546
$ expected_dumps = array_slice ($ dumps , 0 , 2 );
496
547
497
548
// And again with a specified num-dumps.
498
- $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array ('y ' => TRUE , 'branch ' => '' , 'sha ' => $ sha , 'num-dumps ' => 3 ), NULL , $ this ->webroot ());
549
+ $ this ->drush ('deploy 2>&1 ' , array ('@deployotron ' ), array (
550
+ 'y ' => TRUE ,
551
+ 'branch ' => '' ,
552
+ 'sha ' => $ sha ,
553
+ 'num-dumps ' => 3 ,
554
+ ), NULL , $ this ->webroot ());
499
555
$ this ->assertRegExp ('/HEAD now at ' . $ sha . '/ ' , $ this ->getOutput ());
500
556
$ this ->assertRegExp ('/Purge the following dump files/ ' , $ this ->getOutput ());
501
557
$ this ->assertCount (3 , $ this ->fileList ($ this ->dumpPath ()));
0 commit comments