Skip to content

Commit 41790c4

Browse files
authored
Fixes acquia#1572: Failing Behat Test Hangs Pipelines Build. (acquia#1575)
1 parent f390a2d commit 41790c4

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

src/Robo/Commands/Deploy/DeployCommand.php

+2-6
Original file line numberDiff line numberDiff line change
@@ -565,15 +565,11 @@ public function updateSites() {
565565
$this->config->set('drush.uri', $multisite);
566566

567567
$status_code = $this->invokeCommand('setup:config-import');
568-
if (!$status_code) {
569-
return $status_code;
570-
}
571568
$status_code = $this->invokeCommand('setup:toggle-modules');
572-
if (!$status_code) {
573-
return $status_code;
574-
}
575569

576570
$this->say("Finished deploying updates to $multisite.");
571+
572+
return $status_code;
577573
}
578574
}
579575

src/Robo/Commands/Tests/BehatCommand.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ public function behat() {
8989
$this->createReportsDir();
9090
$this->launchWebServer();
9191
$this->launchWebDriver();
92-
$this->executeBehatTests();
92+
$behat_exit_code = $this->executeBehatTests();
9393
$this->killWebDriver();
9494
$this->killWebServer();
95+
96+
return $behat_exit_code;
9597
}
9698

9799
/**
@@ -254,6 +256,8 @@ public function setupPhantomJs() {
254256
* Throws an exception if any Behat test fails.
255257
*/
256258
protected function executeBehatTests() {
259+
$exit_code = 0;
260+
257261
foreach ($this->getConfigValue('behat.paths') as $behat_path) {
258262
// Output errors.
259263
// @todo replace base_url in behat config when internal server is being used.
@@ -281,9 +285,11 @@ protected function executeBehatTests() {
281285
$result = $task->run();
282286

283287
if (!$result->wasSuccessful()) {
284-
throw new \Exception("Behat tests failed");
288+
return $result->getExitCode();
285289
}
286290
}
291+
292+
return $exit_code;
287293
}
288294

289295
}

src/Robo/Commands/Vm/VmCommand.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ protected function boot() {
212212
* @throws \Exception
213213
*/
214214
protected function requireDrupalVm() {
215-
$this->say("Adding geerlingguy/drupal-vm:{$this->drupalVmVersionConstraint} to composer.json's require-dev array.");
215+
$this->say("Adding geerlingguy/drupal-vm:{$this->drupalVmVersionConstraint} to composer.json's require-dev array...");
216216
$result = $this->taskExec("composer require --dev geerlingguy/drupal-vm:{$this->drupalVmVersionConstraint}")
217217
->dir($this->getConfigValue('repo.root'))
218218
->printOutput(TRUE)
@@ -262,8 +262,8 @@ protected function checkRequirements() {
262262
* Drupal VM config from box/config.yml.
263263
*/
264264
protected function validateConfig($config) {
265-
if (strstr($config['machine_name'], '_')) {
266-
$this->logger->warning("The machine name for your Drupal VM should not contain an underscore.");
265+
if (strstr($config['vagrant_machine_name'], '_')) {
266+
$this->logger->warning("vagrant_machine_namefor should not contain an underscore.");
267267
}
268268
}
269269

0 commit comments

Comments
 (0)