Testing patches with VVV on Mac OS

Install Vagrant

Download Vagrant from https://www.vagrantup.com/downloads.html.

Click MAC OS X.

Screen Shot 2016-01-28 at 9.53.03 AM

Click vagrant_1.8.1.dmg.

Screen Shot 2016-01-28 at 9.54.54 AM

Click Vagrant.pkg

Screen Shot 2016-01-28 at 9.56.35 AM

Click Continue.

Screen Shot 2016-01-28 at 9.57.36 AM

Click Install.

Screen Shot 2016-01-28 at 9.58.17 AM

Enter password and click Install Software.

Screen Shot 2016-01-28 at 9.59.01 AM

Click Close.

Screen Shot 2016-01-28 at 9.59.14 AM

Install Virtualbox

Download VirtualBox from https://www.virtualbox.org/wiki/Downloads.

Click VirtualBox 5.0.14 for OS X hosts amd64.

Screen Shot 2016-01-28 at 10.02.22 AM

Click VirtualBox*.dmg

Screen Shot 2016-01-28 at 10.03.55 AM

Double click VirtualBox.pkg.

Screen Shot 2016-01-28 at 10.05.04 AM

Click Continue.

Screen Shot 2016-01-28 at 10.05.45 AM

Click Continue again.

Screen Shot 2016-01-28 at 10.06.29 AM

Click Install.

Screen Shot 2016-01-28 at 10.06.58 AM

Enter password and click Install Software.

Screen Shot 2016-01-28 at 10.07.27 AM

Click Close.

Screen Shot 2016-01-28 at 10.08.08 AM

Initialize Vagrant

Launch the Terminal app. One way of doing this is to open Spotlight with ⌘ + space and then type Terminal.

Screen Shot 2016-01-28 at 10.18.17 AM

Enter sudo vagrant plugin install vagrant-hostsupdater

Screen Shot 2016-01-28 at 10.25.29 AM

Type your password and hit Enter.

Screen Shot 2016-01-28 at 10.25.34 AM

Success.

Screen Shot 2016-01-28 at 10.25.55 AM

Enter sudo vagrant plugin install vagrant-triggers

Screen Shot 2016-01-28 at 10.28.55 AM

Success.

Screen Shot 2016-01-28 at 10.29.19 AM

Install GitGit Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to learn and has a tiny footprint with lightning fast performance. Most modern plugin and theme development is being done with this version control system. https://git-scm.com/.

https://git-scm.com/download/mac

Todo: Step-by-step screenshots

Install VVV

Create a directory for your VVV sandboxes. I call mine Sandbox.

Enter mkdir ~/Sandbox

Screen Shot 2016-01-28 at 10.32.03 AM

Enter cd ~/Sandbox

Screen Shot 2016-01-28 at 10.34.37 AM

Clone VVV by entering git clone git://github.com/Varying-Vagrant-Vagrants/VVV.git vagrant-local

Screen Shot 2016-01-28 at 10.36.12 AM

Success.

Screen Shot 2016-01-28 at 10.36.34 AM

Enter cd vagrant-local

Screen Shot 2016-01-28 at 10.37.59 AM

Enter vagrant up

Screen Shot 2016-01-28 at 10.43.21 AM

Enter your password when prompted.

Screen Shot 2016-01-28 at 10.44.03 AM

This takes a long while as there is much to download. Refresh your beverage and come back in about an hour.

Success.

Screen Shot 2016-01-28 at 10.44.12 AM

Enter vagrant ssh

Screen Shot 2016-02-08 at 8.09.31 AM

Success.

Screen Shot 2016-02-08 at 8.09.45 AM

Enter cd /srv/www/wordpress-develop/

Screen Shot 2016-02-08 at 8.14.23 AM

Enter sudo npm install

Screen Shot 2016-02-08 at 8.14.38 AM

Success.

Screen Shot 2016-02-08 at 8.14.59 AM

Enter sudo npm install -g grunt-cli

Screen Shot 2016-02-08 at 8.16.44 AM

Success.

Screen Shot 2016-02-08 at 8.16.55 AM

Enter grunt build

Screen Shot 2016-02-08 at 8.20.14 AM

Success.

Screen Shot 2016-02-08 at 8.20.08 AM

These sites are now available via your browser.

Apply a patch

Before applying a patch, make sure VVV is running and ready. Issue the following commands in a new terminal window.


cd ~/Sandbox/vagrant-local/
vagrant up
vagrant ssh
cd /srv/www/wordpress-develop/
grunt watch &
svn up

Now you’re ready to patch. Find a ticket with patches. This examples uses #11863.

Enter grunt patch:11863

Screen Shot 2016-02-08 at 8.38.49 AM

Using the arrow keys, select the desired patch. You’ll almost always want the latest one, which is pre-selected.

Screen Shot 2016-02-08 at 8.39.27 AM

With the desired patch selected, hit enter.

Screen Shot 2016-02-08 at 8.40.58 AM

If the patch did not apply cleanly, drop a comment on the ticket nothing that the patch does not apply cleanly and needs to be refreshed.

The patch is ready to test. Visit http://src.wordpress-develop.dev/ and log in with the username “admin” and password “password”.

When done testing, remove the patch using svn revert.

Enter svn revert -R .

Screen Shot 2016-02-08 at 8.49.14 AM

Successful revert.

Screen Shot 2016-02-08 at 8.50.19 AM

Comment on the ticket with testing notes and testing steps. If the patch alters user interface, upload screenshots of the patch in action.

Resources

  • https://make.wordpress.org/core/handbook/testing/patch/
  • https://make.wordpress.org/core/handbook/tutorials/installing-a-local-server/installing-vvv/
  • https://make.wordpress.org/core/2015/03/16/mobile-patch-testing-with-vvv-and-xip-io/
  • https://github.com/Varying-Vagrant-Vagrants/VVV
  • https://www.vagrantup.com/downloads.html
  • https://www.vagrantup.com/docs/getting-started/
  • https://www.virtualbox.org/wiki/Downloads
  • https://git-scm.com/download/mac