Skip to content

Commit

Permalink
Fixed tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Jun 17, 2019
1 parent 2b3bb21 commit 3778564
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 26 deletions.
13 changes: 8 additions & 5 deletions src/Robo/Commands/Artifact/AcHooksCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AcHooksCommand extends BltTasks {
* The repo type, e.g., git.
*
* @command artifact:ac-hooks:post-code-deploy
* @throws BltException
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public function postCodeDeploy($site, $target_env, $source_branch, $deployed_tag, $repo_url, $repo_type) {
if (!EnvironmentDetector::isAcsfEnv($site, $target_env)) {
Expand Down Expand Up @@ -61,7 +61,7 @@ public function postCodeDeploy($site, $target_env, $source_branch, $deployed_tag
*
* @command artifact:ac-hooks:post-code-update
*
* @throws BltException
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public function postCodeUpdate($site, $target_env, $source_branch, $deployed_tag, $repo_url, $repo_type) {
if (!EnvironmentDetector::isAcsfEnv($site, $target_env)) {
Expand Down Expand Up @@ -156,7 +156,8 @@ function ($string) {

/**
* Reinstall Drupal in an ODE.
* @throws BltException
*
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public function updateOdeSites() {
$this->invokeCommand('artifact:install:drupal');
Expand All @@ -166,7 +167,8 @@ public function updateOdeSites() {
* Executes updates against all ACE sites in the target environment.
*
* @param $target_env
* @throws BltException
*
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public function updateAceSites($target_env) {
$this->say("Running updates for environment: $target_env");
Expand Down Expand Up @@ -256,7 +258,8 @@ protected function sendSlackNotification($url, $payload) {
*
* @param $site
* @param $target_env
* @throws BltException
*
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
protected function updateSites($site, $target_env) {
if (EnvironmentDetector::isAhOdeEnv($target_env)) {
Expand Down
9 changes: 6 additions & 3 deletions src/Robo/Commands/Blt/UpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function initialize() {
*
* @hidden
*
* @throws BltException
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public function createProject() {
$this->cleanUpProjectTemplate();
Expand All @@ -79,6 +79,7 @@ public function createProject() {
* @return void
*
* @hidden
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public function addToProject() {
$this->rsyncTemplate();
Expand Down Expand Up @@ -127,8 +128,10 @@ protected function initializeBlt() {
* @command blt:update
*
* @aliases bu update
*
* @param array $options
* @throws BltException
*
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public function update($options = ['since' => InputOption::VALUE_REQUIRED]) {
$this->rsyncTemplate();
Expand Down Expand Up @@ -333,7 +336,7 @@ protected function convertLegacySchemaVersion($version) {
*
* @return void
*
* @throws BltException
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
protected function rsyncTemplate() {
$source = $this->getConfigValue('blt.root') . '/subtree-splits/blt-project';
Expand Down
16 changes: 11 additions & 5 deletions src/Robo/Commands/Deploy/DeployCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public function initialize() {
*
* @param array $options
* Options that can be passed via the CLI.
* @throws BltException
*
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public function deploy($options = [
'branch' => InputOption::VALUE_REQUIRED,
Expand Down Expand Up @@ -88,7 +89,8 @@ public function deploy($options = [
* @param array $options
* Set ignore-dirty to false to disable checks for dirty Git directory.
*
* @throws BltException Thrown if there are uncommitted changes.
* @throws \Acquia\Blt\Robo\Exceptions\BltException Thrown if there are
* uncommitted changes.
*/
public function checkDirty($options = ['ignore-dirty' => FALSE]) {
$result = $this->taskExec('git status --porcelain')
Expand Down Expand Up @@ -555,7 +557,8 @@ protected function setMultisiteFilePermissions($perms) {

/**
* Creates a commit on the artifact.
* @throws BltException
*
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
protected function commit() {
$this->say("Committing artifact to <comment>{$this->branchName}</comment>...");
Expand All @@ -575,10 +578,12 @@ protected function commit() {

/**
* Pushes the artifact to git.remotes.
*
* @param $identifier
* @param $options
*
* @return bool
* @throws BltException
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
protected function push($identifier, $options) {
if ($options['dry-run']) {
Expand Down Expand Up @@ -607,7 +612,8 @@ protected function push($identifier, $options) {
*
* @param $repo
* The repo in which a tag should be cut.
* @throws BltException
*
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
protected function cutTag($repo = 'build') {
$taskGit = $this->taskGit()
Expand Down
4 changes: 2 additions & 2 deletions src/Robo/Commands/Generate/AliasesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ protected function loadCloudApiConfigFile() {
*
* @return array
* Returns credentials as array on success.
* @throws BltException
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
protected function askForCloudApiCredentials() {
$this->say("You may generate new API tokens at <comment>https://cloud.acquia.com/app/profile/tokens</comment>");
Expand Down Expand Up @@ -188,7 +188,7 @@ protected function writeCloudApiConfig(array $config) {
* @param string $secret
* The Acquia token secret key.
*
* @throws BltException
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
protected function setCloudApiClient($key, $secret) {
try {
Expand Down
5 changes: 3 additions & 2 deletions src/Robo/Commands/Generate/MultisiteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ class MultisiteCommand extends BltTasks {
* @command recipes:multisite:init
*
* @aliases rmi multisite
*
* @param array $options
* @throws BltException
*
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public function generate($options = [
'site-dir' => InputOption::VALUE_REQUIRED,
Expand All @@ -41,7 +43,6 @@ public function generate($options = [
$domain = $this->getNewSiteDomain($options, $site_name);
$url = parse_url($domain);
// @todo Validate uri, ensure includes scheme.

$newDBSettings = $this->setLocalDbConfig($site_name);
if ($this->getInspector()->isDrupalVmConfigPresent()) {
$this->configureDrupalVm($url, $newDBSettings);
Expand Down
3 changes: 2 additions & 1 deletion src/Robo/Commands/Saml/SimpleSamlPhpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function initialize() {
*
* @command recipes:simplesamlphp:init
* @aliases rsi saml simplesamlphp:init
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public function initializeSimpleSamlPhp() {
$this->requireModule();
Expand Down Expand Up @@ -107,7 +108,7 @@ protected function initializeConfig() {
*
* @command artifact:build:simplesamlphp-config
* @aliases absc
* @throws BltException
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public function simpleSamlPhpDeployConfig() {
$this->say('Copying config files to the appropriate place in simplesamlphp library in the deploy artifact...');
Expand Down
3 changes: 1 addition & 2 deletions src/Robo/Commands/Setup/ConfigCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ConfigCommand extends BltTasks {
* @aliases du setup:update
* @executeInVm
* @throws \Robo\Exception\TaskException
* @throws BltException
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public function update() {
$task = $this->taskDrush()
Expand Down Expand Up @@ -49,7 +49,6 @@ public function update() {
* @validateDrushConfig
* @executeInVm
* @throws \Robo\Exception\TaskException
* @throws BltException
* @throws \Exception
*/
public function import() {
Expand Down
3 changes: 2 additions & 1 deletion src/Robo/Commands/Setup/DrupalCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class DrupalCommand extends BltTasks {
*
* @return \Robo\Result
* The `drush site-install` command result.
* @throws BltException
* @throws \Acquia\Blt\Robo\Exceptions\BltException
* @throws \Robo\Exception\TaskException
*/
public function install() {

Expand Down
3 changes: 2 additions & 1 deletion src/Robo/Commands/Tests/TestsCommandBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ protected function findChromeDriver() {

/**
* Launches selenium server and waits for it to become available.
* @throws BltException
*
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
protected function launchSelenium() {
$this->createSeleniumLogs();
Expand Down
5 changes: 3 additions & 2 deletions src/Robo/Common/EnvironmentDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ public static function isAhEnv() {
* The Acquia Hosting site / group name (e.g. my_subscription).
* @param null $ah_env
* The Acquia Hosting environment name (e.g. 01dev).
*
* @return bool
* @throws BltException
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public static function isAcsfEnv($ah_group = NULL, $ah_env = NULL) {
if (is_null($ah_group)) {
Expand Down Expand Up @@ -151,7 +152,7 @@ public static function isAcsfInited() {
/**
* @return string|null
* ACSF db name.
* @throws BltException
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public static function getAcsfDbName() {
return isset($GLOBALS['gardens_site_settings']) && self::isAcsfEnv() ? $GLOBALS['gardens_site_settings']['conf']['acsf_db_name'] : NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/Robo/Hooks/DrupalVmHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DrupalVmHook extends BltTasks {
* Ask whether user would like to execute on host machine.
*
* @hook interact @executeInVm
* @throws BltException
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public function interactExecuteOnHost() {
if (!$this->getInspector()->isVmCli() && $this->getInspector()->isDrupalVmLocallyInitialized() && $this->getConfigValue('vm.blt-in-vm')) {
Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/src/DeployTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,4 @@ public function testBltDeployBuild() {
// @todo add artifact:build:push test.
// git.remotes.1 git@github.com:acquia-pso/blted8.git
// @todo add artifact:update:drupal test.

}

0 comments on commit 3778564

Please sign in to comment.