Closed (fixed)
Project:
Configuration Update Manager
Version:
8.x-1.x-dev
Component:
Drush commands
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
17 Dec 2014 at 06:31 UTC
Updated:
20 Nov 2016 at 14:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jhodgdonSome docs on Drush tests:
https://github.com/drush-ops/drush/blob/master/tests/README.md
Comment #2
jhodgdonComment #3
jhodgdonComment #4
traviscarden commentedI had to figure this out for Shunt module, @jhodgdon. You can look at what I came up with, in case its of any help to you. @moshe-weitzman confirmed that I did things correctly.
Disclaimer: I did this months and months ago and haven't run it recently, so your mileage may vary. I hope it helps!
Comment #5
jhodgdonThanks! I'll take a look when I have time to get back to this issue.
Comment #6
jhodgdonA bug came up in the diff command... really should make these tests!
Comment #7
jhodgdonI decided the easiest thing was to add tests for the Drush functions to ConfigUpdateTest. I had to make a small change to the drush diff function so that it returned something rather than just printing the output. I tested this Drush command manually and it still works correctly with this change.
This test unfortunately uncovered a Core bug:
#2824410: DiffFormatter component class has leak from core class
So I am attaching a patch here but it will be problematic to commit it until the Core bug is fixed, because the tests will probably fail with 4 exceptions. Sigh. Well, let's see. If the tests pass here I can commit the patch.
Comment #9
jhodgdonYup, that's the core bug. Well, we'll just have to wait until that gets fixed to commit this. Anyway, the Drush tests pass other than this Core exceptions bug.
Comment #10
jhodgdonOh. I need to take out the drush.print if I'm returning the values, or it gets double-printed.
Comment #12
jhodgdonThe core bug was fixed; retesting...
Comment #13
jhodgdonComment #15
jhodgdonYeah, the tests passed this time! Committing these new tests.