Skip to main content

Continuous Integration Solutions

Run automated unit and integration tests with Terminus and Drupal SimpleTest.


This section provides information on how to use Terminus and Drupal SimpleTest to run automated integration tests.

Continuous Integration (CI) is a method of running automated unit and integration tests to apply quality control. Pantheon doesn't provide or host tools for continuous integration, but many tools and techniques are compatible with Pantheon. Contact support if you have a particular use case or technique that you'd like to highlight.

Refer to our Build Tools guide for more information on the workflow for using build tools like GitHub and CircleCI with Composer for Drupal and WordPress sites.

Terminus Command-Line Interface

Terminus is a Symfony/Console-based command-line interface (CLI) in the Pantheon core API. Most operations available through the Pantheon Dashboard can be performed with Terminus, including:

Drupal SimpleTest

SimpleTest is a testing framework based on the SimpleTest PHP library that is included with Drupal core. You should consider including SimpleTests of your module functionality if you are creating a custom web application.

SiteTest is a contrib module for Drupal that runs tests directly against your sites code instead of a base Drupal clone of your site. This module is recommended for use on SimpleTest on Pantheon.

Information:
Note

The Drush test-run command was dropped in Drush 7 and 8. Refer to this GitHub issue for more information.

Run Tests on Pantheon

Replace $SITE_NAME and $ENV_NAME in the examples below with the your site and environment information.

  1. Enable site_test:

    This command also enables simpletest as a dependency of site_test.

  2. Clear the cache immediately before running tests to avoid failures. Repeat this step each time you run tests.

  3. Get the absolute path before you run the script. You may need to strip out warnings by ending the command with 2>/dev/null.

The full command should look similar to this:

In the above command the --url option is required to be passed as Multidevs do not respond to localhost.

A full CircleCI command might look similar to this:

Integration Bot

We recommend creating a bot user account to handle the tasks or jobs by an external continuous integration service rather a standard user account.

  • Add the bot to select projects
  • Manage separate SSH Keys for CI

Known Limitations

Pantheon does not provide or offer customer support for:

  • Webhooks
  • Git hooks
  • Running Jenkins or other Continuous Integration software on our servers. You'll need to self-host or use a hosted CI solution. Compare solutions here.
  • Shell access
  • PHPUnit Unit Testing PHP Framework: You can still write tests and include them in your code, but you'll need to run them on a CI server, not Pantheon.

More Resources