5. Now think again more carefully. Try not to get annoyed "The code that you are running, is that what you deployed?"
At the wrap up meeting for WordCamp London contributor day, Jenny Wong asked
What have you done today that you’re proud of
I’ve done something that I am not proud of… I’ve spent an hour testing the wrong version of code.
My machine is set up with multiple WordPress installations running under Apache 2.4.
I was working on WordPress TRAC #29714.
It’s a problem that I discovered in WordPress 4.0. I had a workaround for the problem and a fix. By commenting out or un-commenting a single line of code from either the workaround or the fix I was able to reproduce and then fix the problem. I could easily demonstrate the workaround on WordPress 3.9.3, but couldn’t get the workaround to work on WordPress 4.1-beta2.
I’ve recently started using symlinks, to enable me to change code in one place and test it in another environment. It turned out that I’d not created a symlink for the code that contained the workaround. So when I changed my workaround code in my WordPress 4.0 environment the effect toggled; but it didn’t make a blind bit of difference on the 4.1 environment, since I hadn’t actually changed the code.
I corrected this on the train back from London, and was able to confirm that my workaround and the patch I’d developed both work on WordPress 4.1-beta2.
Which means that I can happily upgrade to 4.1 when it goes live and continue to use my workaround if the TRAC is destined for a future release.
My challenge now is to develop a unit test that will only pass when the patch is applied.