Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
d01aeff
Adding legacy tests run to Behat feature.
jonpugh Aug 3, 2016
cda21d2
Wrong step!
jonpugh Aug 3, 2016
748786e
@hostmaster is already bootstrapped by behat.
jonpugh Aug 3, 2016
0031de0
Adding a scenario description.
jonpugh Aug 3, 2016
cd28fec
Setting docker compose timeout to 1 hour.
jonpugh Aug 3, 2016
c4056de
Use -E to keep environment variables.
jonpugh Aug 4, 2016
95af3e9
Commenting out legacy.feature text.
jonpugh Aug 4, 2016
4438746
Adding test for creating a drupal 6 site.
jonpugh Aug 4, 2016
ac4e6eb
Use docker compose run instead of up so that we get the exit code.
jonpugh Aug 4, 2016
df84ae6
Fixing name of platform.
jonpugh Aug 5, 2016
545b80e
Adding a local makefile for hosting module, so that drush copies it f…
jonpugh Aug 6, 2016
539e4a0
Use local copies of hosting and hostmaster.
jonpugh Aug 6, 2016
7f6ab6e
Removing extra makefile.
jonpugh Aug 9, 2016
f73d5e9
Adding examples and readme to travis folder of tests
jonpugh Aug 9, 2016
11ce80a
Changing aegir.docker and aegir.travis to aegir.local.computer so tes…
jonpugh Aug 9, 2016
3492b3b
Merge branch 'aegirlocalcomputer' into legacy-tests
jonpugh Aug 9, 2016
a9899c6
Fixing check for platform name.
jonpugh Aug 9, 2016
dead4f4
Fixing site creation test.
jonpugh Aug 9, 2016
714fe16
Fixing check for failed or warning tasks.
jonpugh Aug 9, 2016
0aa2532
Adding an afterSuite hook to remove the test sites folder.
jonpugh Aug 9, 2016
137db48
Added our own select radio by label function.
jonpugh Aug 9, 2016
243dd45
Add check that logs into the migrated site and checks the Drupal vers…
jonpugh Aug 9, 2016
c21e5c2
Comment out checking for warnings, for now.
jonpugh Aug 9, 2016
562aa18
Wrong drush command.
jonpugh Aug 9, 2016
b9cff31
Whitespace.
jonpugh Aug 10, 2016
b107e03
Adding volume mount to provision.
jonpugh Aug 10, 2016
f82f204
Bumping docker and docker compose versions.
jonpugh Aug 10, 2016
0024a8c
Merge branch 'legacy-tests' into source-path
jonpugh Aug 10, 2016
047b584
Adding a prepare-docker.sh script.
jonpugh Aug 10, 2016
8d6f11a
Merge branch 'source-path' of github.com:aegir-project/tests into sou…
jonpugh Aug 10, 2016
a31255a
Add apt-cache call to remind us how to check latest versions.
jonpugh Aug 10, 2016
6813b0b
Adding prepare-docker.sh script.
jonpugh Aug 10, 2016
7aa3aad
Use bash to run script.
jonpugh Aug 10, 2016
455a5f7
Moving prepare-docker.sh file to travis folder.
jonpugh Aug 10, 2016
a245d53
Creating volumes for modules, themes, and drush.
jonpugh Aug 10, 2016
d568dd3
Fixing paths to volumes
jonpugh Aug 10, 2016
4d82de8
Remove unneeded docker-compose file.
jonpugh Aug 10, 2016
5a12f51
Switching to aegir.local.computer
jonpugh Aug 10, 2016
4c8c1ff
Build a local docker container just for travis.
jonpugh Aug 10, 2016
0aac363
Forgot to assign USER_UID
jonpugh Aug 10, 2016
4f63931
bumping docker versions.
jonpugh Aug 10, 2016
0c4da27
Commenting out check for available versions.
jonpugh Aug 10, 2016
48ffaad
Quieting apt-get install.
jonpugh Aug 10, 2016
31afc34
Wrong UID Because we're running this script with root.
jonpugh Aug 10, 2016
afcadbf
Use Dockerfile-local to build image.
jonpugh Aug 10, 2016
47c32f4
Removing unused AEGIR_GID build arg.
jonpugh Aug 10, 2016
b471467
Removing unneeded legacy feature file.
jonpugh Aug 10, 2016
3aa1d1e
Attempting to fix AEGIR_UID argument.
jonpugh Aug 10, 2016
a0453bc
Hard coding to UID 1000
jonpugh Aug 10, 2016
3b57093
Adding database options to allow utf8 in drupal7.50
jonpugh Aug 10, 2016
9b389c8
Commenting out docker container building on travis, now that we have …
jonpugh Aug 10, 2016
a97b6d6
Adding travis to docker group and attempting to run docker-compose as…
jonpugh Aug 10, 2016
ced2548
Use sg command to run docker-compose?
jonpugh Aug 10, 2016
3b64e86
Create volumes for project source code.
jonpugh Aug 10, 2016
e690f4f
Removing source code copy from tests entrypoint, adding to local make…
jonpugh Aug 10, 2016
1ba3d00
Cloning hosting and hostmaster.
jonpugh Aug 10, 2016
481fa20
Fixing path to tests/travis.
jonpugh Aug 10, 2016
6bd6131
Install provision.
jonpugh Aug 10, 2016
9ca87a6
Moving changing directory to before_Script.
jonpugh Aug 10, 2016
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
41 changes: 25 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ sudo: required

env:
globaL:
- DOCKER_VERSION=1.11.2-0~trusty
- DOCKER_COMPOSE_VERSION=1.7.1
- COMPOSE_HTTP_TIMEOUT=3600
- AEGIR_HOSTING_VERSION=7.x-3.x

#env:
# - test: Ubuntu 14.04 Apache
Expand All @@ -16,33 +16,42 @@ env:

addons:
hosts:
- aegir.travis
- sitetest.aegir.travis
- aegir.local.computer
- sitetest.aegir.local.computer

services:
- docker

before_install:
# list docker-engine versions
- apt-cache madison docker-engine

# upgrade docker-engine to specific version
- sudo apt-get -o Dpkg::Options::="--force-confnew" install -y docker-engine=${DOCKER_VERSION}
- sudo bash travis/prepare-docker.sh

# Get Provision
- git clone http://git.drupal.org/project/provision.git /home/travis/build/aegir-project/provision
- cd /home/travis/build/aegir-project/provision
- git checkout $AEGIR_HOSTING_VERSION

# Get Hosting
- git clone http://git.drupal.org/project/hosting.git /home/travis/build/aegir-project/hosting
- cd /home/travis/build/aegir-project/hosting
- git checkout $AEGIR_HOSTING_VERSION

# reinstall docker-compose at specific version
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- docker --version
- docker-compose --version
# Get Hostmaster
- git clone http://git.drupal.org/project/hostmaster.git /home/travis/build/aegir-project/hostmaster
- cd /home/travis/build/aegir-project/hostmaster
- git checkout $AEGIR_HOSTING_VERSION

- cd /home/travis/build/aegir-project/tests
- sudo mkdir vendor
- sudo chmod 777 vendor

- sudo mkdir bin
- sudo chmod 777 bin

- cd /home/travis/build/aegir-project/tests/travis

- ls -la /home/travis/build/aegir-project/hostmaster

script:
# The test run is included in the docker-entrypoint-tests.sh file.
- sudo docker-compose up --abort-on-container-exit
- sg - docker -c 'docker-compose run hostmaster --rm'
2 changes: 1 addition & 1 deletion behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ default:
Behat\MinkExtension:
goutte: ~
selenium2: ~
base_url: http://aegir.docker
base_url: http://aegir.local.computer
Drupal\DrupalExtension:
blackbox: ~
api_driver: 'drush'
Expand Down
31 changes: 0 additions & 31 deletions docker-compose.yml

This file was deleted.

23 changes: 23 additions & 0 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,27 @@ class FeatureContext extends RawDrupalContext implements SnippetAcceptingContext
public function __construct() {
}

/**
* @AfterSuite
*/
public static function cleanAegir() {
exec('rm -rf /var/aegir/platforms/d6/sites/drupal6.local.computer');
print "Removed /var/aegir/platforms/d6/sites/drupal6.local.computer";
}

/**
* @When I select the radio button with the label :label
*
* @TODO: Remove when PR is merged: https://github.com/jhedstrom/drupalextension/pull/302
*/
public function assertSelectRadioByName($label) {
$element = $this->getSession()->getPage();

$radiobutton = $element->find('named', array('radio', $this->getSession()->getSelectorsHandler()->xpathLiteral($label)));
if ($radiobutton === NULL) {
throw new \Exception(sprintf('The radio button with the label "%s" was not found on the page %s', $label, $this->getSession()->getCurrentUrl()));
}
$value = $radiobutton->getAttribute('value');
$radiobutton->selectOption($value, FALSE);
}
}
100 changes: 100 additions & 0 deletions features/drupal6.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
Feature: Host Drupal 6


@api
Scenario: Create a Drupal 6 Site
1. Create a drupal6 platform.
2. Create a drupal6 site.
3. Create a drupal7 platform.
4. Migrate the site to the drupal7 platform.

Given I am logged in as a user with the "administrator" role
And I click "Platforms"
Then I click "Add platform"

Given I fill in "Name" with "drupal6platform"
And I fill in "Makefile" with "http://cgit.drupalcode.org/provision/plain/provision-tests/makes/drupal6.make"
And I fill in "Publish path" with "d6"
When I press "Save"
Then I should see "Verify task has been queued for platform drupal6platform. It will be available once the task is completed."
And I should see "Platform drupal6platform has been created."
And I should see "/var/aegir/platforms/d6"
And I should see "drupal6platform"

When I run drush "hosting-tasks -v"
Then print last drush output
Then I reload the page
When I click "Add site"
Then I should see "Create Site"

When I fill in "Domain name" with "drupal6.local.computer"
And I select the radio button "drupal6platform"
Then I press "Save"
And I should see "Site drupal6.local.computer has been created."
And I should see "drupal6.local.computer"
And I should see "Install"
And I should see "Queued"
And I should see the link "drupal6platform"

When I run drush "hosting-tasks -v"
Then print last drush output
Then I reload the page
And I should see "Enabled"

Given I click "Log in to drupal6.local.computer"
Then I should see "You have just used your one-time login link. It is no longer necessary to use this link to login. Please change your password."
And I should see the link "drupal6.local.computer"

# Setup Drupal 7 platform
Given I am on the homepage
And I click "Platforms"
Then I click "Add platform"

Given I fill in "Name" with "drupal7platform"
And I fill in "Makefile" with "http://cgit.drupalcode.org/provision/plain/provision-tests/makes/drupal7.make"
And I fill in "Publish path" with "d7"
When I press "Save"
Then I should see "Verify task has been queued for platform drupal7platform. It will be available once the task is completed."
And I should see "Platform drupal7platform has been created."
And I should see "/var/aegir/platforms/d7"
And I should see "drupal7platform"

When I run drush "hosting-tasks -v"
Then print last drush output
Then I reload the page
Then I should see "Enabled"

Then I click "Sites"
And I click "drupal6.local.computer"

# Enable site migration module
Given I run drush "en hosting_migrate -y"
Then print last drush output
Then I reload the page
Then I click "Move the site to a new platform."
Then I select the radio button with the label "drupal7platform"

Then I press "Migrate"

When I run drush "hosting-tasks -v"
Then print last drush output
Then I reload the page
And I click "drupal7platform"
Then I should see "Sites installed on this platform"
And I should see "drupal6.local.computer"

When I click "drupal6.local.computer"
When I click "Generate a one-time login reset url for this site."
And I run drush "hosting-tasks -y"
Then print last drush output
Then I reload the page

Given I click "Log in to drupal6.local.computer"
# The drupal 7 message!
Then I should see "You have just used your one-time login link. It is no longer necessary to use this link to log in. Please change your password."

Given I click "Administration"
Then I click "Reports"
Then I click "Status report"
Then I click "Status report"
Then I should see "7.50"
15 changes: 7 additions & 8 deletions features/ui.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,22 @@ Feature: Aegir UI
# When I run drush "@hostmaster hosting-tasks"
Then I am logged in as a user with the "administrator" role
And I am on the homepage
And I should see "aegir.docker"
And I should see "aegir.local.computer"
Then I should see "Sites"
And I should see "Task queue"
When I click "aegir.local.computer"
Then I should see "Enabled"

# Confirm all tasks verified.
When I click "Tasks"
Then I should see "aegir.docker" in the ".hosting-success" element

# Not sure why this fails
# And I should see "hostmaster" in the ".hosting-success" element
# And I should see "database" in the ".hosting-success" element
Then I should not see a ".hosting-error" element
# @TODO: We are throwing warnings on migrate to 7.50 because we
# Then I should not see a ".hosting-warning" element

# Platforms Page
When I click "Platforms"
Then I should see "hostmaster"
Then I should see "drupal"
Then I should see "aegir.docker"
Then I should see "aegir.local.computer"

# Platforms table
Then I should see "Platform"
Expand Down
7 changes: 7 additions & 0 deletions travis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Using Travis for Aegir Testing

There are many git repositories that make up aegir. In order to implement proper CI, we need all of them to trigger test runs.

Using this repository, http://github.com/aegir-project/tests, each repo can use slightly different `.travis.yml` files to run the same suite of tests.

We are working on making this even more streamlined, but for now, see `example.hostmaster.travis.yml` and `example.hosting.travis.yml` for examples on how to add Travis integration into your aegir module.
19 changes: 18 additions & 1 deletion travis/build-hostmaster-local.make
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ api = 2

projects[drupal][type] = "core"

# Travis docker-compose.yml puts hosting module at /source/hostmaster
projects[hostmaster][type] = "profile"
projects[hostmaster][download][type] = "copy"
projects[hostmaster][download][url] = "/var/aegir/hostmaster-source"
projects[hostmaster][download][url] = "/source/hostmaster"

# Travis docker-compose.yml puts hosting module at /source/hosting
projects[hosting][type] = "module"
projects[hosting][subdir] = "aegir"
projects[hosting][download][type] = "copy"
projects[hosting][download][url] = "/source/hosting"

# Copy modules from source
projects[source_modules][type] = "module"
projects[source_modules][download][type] = "copy"
projects[source_modules][download][url] = "/source/modules"

# Copy modules from source
projects[source_themes][type] = "theme"
projects[source_themes][download][type] = "copy"
projects[source_themes][download][url] = "/source/themes"
20 changes: 16 additions & 4 deletions travis/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ version: '2'
services:

hostmaster:
image: aegir/hostmaster
image: aegir/hostmaster:local
ports:
- 80:80
hostname: aegir.docker
hostname: aegir.local.computer
links:
- database
depends_on:
Expand All @@ -15,14 +15,22 @@ services:
# See https://github.com/aegir-project/dockerfiles/blob/master/docker-entrypoint-tests.sh
- docker-entrypoint-tests.sh
environment:
VIRTUAL_HOST: aegir.docker
VIRTUAL_HOST: aegir.local.computer
MYSQL_ROOT_PASSWORD: strongpassword
AEGIR_MAKEFILE: /var/aegir/tests/travis/build-hostmaster-local.make
tty: true
stdin_open: true
volumes:
- ../:/var/aegir/tests
- /home/travis/build/aegir-project/hostmaster:/var/aegir/hostmaster-source
- /home/travis/build/aegir-project/hostmaster:/source/hostmaster
- /home/travis/build/aegir-project/hosting:/source/hosting
- /home/travis/build/aegir-project/provision:/source/provision

# Project code Volumes.
# Individual projects need to copy their codebase into source/modules, source/themes or source/drush to be included in the images.
- /home/travis/build/aegir-project/source/modules:/source/modules
- /home/travis/build/aegir-project/source/themes:/source/themes
- /home/travis/build/aegir-project/source/drush:/source/drush

database:
image: mariadb
Expand All @@ -32,3 +40,7 @@ services:
driver: "none"
environment:
MYSQL_ROOT_PASSWORD: strongpassword

# These options are needed for Drupal 7.50 and up for full UTF-8 support.
# See https://www.drupal.org/node/2754539
command: mysqld --innodb-large-prefix --innodb-file-format=barracuda --innodb-file-per-table
Loading