How to reliably test sandbox projects using the drupal.org testbot locally

During Drupal Dev Days in Hungary, there were many sprints that took place. You can see the amazing footage of what went on there in this nice movie, but that is not what we are going to discuss now!

In this blog post, we'll talk about how to manage your Drupal 8 module upgrade while working with many people together using a sandbox. Since drupal.org does not allow you to grant per branch access to the repository, it might be risky to allow everyone commit access. When using a sandbox you can "fork" the module and branches and allow many more people to collaborate! This is also what is happening with Search API and during our peak moment 15 people were contributing to the sandbox of Search API D8.

Now, we have a great repository for our code but unfortunately Drupal.org doesn't care too much about sandboxes for the testbots. This is most likely due to the fact that this scenario doesn't happen too often. In the meeting notes for the Search API sprinters, we all agreed we'd run tests before committing.

To enforce this we are going to utilize the modernize testbot that was written by Ricardo Amaro for the Drupal.org infrastructure team.

Warning: This tutorial is going to assume we are working on a machine that can use vagrant. If you are using a linux distro, it might be much faster to use your native machine.

And there we have it. We just ran the whole Search API D8 suite including PHPUnit tests using the way the drupal.org testbot would do also. The benefit here is that it is also super speedy!

To compare it, when I run the same command on my local machine I don't know if I will run the same environment as the drupal.org testbot plus it is also slower. On my own machine it takes 1 minute and 42 seconds, almost double the time it takes on the testbot on vagrant.