howto test a patch and make a difference!
TRANSCRIPT
![Page 1: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/1.jpg)
HowTo:
Test a Patch and make a difference!
By: Joel 'Senpai' Farris
![Page 2: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/2.jpg)
Who Am I?I'm a Drupal Consultant, a themer, a web developer, and an open-source fanatic who's been active in the Drupal community since v4.7.I love to ride Harleys, play beach volleyball, and game on my PS3.
![Page 3: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/3.jpg)
ThePatch
TestingProcess
![Page 4: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/4.jpg)
The Process is:
1. Developer sees a need for an enhancement or a deficiency that needs to be fixed.
2.Code is produced that works, more or less.
3. The new code is 'diffed' with the original code to create a .patch file.
4. The resulting file is uploaded to that module's issue queue to await testing.
5.Someone reviews the patch visually, or tests it manually, plus automatically with the AutoBot.
![Page 5: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/5.jpg)
Why Do We Test?
Patch testing is the only way to ensure a quality codebase.
The Patch Testing Cycle provides for more than one person's brain to validate the patch's logic, featureset, or bugfix.
![Page 6: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/6.jpg)
Who Should Help?
People that want a new feature added.
Those desire to see improvements.
Web developers who write code.
Web developers who don't write code.
Anyone who believes in the future of Drupal.
![Page 7: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/7.jpg)
Can I Do It?Yes, you can, regardless of your skill level.
Is It Hard To Do?Yes, because it's a complex process.
![Page 8: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/8.jpg)
A Patch file is simply a 'diffed' comparison of one or more files
with their original, unchanged version
Patch?
![Page 9: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/9.jpg)
![Page 10: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/10.jpg)
The Issue Queue
![Page 11: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/11.jpg)
Enabling your
sidebar links
![Page 12: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/12.jpg)
Find a Patch to
test
![Page 13: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/13.jpg)
Node/88264
![Page 14: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/14.jpg)
![Page 15: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/15.jpg)
Pay attentionto Status, Assigned,& Priority
![Page 16: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/16.jpg)
![Page 17: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/17.jpg)
![Page 18: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/18.jpg)
![Page 19: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/19.jpg)
"Patch applies cleanly to HEAD, but I'm not sure what to test..."
5
![Page 20: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/20.jpg)
![Page 21: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/21.jpg)
"Question:In which cases would I not specify default value for this argument?
8
![Page 22: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/22.jpg)
This iscalled apatch re-roll.
10
![Page 23: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/23.jpg)
No Go!This is back to CNW.
12
![Page 24: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/24.jpg)
Cool,Another re-roll...
15
![Page 25: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/25.jpg)
Oh look, a patch to test! W00t!
15
![Page 26: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/26.jpg)
![Page 27: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/27.jpg)
When saving the patch locally, give it a name that's meaningful to you.Usually, the format of nodenumber_modulename_functionality works well.
example:88264_core_variableget_defaults.patch
![Page 28: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/28.jpg)
ApplyingThe Patch
![Page 29: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/29.jpg)
cd /www/dheadcp /www/patches/7/core/example.patch .patch -p0 < example.patch
patching file includes/bootstrap.incpatching file includes/file.incHunk #1 succeeded at 1458 (offset 51 lines).patching file modules/user/user.testpatching file modules/color/color.modulepatching file modules/locale/locale.installpatching file modules/simpletest/tests/bootstrap.testpatching file modules/system/system.api.phppatching file modules/system/system.installHunk #2 succeeded at 2489 (offset -2 lines).Hunk #3 succeeded at 2851 (offset -2 lines).Hunk #4 succeeded at 3088 (offset -2 lines).
~ joel$dhead joel$dhead joel$
dhead joel$ patch -p0 -R < example.patch
![Page 30: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/30.jpg)
dhead joel$ cvs -q diff | patch -p0 -Rwget -O - $1 | patch -p0dhead joel$
![Page 31: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/31.jpg)
ReportingThe Results
![Page 32: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/32.jpg)
![Page 33: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/33.jpg)
RTBC, baby!16
![Page 34: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/34.jpg)
Study Materials
The Handbook pages: drupal.org/patch
Cool shortcuts: drupal.org/node/128436
Screencast: drupal.org/node/132745
![Page 35: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/35.jpg)
AnyQuestions?
![Page 36: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/36.jpg)
Next Up:
Saving Webchick Time - The SagaCommonplaces room @5:15 (that's this room, silly)
![Page 37: Howto Test A Patch And Make A Difference!](https://reader034.vdocuments.us/reader034/viewer/2022052514/5881db971a28ab331a8b7803/html5/thumbnails/37.jpg)
TheEnd
twitter @joelfarris