Cloud-hosted Branches for Painless Testing

Anyone familiar with developing web applications knows how tedious it is to test code changes made by your peers. Whether it’s a designer learning how to build and run a local server, or even a developer that needs to stash local changes and wait for a server rebuild, testing changes is a major workflow interruption that can mean minutes of thumb twiddling. At WordPress.com, we’re proud that we’ve made testing in-progress work a quick process that’s as easy as sharing a url.

Introducing Calypso.live

If you’ve ever seen a Calypso pull request, you might have noticed that our helpful matticbot always comments on the request with a link to calypso.live. If you follow the link, it takes you to a hosted version of that branch. If you’re the first person to access the branch, you may have to wait a couple of minutes for the app to be built, during which you’ll be greeted with this loading screen:

Screen Shot 2018-04-10 at 7.02.21 PM.png
calypso.live loading screen

Once the server is done building, it presents you with a version of Calypso corresponding to that branch of code. This makes it easy and quick for developers to review functionality and designers to review the look and feel, all without having to manage local development servers.

One piece of good news is that you usually aren’t the first to access a branch. That’s because our automated tests actually rely on these cloud-hosted branches to test against.

How does this work technically?

Calypso.live is powered by a specialized docker server named dserve, which was written to work for any Docker-based web application. It automatically manages thousands of versions of an app and makes both each git sha and branch accessible by url. An example request might go like this:

  1. Request is made for calypso.live?branch=my-branch
  2. Once dserve receives the request, it checks to see if my-branch is ready to be served
  3. Assuming a container is already running for my-branch, dserve proxies the request to the right container — very similar to how a load balancer sits in front of an array of servers and proxies the request.

Get involved!

Feel free to check out the dserve repository, our e2e tests repository, or wp-calypso, make a fork, and provide us with any feedback or suggestions. Pull requests are always welcome.

***

Jake Fried is a Software Engineer at Automattic, mainly working on Calypso.


Comments

2 responses to “Cloud-hosted Branches for Painless Testing”

  1. Roy Shaulis Avatar
    Roy Shaulis

    I need an address or e mail address to mail certified legal documents about one of the sites you support that is involved in a civil and criminal action.

    1. You can generally email us at legal@wordpress.com, but we also recommend you review our guidelines here:

      https://wordpress.com/support/report-blogs/legal-guidelines/