Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Configurable test steps for fresh installs and live dbs #1004

Closed
danepowell opened this issue Jan 20, 2017 · 0 comments
Closed

Configurable test steps for fresh installs and live dbs #1004

danepowell opened this issue Jan 20, 2017 · 0 comments
Labels
Enhancement A feature or feature request

Comments

@danepowell
Copy link
Contributor

danepowell commented Jan 20, 2017

Currently, TravisCI runs ci:build:validate:test, which in turn installs Drupal via ci:setup and runs tests.

On most projects, it's also useful to test live content. In fact, on some projects it's better to not run fresh installs at all, and to only test updates from a synced db (since installs can be flaky and take 10+ minutes to run).

The best way to do this right now is to override the ci:setup target in a custom xml import:

<!-- Override ci:setup to not install Drupal and use local refresh instead. -->
<target name="ci:setup" description="Install dependencies, builds docroot, installs Drupal; uses ci drush alias." hidden="true">
  <!-- Call setup here to install Drupal, or setup:build to just build it. -->
  <phingcall target="setup:build">
    <property name="drush.alias" value="${drush.aliases.ci}"/>
    <property name="create_alias" value="n"/>
    <property name="environment" value="ci"/>
  </phingcall>
  <phingcall target="local:sync"/>
  <phingcall target="local:update"/>
</target>

The problem here is that Drupal/BLT assume that file directories (private/tmp files, etc...) have already been created, i.e. by the Drupal installer. So if you are only testing against live dbs and not installing from scratch, you have to know what those directories are and manually create them:

<mkdir dir="${docroot}/sites/default/files"/>
<chmod mode="0777" file="${docroot}/sites/default/files"/>
<mkdir dir="${docroot}/sites/default/files/translations"/>
<chmod mode="0777" file="${docroot}/sites/default/files/translations"/>
<!-- For private files, this still isn't sufficient... I think you also have to create the .htaccess file? -->
<mkdir dir="${repo.root}/files-private"/>
<chmod mode="0777" file="${repo.root}/files-private"/>

Obviously this is all a pain. It would be nicer if BLT supported this as a switch or set of hooks in project.yml.

The main steps to this approach would be to break up the ci:setup task (so we can build the platform without installing Drupal), maybe create ci:sync and ci:update targets, figure out how to configure and/or create file directories correctly outside of the installer, and finally add the hooks or switches to project.yml and the necessary Phing tasks.

@grasmash grasmash added the Enhancement A feature or feature request label Feb 9, 2017
grasmash added a commit to grasmash/bolt that referenced this issue May 3, 2017
grasmash added a commit to grasmash/bolt that referenced this issue Jul 19, 2017
grasmash added a commit to grasmash/bolt that referenced this issue Jul 19, 2017
grasmash added a commit to grasmash/bolt that referenced this issue Jul 19, 2017
grasmash added a commit to grasmash/bolt that referenced this issue Jul 19, 2017
grasmash added a commit to grasmash/bolt that referenced this issue Jul 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement A feature or feature request
Projects
None yet
Development

No branches or pull requests

2 participants