Using Quicksilver to Automatically Test Each Deploy on Pantheon

As part of our efforts to build really excellent Cloud Integration Tools for Drupal & WordPress developers, we launched Quicksilver platform hooks in February. Using Quicksilver, developers are able to get more value from Pantheon by connecting their automatic tests to Pantheon workflow operations. We live in a world where robots will soon drive our cars, why not allow robots to test our websites? As part of our efforts to tell the world about our Quicksilver technology at Drupalcon New Orleans, we developed the following demonstration (and example integration code) that will hopefully inspire you to provide some power ups to your current workflow:

Slack Integration

If you use Slack to communicate with your team, you can easily integrate with Pantheon using Quicksilver. To do so, you’ll need to generate a Slack Webhook URL and install our Slack Notification Quicksilver example code. This will allow you to get notifications about deploys and commits for your project in a Slack channel of your choice which will help streamline team communication and keep everyone in the loop about what is happening with your project.

Drush Integration

If you are using Drupal 8’s configuration management system, a solid best practice is to automatically import your configuration on each deploy. Forget about logging in to your Drupal site to click a button to do a sync of the configuration, just have Pantheon’s Quicksilver run “drush config-import -y” after you do a code deploy. There is example code for Drush and Config Import integration and, if you are doing Drupal 7 development, you can trigger a “drush features-revert-all -y” instead with this example code for Drush and Features integration.

Cross Browser Testing with Spotbot

In the world of web development, it can be pretty frustrating to deal with all of the different browsers and devices that users use to visit the websites we build. There are differences between the kind of browser that is used, differences if the user is on a mobile phone or a tablet or a desktop computer, and differences if the system is running Windows, OS X, Linux, iOS, or Android. To automatically check for these differences, we created example code for integration with cross browser testing on Spotbot.qa that uses the Spotbot.qa service to automatically test a number of different browsers on each code commit. Just click on a single link to start exploring your site in all of the different browsers you want.

Visual Regression Testing with Backtrac

In addition to checking different browsers, one increasingly popular developer technique is to use robots to check for visual differences between the “before” and “after” versions of a site. This is called visual regression testing and my colleague Kate did a great presentation on how visual regression works at Drupalcon Los Angeles. To use that with our Pantheon deployment workflow, we integrated with Backtrac.io which is a service that does visual regression testing on a variety of different pages and reports on the visual difference. You’ll need to setup a project on Backtrac.io to get going, but afterwards you can use our example code for integration with visual regression testing on Backtrac.io to run a visual regression test on every deploy you do on Pantheon.

Performance Testing with Loadimpact

The speed of your site matters a great deal to your users. In some cases, the speed of the site is the difference between a user staying or leaving. This is why it is important to do performance testing on your site, utilizing a service like Loadimpact to simulate the kind of traffic you expect your site to handle in the future. Using our example code for integration with performance testing with Loadimpact, you can set up your site to run a performance test on every deploy you do, providing you confidence that your site’s application code can handle the kind of traffic you expect in the future.

The Opportunities Are Endless

Pretty cool, right? There is a lot of power in using Quicksilver to extend Pantheon’s workflow to include third party services that may be right from you. We live on the edge of a bountiful harvest of developer tools and being able to integrate the ones that are right for your project is incredibly powerful. The services that we demonstrated are certainly services we like at Pantheon, but we have many more integrations in our repository of Quicksilver Examples for which pull requests are always welcome. May your workflows be ever stronger.

Topics Drupal, WordPress