Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
To make sure my patch from #234004: Drag and drop node ordering doesn't break anything, it seems like a good idea to add test cases to the module.
(I'm aware of the old D5 cases in http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/nodequeue/t...)
First set of tests attached.
Comment | File | Size | Author |
---|---|---|---|
#17 | nodequeue.test | 49.87 KB | fizk |
#12 | nodequeue.test | 48.42 KB | Steven Merrill |
#10 | nodequeue.test | 49.07 KB | Steven Merrill |
#10 | testqueue.info.txt | 187 bytes | Steven Merrill |
#10 | testqueue.module.txt | 181 bytes | Steven Merrill |
Comments
Comment #1
ezra-g CreditAttribution: ezra-g commentedThanks!
Marking as needs review.
Comment #2
wulff CreditAttribution: wulff commentedAdding tests for users with the 'administer nodequeue' permissions.
Next on the list: Tests for the API functions.
Comment #3
wulff CreditAttribution: wulff commentedAdded some more test cases.
Comment #4
wulff CreditAttribution: wulff commentedAdded some more test cases. Current coverage is 70%.
Comment #5
ezra-g CreditAttribution: ezra-g commentedPlease accept my delayed and large thanks.
When I ran these tests, almost all pass with only a few exceptions, and then I encounter a 500 error. I need to fix my testing environment so I can finish making sure that the tests pass and then this will be committed.
Comment #6
wulff CreditAttribution: wulff commentedFinally hit 90% coverage. This set of test cases will result in a few fails until we fix a few minor issues.
Comment #7
ezra-g CreditAttribution: ezra-g commentedThe 500 errors were happening in part because of undefined functions called in the tests ($document->setMultiValue($key, $sqid) in nodequeue_apachesolr_update_index ) and nodequeue_ajax_add being removed from Nodequeue.module when we implemented #234004: Drag and drop node ordering. Of course, that move broke many of the tests here ;). With the nodequeue_ajax_add tests removed (and $document->setMultiValue temporarily commented out) , I'm showing 623 passes, 32 fails, and 43 exceptions.
The test results are attached as a png, which seems kind of wrong, but allows us to see the results without running the tests again.
@wulff: I'll unassign but of course feel free to join in here again ;).
Comment #8
Steven Merrill CreditAttribution: Steven Merrill commentedHere's one with all tests passing as of today, other than ApacheSolr, which I moved into a new group so that I could not run it with the rest. Mostly, there needed to be some small changes made to stay in step with error messages. In addition, I removed the up/down testing, since the table view is now draggable.
Comment #9
Steven Merrill CreditAttribution: Steven Merrill commentedReview, please!
Comment #10
Steven Merrill CreditAttribution: Steven Merrill commentedWhoops. _nodequeue_ajax_add() is no more.
Here's a new patch. It also has some tests and a mock module in place for a reroll of #606150: Hook for queue deletion .
Comment #11
Steven Merrill CreditAttribution: Steven Merrill commentedSome of these still fail when the site is in a subfolder. Further patch coming.
Comment #12
Steven Merrill CreditAttribution: Steven Merrill commentedOkay - here we go. Support for running in a subdirectory or at the site root, and a couple last fixes around how the test nodequeues were being populated.
Comment #13
ezra-g CreditAttribution: ezra-g commentedHooray! All tests pass on the latest 6.x-2.x branch. Committed, and marking as needs porting for 7.x-2.x :).
http://drupal.org/cvs?commit=463068
Huzzaaaah!
Comment #14
kenorb CreditAttribution: kenorb commentedSimpletest under 6.x is returning Fatal error:
#1777622: Simpletest: Fatal error: Call to undefined method stdClass::setMultiValue() in nodequeue.module on line 422
Comment #15
penyaskitoI'm getting fatal errors when running tests with 5.3 because of use of passing references. E.g.: &$form_state is not longer needed.
Comment #16
kenorb CreditAttribution: kenorb commentedComment #17
fizk CreditAttribution: fizk commentedI've updated the tests to work for 7.x-2.x, but some are still failing.
Comment #18
fizk CreditAttribution: fizk commentedWe have working tests for 7.x-2.x. Congrats!
Comment #19
fizk CreditAttribution: fizk commentedFor some reason two tests fail on Drupal.org test bots: #2557343: Two tests fail for nodequeue module.
Does anyone know why it breaks only for the test bots?