Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Robo tests during internal CI. #1347

Merged
merged 9 commits into from
Apr 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bin/blt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if (!isset($autoload)) {
}

$robo_commands = [
'tests:configure-phantomjs',
'tests:all',
'tests:behat',
'tests:phpunit',
Expand Down
3 changes: 0 additions & 3 deletions phing/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
<!-- Contains tasks relevant to validation. E.g., code metrics. -->
<import file="${phing.dir}/tasks/validate.xml"/>

<!-- Contains targets relevant to the execution of tests. E.g., Behat, jMeter. -->
<import file="${phing.dir}/tasks/tests.xml"/>

<!-- Contains targets used for setting up environment. E.g., installing Drupal. -->
<import file="${phing.dir}/tasks/setup.xml"/>

Expand Down
2 changes: 1 addition & 1 deletion phing/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ drupal:
account.password: admin
account.mail: [email protected]
locale: en
local_settings_file: ${docroot}/sites/default/local.settings.php
local_settings_file: ${docroot}/sites/default/settings/local.settings.php
settings_file: ${docroot}/sites/default/settings.php

drush:
Expand Down
13 changes: 0 additions & 13 deletions phing/tasks/ci.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
<project name="ci" default="ci:setup">

<target name="ci:build:test"
description="Builds, tests, and deploys an artifact; uses ci drush alias."
depends="ci:setup, tests:all" hidden="true">
</target>

<target name="ci:build:validate:test"
description="Builds, validates, tests, and deploys an artifact; uses ci drush alias."
depends="validate:all, ci:setup, tests:all" hidden="true">
</target>

<target name="ci:setup" description="Install dependencies, builds docroot, installs Drupal; uses ci drush alias." hidden="true">
<phingcall target="setup">
<property name="drush.alias" value="${drush.aliases.ci}"/>
Expand All @@ -20,9 +10,6 @@

<target name="ci:pipelines:init" description="Initializes default Acquia Pipelines configuration for this project.">
<copy file="${blt.root}/scripts/pipelines/acquia-pipelines.yml" tofile="${repo.root}/acquia-pipelines.yml"/>
<echo>Acquia Pipelines requires PhantomJS in order to run Javascript Behat tests.</echo>
<!-- @todo replace this! -->
<phingcall target="tests:phantomjs:configure"/>
</target>

<target name="ci:travis:init" description="Initializes default Travis CI configuration for this project.">
Expand Down
280 changes: 0 additions & 280 deletions phing/tasks/tests.xml

This file was deleted.

4 changes: 3 additions & 1 deletion scripts/blt/ci/internal/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ yaml-cli update:value blt/project.yml project.local.hostname '127.0.0.1:8888'

# Build codebase, validate, install Drupal, run basic tests.
yaml-cli update:value blt/project.yml cm.strategy none
blt ci:build:validate:test -Dcreate_alias=false -Dbehat.run-server=true -Dblt.verbose=true
blt validate:all
blt ci:setup -Dcreate_alias=false
blt tests:all --define behat.run-server=true --yes
drush config-export --root=docroot -y

# Test core-only config management.
Expand Down
5 changes: 4 additions & 1 deletion scripts/pipelines/run_tests
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export PATH=${COMPOSER_BIN}:${PATH}

yaml-cli update:value blt/project.yml project.local.hostname '127.0.0.1:8888'
sudo /etc/init.d/mysql start
blt -Dbehat.run-server=true -Dcreate_alias=false -Dbehat.launch-selenium=false -Dbehat.launch-phantomjs=true -Dbehat.tags='~experimental' -Dblt.verbose=true ci:build:validate:test

blt validate:all
blt ci:setup -Dcreate_alias=false
blt tests:all -D behat.run-server=true -D behat.launch-selenium=false -D behat.launch-phantomjs=true -D behat.tags='~experimental' --yes

set +v
4 changes: 3 additions & 1 deletion scripts/travis/run_tests
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -ev

# The local.hostname must be set to 127.0.0.1:8888 because we are using drush runserver to test the site.
yaml-cli update:value blt/project.yml project.local.hostname '127.0.0.1:8888'
blt ci:build:validate:test -Dcreate_alias=false -Dbehat.run-server=true -Dblt.verbose=true
blt validate:all
blt ci:setup -Dcreate_alias=false
blt tests:all --define behat.run-server=true

set +v
10 changes: 8 additions & 2 deletions src/Robo/BltTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,25 @@
use Acquia\Blt\Robo\Config\ConfigAwareTrait;
use Acquia\Blt\Robo\Inspector\InspectorAwareInterface;
use Acquia\Blt\Robo\Inspector\InspectorAwareTrait;
use League\Container\ContainerAwareInterface;
use League\Container\ContainerAwareTrait;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use Robo\Contract\BuilderAwareInterface;
use Robo\Contract\ConfigAwareInterface;
use Robo\Tasks;
use Robo\Contract\IOAwareInterface;
use Robo\LoadAllTasks;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\OutputInterface;

/**
*
*/
class BltTasks extends Tasks implements ConfigAwareInterface, InspectorAwareInterface, LoggerAwareInterface {
class BltTasks implements ConfigAwareInterface, InspectorAwareInterface, LoggerAwareInterface, BuilderAwareInterface, IOAwareInterface, ContainerAwareInterface {

use ContainerAwareTrait;
use LoadAllTasks;
use ConfigAwareTrait;
use InspectorAwareTrait;
use IO;
Expand Down
Loading